[Squeakland] missing from etoys?
billkerr at gmail.com
Wed Oct 31 20:29:51 PDT 2007
I've solved some of the problems but still have at least one big one
Can move and shoot at the same time
Can make a single sound when shooting
Can simulate a key press
When I fire a second bullet the first bullet stops moving (main current
Can only create new bullets when an original bullet is on the screen (it
would be nice to create from scratch but I suppose I can live with that)
Each new bullet is automatically named bullet1, bullet2, etc
My script sets the timer running for a newBullet (Player variable) . So when
a second bullet is created then the first bullet stops.
Each new bullet has its own player with it's own timer. So, what's a good
way to manage firing multiple bullets and then tidying up as they reach the
top of the screen or hit a target (without deleting all the siblings?) I'm
finding that hard.
I've put my project here:
self getNewBullet setHeading: 0.0.
self getNewBullet setY: self getY + 10.
self getNewBullet setX: self getX
World2 getLastKeystroke =3D '<up>' ~~ false
ifTrue: [self setNewBullet: Bullet1 getNewClone.
Bullet1 beep: 'clink'.
Bullet1 startScript: #move.
World2 setLastKeystroke: '<down>'] "simulate keypress"
Gun1 getNewBullet forward: 5
(I haven't included the code that moves the gun left and right)
I do have a delete siblings script which I use to tidy up but it's not
self tellAllSiblings: #delete
Some bits of Karl's tutorial are dated but it was very useful - thanks. I
had to go through and put newBullet in everywhere, it didn't work by just
replacing <gun prime> with <gun's new bullet prime>, which is what Karl's
tutorial seems to do. I had to replace each line of the <gun prime>
procedure code with <gun's new bullet prime>
At any rate, many thanks for the help
On Oct 29, 2007 7:06 AM, Karl <karl.ramberg at comhem.se> wrote:
> Bill Kerr wrote:
> > I see making a shooter, eg. a space invaders simulation, as a nice
> > first game activity for children, one that many find highly motivating
> I made a tutorial a long time ago about this.
> I think there are some issues with the layout of images and the text.
> Also it does not use keyboard but the joystick morph.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeakland