Hi,
it's pretty great :-)
I suggest that it must create an island from which it is impossible to
go out of screen walking !! So the first coordinates on the left should
be ZERO, idem for the right!
Bye,
Matt
Kurosu a écrit :
Hello,
I guess this is a pet peeve for some of you but I thought I may give a
try at
this stuff. So here it comes, in all its brutal, non-glamourish, C-source
shape. The attached tarball holds a RGBA image called out.png which is an
example of what the program produces.
Basically what it does is drawing a line with points of random
ordinate but strictly going from the left to the right, then fill the
bottom with a texture, and add sprites either on the ground or under
the ground (i.e., into the textured areas).
The program takes as input (CLI help available):
- width and height
- number of points of the ground line
- maximal absolute random height variation between 2 points
- declivity (a constant term added to the random height variation, but
that
can be inversed whenever the bottom or top of the image are met)
- name of the input file (either a RGBA PNG or a RGB24 PPM)
- name of the underground texture file (any format supported by
SDL_image will do)
- name of the one sprite for the ground surface (idem)
- name of the one sprite for the underground (idem)
The output is rather ugly, the program is probably leaking and may
segfault. Still, it's a start point. btw, the images are not my
property: they are only made available for the purpose of showcasing.
The bonus is that it mostly uses SDL so this could probably be ported
over to wormux after the 0.7 release.
Regards,
Kurosu
------------------------------------------------------------------------
_______________________________________________
Wormux-dev mailing list
Wormux-dev@gna.org
https://mail.gna.org/listinfo/wormux-dev