How do I use timers to scale and create multple objects

0 favourites
  • 5 posts
From the Asset Store
Goodbye to sprite fonts, when you have something new on the anvil for your upcoming Games !
  • Hey all! Thanks for reading my post in advance. Two quick questions.

    How do I smoothly scale a sprite larger (or smaller)? Sine isn't what I'm looking for. My code seems to do the opposite. Very very slowly makes things smaller. I want sprites to smoothly grow as they move downwards.

    Question two. How do I create multiple objects in an event. Create Wait Create Wait doesn't work. I want to create/spawn 5 sprites in line and have them move down and scale larger, simulating a 3D-ish effect.

    Here's a pic of my code. I'm trying to do both scale and create a multiple coin sprites. My code is doing the opposite I think with scaling. It's making it smaller as it travels. My code makes one coin move toward the player (making it smaller) and another with a 0 bullet angle of motion. What can I do to fix this issue also?

  • There are lots of miss conception about events. I suggest you to read more about how events work in manual.

    The first condition is a trigger, which means it doesn't run every thick but everytime something happens. In your sub-events the set scale action needs to run every thick to work properly and I'm assuming that timer isn't triggering so many times. Also, just to let you know, only for each in a condition already runs every thick so there is no need to use every thick condition

    Example of what you wanted. https://www.dropbox.com/s/l8dmxyq5n6plt ... .capx?dl=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks for the comment kossglobal. I really do need to go through the manual more thoroughly.

    So from what I've read on the forums, people suggest you use timers as opposed to system expressions Every Tick/X seconds. This was my first attempt at seriously using timers. At least I'm partly successful with it because it's spawning and scaling Is there a way to possibly do this using timers?

    I'm trying to some sort of car based Dragons Lair-like animation game. Essentially each movie clip/ screen section of the game would have things spawn and move toward the player. Here's a bit more of my code. Let me know if I'm wrong for using them and should use every x seconds instead. I removed the useless bits you mentioned in your post. Gonna implement the scale changes you made in the capx soon. Just curious how to properly get timers to work now. Thanks!

  • You missed 's point. You can't do scaling & dt inside a timer. That part needs to be done every-tick.

    http://www.blackhornettechnologies.com/ ... rTime.capx

  • Thanks for the comment kossglobal. I really do need to go through the manual more thoroughly.

    So from what I've read on the forums, people suggest you use timers as opposed to system expressions Every Tick/X seconds. This was my first attempt at seriously using timers. At least I'm partly successful with it because it's spawning and scaling Is there a way to possibly do this using timers?

    I'm trying to some sort of car based Dragons Lair-like animation game. Essentially each movie clip/ screen section of the game would have things spawn and move toward the player. Here's a bit more of my code. Let me know if I'm wrong for using them and should use every x seconds instead. I removed the useless bits you mentioned in your post. Gonna implement the scale changes you made in the capx soon. Just curious how to properly get timers to work now. Thanks!

    You are doing the same mistakes man. Do something like this:

    Global Variable (ScaleValue)

    ---on timer "5seconds" -> create obj enemy, Move to bottom

    ------ X<=248 -> set angle of motion

    ------ X>=248 -> set angle of motion

    ---Every tick -> Add 0.08*dt to ScaleValue, Set Scale to ScaleValue

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