How do I limit scrolling and destroy copies in order

0 favourites
  • 4 posts
From the Asset Store
Change the size and position of everything without calculating anything!
  • Hello all! It's been forever since I used C2 and I'm a bit rusty! So I'm trying to create a simple text adventure game, similar to "Lifeline". I came up with the idea of using one sprite (essentially a long image with text boxes), placing smaller sprites over the text and using timers to destroy the sprites to slowly reveal the text.

    Question 1 - How do I set a timer to destroy the sprites in order? Right now, all small sprites run an animation and destroy themselves within 3 - 6 seconds. I want the first sprite to run the animation, destroy itself, the process to repeat on the next copy, and etc.

    Question 2 - Possibly more complicated - How can I limit the player's ability to scroll only so far as their progress? That is to say, you shouldn't be able to scroll down to see blank space. Any thoughts or suggestions? Is this a feasible way to create a text based adventure? Thanks!

    Note: I'm making this for mobile so the visuals/resolution/controls are optimized for mobile. Should work on browser though ... .capx?dl=0

    edit: formatting and less words

  • Add an instance variable "id" to your sprite. Set id=1 for the first instance, id=2 for second etc.

    On start of the layout:

    Pick Sprite with id=1, Start timer, Start animation

    On timer:

    Sprite destroy

    Pick Sprite with next id, start timer, start animation

  • Thanks I tried and I think I got it half right. The first sprite animated and destroys as intended but that's all that happens. ... .capx?dl=0

    So I was actually hoping to create an efficient function that automatically destroy the sprites in order, maybe with a loop, instead of me individually picking instances through events. I actually updated my events to reflect the desire to create a convenient function.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Function is a good idea, if you modify it like this, it should work:

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