Multiple balls?

0 favourites
  • 7 posts
From the Asset Store
Be quick and choose the right answer for the shown equation.
  • Hello,

    I'm working on a simple game where you shoot a ball up the screen and it bounces of various objects and lands in one of several scoring slots. its working okay but I now want to add multiple balls, not at the same time, but lets say you have 10 balls and once you fire ball 1 and it comes to rest in a slot, it stays there and you get ball 2 to shoot.

    I know I could do this by copy/pasting all the events for ball1 10 times. but thats a very poor way of doing it I suspect. there will be a very simple way to go this I know of it. but I don't know how.

    if someone could give me a little hint on how to do it, that would be super.

  • Perhaps, apply the event to an "Active" ball.

    Set a boolean on the object called active, and set it to true when shooting with it.

    Once its in a hole, set the boolean to false. Then next ball gets the boolean to true etc etc

  • must have physics behavior, even if its a bouncing bullet to stop.... use the "Is Sleeping" event for the objects physics

    add global variables "reload"+"count" , a ball instant boolean, and a variable "stop"

    Is Sleeping : set ball boolean true

    while ball on layout , "stop" =0 :

    -------- boolean = false :

    -------- boolean = true : +1 to GV"count" +1 to "stop"

    GV"count"=GV"balls" : set reload to 0

    Reload = 0 : spawn ball position x,y, +1 to GV"balls", set reload to 1

    this should keep a track of whats on the stage, and you can easily have the "count" shown in a text box... if your thinking of 300 balls

  • Thanks to both of you, I think this is a bit over my head atm so I'm going to file this game and come back to it at a later date when I understand more of C2.

    Thanks though, much appreciated.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • here's a simple way of doing it: ... aunch.capx

    btw what game is that in your avatar? looks familiar (spectrum?)

  • Oh thank you very much I'll check that out when I'm on my PC later

    The game is called Mazogs and it was on the ZX81 which is the ZX Spectrums daddy

    There was a Spectrum version called Maziacs which was looked better then the ZX81 version but wasn't as much fun.

  • here's a simple way of doing it:btw what game is that in your avatar? looks familiar (spectrum?)

    Sadly it won't load

    Says I'm using an older version of the software.. I'm on 212

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)