Hallo, Thomas Ouellet Fredericks hat gesagt: // Thomas Ouellet Fredericks wrote:
Your code could be greatly simplified if you used lists to trigger the line objects (for example, sending the message 0,1 1000 will start from 0 then ramp up to 1 in 1 second).
I also did a simplification to this nice game: I change the invader.pd to use an external file for the "model" of the aliens. It's attached as invader2.pd ready to be dropped in as replacement for invader.pd (only used in enemytest). Make sure, the invader.txt file is next to it.
Regarding the format of invader.txt: It uses coordinates starting in the lower left corner, so the origin (0,0) is not the center of the invader. To correct that a line with "offset num num" is used. The spread between the individual pixels can be set in a similar way with "spread". See attached xcf-image (for gimp) for how the coordinates were written.
Oh, and of course I added an explosion. ;)
But explosions have to be implemented in the main game first (that is, the "destroy" message must not move the invader out of sight, otherwise the nice explosion will stay invisible. I leave that as an excercise for the reader.
Frank Barknecht _ ______footils.org_ __goto10.org__