Is there a better way to do this?

0 favourites
  • 3 posts
  • <img src="http://i50.tinypic.com/2jaybmq.jpg" border="0" />

    When user presses the space bar a rocket is spawned and fired towards the right.

    If however, the player has bonus BulleyType type then two more rockets are spawned and fired at an angle.

    My problem is that the user must have a rocket in their supply. As it stands the extra two rockets are not spawned if (section 35) they had only one rocket. The first bit of code (section 35) reduces rockets by one.

    One way I can get around it is to set up another variable "just fired" which is set to true in the first section and tested in the second session instead of testing for rockets >= 1.

    However, is there are more elegant way to do this? If so how?

  • Make a sub event under event 35:

    System -> Compare Values BulletType >= 1

    -- (Spawn your other two rockets)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Cheers. A new world has opened up for me :)

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