How do I make bullets without many sprites.

0 favourites
  • 4 posts
From the Asset Store
In this template the music plays without looping in your game
  • Hello again, I will get straight to point. In the game there is a box on the right-bottom corner which shows player bullets.

    I created another sprite for each bullet and I did the events like this:

    However I want to know how to make all bullets spawn and destroy one by one when the variable changes without separate sprites.

    -Cem

  • Instead of using different sprites copy and paste the same sprite but add an instance variables to it found in the object's properties bar. You could name the instance variable KursunSayisi and choose 0, 1 or 2 for each instance of the sprite.

  • Or you can write function:

    printBullet(bullet cont)

    -destroy bullet

    -for i=1 to i=bulletCount

    -create bullet x:layoutWidth - 30*loopindex; y: layoutHeight - 30

    But better use #Rexro metod

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Make an animation with 9 Frames. Frame 0 no Bullet, frame 1 one bullet, frame 2 two bullets and so one.

    Now you can set easy the number of bullets with 'Sprite| Set animation frame to'

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