Login
Community
DARK THEME

I love this page haha

I love the idea of this page xD

What if we did want to post stuff here that was on topic? Would that still be okay (as in on topic but not particularly relevant in any way)

I just want to say I'm kind of collaborating on a project similar to tank trouble (if any of you know what that game is) but we're not that far through, maybe 40%. We're struggling a bit with figuring out how to do the flat tank collisions (although we haven't gotten to coding that yet) and also spawning of bullets (although I got a recommendation about using a list so if anyone has any suggestions about how to implement that it would be helpful)

I'm also starting on a simple shooting game (like those arcade style plane ones) although I only just started on that yesterday.

The bullet spawning should use a list as recommended. You could store bullets as a class, and then store each new instance of the class in a list like listExample[0] = new bullet or listExample.push(new bullet). That way you could update all the bullets using a for loop like below:

for bullet in listExample
  bullet.updateBullet() //this is obviously an example, it would most likely be a lot more complicated than that
end

This allows you to have as many bullets as you want (although lag will come in if you have too many). Hope you find this helpful for your bullets.

Yep, thanks for the reply. To make the game we were planning to make a bullet cap of approximately 5 - so would I do

listExample[0] = bullet0, listExample[1] = bullet1

etc. and then you would of course update each bullet recording their positions and delete them as they go off screen, reducing the bullet counter and firing another one.

You can see if a forum is being adopted when something is posted in Off Topic for the first time. Even if it is on topic.

lol

I just felt like I had to post something (and I didn't want to go too far off topic, anyway) in that area. Besides, the on topic part is only for some stuff that I feel like I can do myself, it just might take a bit longer. I am also considering writing an article (although it would be of dubious quality) about raytracing, since that would be something interesting for me. Although that might be still quite a bit in the future...

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community