[PD] Space Invaders 4D Game

Frank Barknecht fbar at footils.org
Sat May 5 10:58:59 CEST 2007


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. 

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__
-------------- next part --------------
offset -5.5 -3
spread 0.4 0.4
0 1
0 2
1 3
1 4
2 1
2 2
2 3
2 4
2 5
2 7
3 0
3 2
3 3
3 5
3 6
4 0
4 2
4 3
4 4
4 5
5 2
5 3
5 4
5 5
6 0
6 2
6 3
6 4
6 5
7 0
7 2
7 3
7 5
7 6
8 1
8 2
8 3
8 4
8 5
8 7
9 3
9 4
10 1
10 2
10 3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invader.xcf
Type: application/x-xcf
Size: 35344 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070505/f3d9e3bd/attachment.xcf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invader2.pd
Type: application/puredata
Size: 2340 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070505/f3d9e3bd/attachment.bin>


More information about the Pd-list mailing list