How do I clone a Ball with same properties like the Original

0 favourites
  • 4 posts
From the Asset Store
Bouncing ball
$9.99 USD
Template for a bouncing ball game, fully documented in comments and video
  • I have another problem with my Breakout Game.

    I have setup a "Multiball" Powerup. The Ball are split and move when i collect them, but the new Ball does not have the same properties like the original Ball (it will spawn a normal ball)

    Example: I have a Fireball as original Ball -> i collect the "Splitball Powerup", but the new (second) Ball are a Normalball.

    These are my Actions. Do anyone see the False? And how i can limit the maximal Balls on Screen?

  • Make sure your not setting the ball back to original in another event that is overwriting the changes being made here.

    If only one type of ball can exist on screen at a time you could also make a global for each type and set it to 1 (and rest to 0) when that ball is active and then have your spawn only spawn the type set to 1, then reset when it changes.

  • Use the .AsJSON expression and "set from json" action to copy object state. Ex:

    Global text temp=""

    For each ball

    ---Set temp to ball.AsJSON

    ---ball: spawn ball at image point 0

    ---ball: Set form JSON string temp

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thank you - your method work for me.

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