GLBasic forum

Main forum => GLBasic - en => Topic started by: augustus on 2008-Aug-11

Title: I need some help... (More help needed)
Post by: augustus on 2008-Aug-11
Thanks to Moru for solving my original problem!

I've got the fireball code up-and-running, but now there is one more error that is preventing me from moving on to actual levels.

Code (glbasic) Select
IF fireball_exists = FALSE
fireball_x = plx
fireball_y = ply
ENDIF
IF KEY(44)
fireball_exists = TRUE
IF faceright = TRUE
fireball_speed = 1
ENDIF
IF faceleft = TRUE
fireball_speed = -1
ENDIF
ENDIF
IF fireball_exists = TRUE
DRAWSPRITE 4, fireball_x, fireball_y
fireball_x = fireball_x + fireball_speed * 1.5
IF fireball_x > 640
fireball_exists = FALSE
ENDIF
IF fireball_x < -32
fireball_exists = FALSE
ENDIF
ENDIF


'ply' is player y-coordinate, 'plx' is similar, 'fireball_x', 'fireball_y', 'fireball_speed', and 'fireball_exists' should be obvious.

Right now, I need to figure out how to have more than one fireball on the screen at a time. By 'more than one' I mean 'as many as the player wants', or 'an exorbitantly large amount'.
Title: Re: I need some help...
Post by: Moru on 2008-Aug-11
Hello!

Your code is drawing the fireball at fireball_x, ply. I think that should be fireball_x, fireball_y

Good luck with your game!
Title: Re: I need some help...
Post by: augustus on 2008-Aug-11
Yeah... that would be a problem... Thanks!
Title: Re: I need some help... (More help needed)
Post by: augustus on 2008-Aug-12
...
Another problem's come up, I'm sorry to say. Posted more information on the first post.
Title: Re: I need some help... (More help needed)
Post by: Kitty Hello on 2008-Aug-13
see the tutorial for my space shooter.
Title: Re: I need some help... (More help needed)
Post by: PeeJay on 2008-Aug-13
You might also find the tutorials on my site useful
Title: Re: I need some help... (More help needed)
Post by: Kitty Hello on 2008-Aug-13
Right. Even better.