Recycling Bullets/Actor Demo

AppsRacKAppsRacK Member Posts: 346
edited November -1 in Working with GS (Mac)
I need some help and guidance on proper way of doing this. Lets say i have a ball actor and i place 5 of them on the scene. I have a button that will interpolate the ball inside the gameplay map and then i have a seperate button to fire it or change its velocity upward. The same happens with other bullets. Im cracking my brains out on how to do this and i ended up with a lot of attributes which i know is not the proper way. I want to check out Victorkin11's sample (http://gamesalad.com/game/3066) coz i think its the closes of what i want to do but it seems that the server update bug the "download Project" button so it doesn show on my browser.

Thanks in advance.

Comments

  • AppsRacKAppsRacK Member Posts: 346
    bump.... anyone???
  • AppsRacKAppsRacK Member Posts: 346
    sorry for the the 2nd bump. It seems a lot of people are busy now. anyway im still hoping someone can point me to the right direction on how to tackle this. The art, gameplay and logic of my 2nd game are already figure out except on this one.

    Thanks again.
  • quantumsheepquantumsheep Member Posts: 8,188
    Hi drahc,

    I don't have time to go into huge detail, but these are the basic principles:

    Every time you press the fire button, a 'firecount' variable should go up by 1.

    Then in each bullet (start position off-screen), when firecount is a certain number, have them change position to the player and move as a bullet would.

    When offscreen, or if they've hit an enemy, move to their start position.

    Each bullet will be an instance with a particular 'firecount' number that triggers it.

    So bullet one will have the rule:
    If firecount=1
    Do bullet stuff

    bullet 2 will have:
    If firecount=2

    do bullet stuff.

    Then obviously reset the firecount on entry into a scene, and make sure that if you have 10 bullets, say, that when firecount > 10 change firecount to 1

    I hope that helps, or pushes you in the right direction! Sorry I don't have time to give more details!

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • AppsRacKAppsRacK Member Posts: 346
    ok i think i get what yours saying QS. The first time i did this is i created 10 actors of bullet but i think i should have just created 1 actor and just place 10 copies of that bullets on the scene and then just unlock them. Then if i get what your saying put a rule inside each of the bullet by making a rule if BulletFire =1 >> move this, then do the rest with the other. Then do the increment of BulletFire on the button by change attribute. Ill try this later when i get home.

    Thanks QS.
Sign In or Register to comment.