I have made a small 2d game with Gosu which has scores, collecting squares, a sprite and sounds. I want to now make my sprite "shoot" bullets.
Basically, when I press spacebar, it makes the sound that I have programmed into the initializer for Bullet, but doesn't draw the bullet. I'm not sure what I'm doing wrong here.
You can't make drawing in
Window.update. Maybe it was possible with older versions, but drawing code needs to be in
@bullets.each do |bullet|
This can be placed as it is in
def draw in
Ah, that gets the bullets drawn, but they aren't moving :(
This is how should
Bullet.update look. They are only accelerating in your code
Ahh, thanks. :D
Now they fire, but really weirdly, and I can't fire them as often as I'd like.
Aha! That worked great :D now I just need to implement bullets going different directions, which I will figure out myself :D
Thanks a lot lol_o2!
Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill