I'm just starting out in PD but 99.9% of the time I can break something down and figure out how it works or find something online, but can someone explain to me how to use two gemheads to render a pattern with just on geo. I understand the textfile object and the text file part what I down get is why it works. Thanks, Alain
From: Frank Barknecht fbar@footils.org Date: 2007/05/05 Sat AM 04:58:59 EDT To: pd-list@iem.at Subject: Re: [PD] Space Invaders 4D Game
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__
Hallo, nosehair911@bellsouth.net hat gesagt: // nosehair911@bellsouth.net wrote:
I'm just starting out in PD but 99.9% of the time I can break something down and figure out how it works or find something online, but can someone explain to me how to use two gemheads to render a pattern with just on geo. I understand the textfile object and the text file part what I down get is why it works.
The double gemhead trick is based on "forced rendering". If you look at the gemhead help file, you will see, that banging a gemhead will make it render just one frame.
In the double-gemhead configuration, the upper gemhead basically ist just a metro driving the rendering of the lower gemhead with bangs. (But you cannot use a normal metro here, as the bangs have to be timed exactly in sync with the gemwin's frame rate.)
The lower gemhead as default is switched off (with a loadbang -> 0), so that it is not rendering, unless it receives a bang.
The with some simple [t b a] voodoo you can make many forced renderings of the same geo but with different transformations applied to each. See attached example patch for this in action.
Frank Barknecht _ ______footils.org_ __goto10.org__