How do I move a row of sprites one by one & mute music and sound

0 favourites
  • 3 posts
From the Asset Store
This is a code so you can see the same skin on all screens (peers). Each peer gets a skin, in addition to 4 directions t
  • Hey all! I'm trying to create a simple space invaders game and I've run into some issues. Only one enemy sprite follows the "looping path" I created. Here's a gif and the code.

    imgur.com/iHDF0a6

    Essentially, the bullet speed/angle changes when the enemy collides with a trigger sprite. A form of this code already works with two waves of enemies but not it's not working here. I know it has something to do with "picking" objects and object instances. This is a topic I've always had some difficulty grasping. Could anyone help me out?

    One more thing, I'm having trouble muting sound fx and music individually. I can mute it all at once but I'd like to give players to option to mute sfx, the music or both. I found a tutorial using WebStorage to key sfx and toggle them on/off but couldn't get it to work. Music plays at start of layout and then this.

    I'd appreciate any advice and thanks for looking! Hope it all makes sense!

  • For it to move like space invaders you can do something like, sprite on collision with waypoint, sub event : system pick all sprites - apply angle of motion, because they always move across and down together right? Don't use a function or a for each.

    Some info on functions, when you try and apply the bullet stats to your heavy object it is not actually picking correctly, I know it implies that it would run the function for the one that collided but it doesn't and the function is separate. You can pass through the heavy objects UID as a parameter through the function, then on the function you say where sprite.UID=parameter 0. That way it will pick the object that triggered the function, but you don't need a function here.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey, I got it! Thank you! I didn't need a function, like you said. I removed it and adjusted a bit of the code. Here it is and a gif for posterity's sake.

    i.postimg.cc/gcqKTswN/lineTest.gif

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