How do I create different sprite every 60 seconds

0 favourites
  • 15 posts
From the Asset Store
Set of 60 cursors. All icons are of a high quality. A good choice for RPG game.
  • Hello,

    I have looked in a forum but couldn't find it. How do I create different sprites every 60 seconds, I have a scrolling game and I will to use them as power ups, there will be 6 different ones. I want them to appear in order I want using create an object or something.

    Thanks,

    Aurimas

  • You don't need different sprites for every power-up. You can use only one sprite named powerup and make the different power-ups different animations (first power-up should be with animation name of powerup0). Then it's easy to do what you want:

    First thing first, create a global variable named powerupnumber (set initial value to 0). Then:

    System -> Every 60 seconds:

    • System -> Create object -> powerup (set X and Y)
    • powerup -> Set Animation -> "powerup" & powerupnumber
    • System -> Set value -> powerupnumber to (powerupnumber+1)%6

    Let me know if you get stuck again

  • Check the tutorials/samples.

  • I think I am stupid, it is not working for me, please see attached how I have done it with two different setups

  • Pretty sure you're not stupid Can you post the capx? We could help you more.

  • See if this helps. It's pretty rudimentary but still.. This is based on different objects rather than one object/multiple animations. It's based on the autorunner template.

  • I think I am stupid, it is not working for me, please see attached how I have done it with two different setups

    In your photos, you create object powerup0 & powerubnumber that means that you'll create objects like powerup00, powerup01, powerup02, ...., and that's not what you want, you want only powerup & powerupnumber so it'll be powerup0, powerup1, powerup2, ... the only thing is that the initial value of powerupnumber should be 0. Then, you have to set it's value to (powerupnumber+1)%(how many animations do you have), so in your pictures should be 3.

    If you still have any problems, post your .capx please

    L. Edit: Only the setup where you have 3 different animations is good. The other one where you have 3 different frames isn't going to work.

  • I had some joy with codah example and it would be perfect for me, but I can't control with member from a family appears and that would be a problem for power up (I want to have an option to cancel all power up), and I still don't have a joy on animation one. please see capx

  • Told you. Change the "powerup0" to "powerup". Check this .capx, is the exact same thing that you sent, just that little modification. But that thing with the families is cool too, I'm new and didn't knew that

  • I tough I have tried to do it (removing 0) and it didn't work , it works fine just one small question how do you assign option: if object overlaps animation0 do this but then it overlaps different animation outcome is different. I can't see it in create object menu, new to this method

  • I think this should work. Player -> On collision with another object -> powerup, is the main condition, and after, for every powerup should have the condition like this: powerup -> Is playing -> powerup0/powerup1/powerup2/... What I did was to change the animation of the Player, you can do whatever you want

    Something else, in the animation list of the powerup, I modified the animation powerup to powerup0.

  • If you have any more questions, ask them here, if I can help I will

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Brilliant, that's what I needed, thank you very much, learned something good

  • Yea, I've learned some things as well, thank you too

  • I tough I have tried to do it (removing 0) and it didn't work , it works fine just one small question how do you assign option: if object overlaps animation0 do this but then it overlaps different animation outcome is different. I can't see it in create object menu, new to this method

    pseudocode..

    IF Object is overlapping OtherObject AND OtherObject.Animation.Frame = x THEN <do something>

    ELSE <do something else>

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