dop2000's Forum Posts

  • System compare two values

    mid(text, index, 1) not equal " "

  • Remove/disable everything and try this simple code:

    Is touching LeftButton -> Player simulate pressing Left
    
    Is touching RightButton -> Player simulate pressing Right
    
    Is touching JumpButton -> Player simulate pressing Jump
    

    If it works fine, then you can add sub-events to each of those 3 events, in which you can check if player is on the floor and change animations if necessary.

  • And why do you need to do that?

    If the red area consists of 3 rectangular sprites, it's farily easy.

    If it's one sprite, you will need to define its collision polygon, and then it will be possible to fill it with small sprites or tilemap.

    If you can't change the collision polygon (for example for images loaded at runtime), then you will need to use Canvas plugin to detect pixels.

    .

    Having thousands of 1*1px sprites is a bad idea, it's better to use tilemap, see examples in this post:

    construct.net/en/forum/construct-2/how-do-i-18/simple-scorched-earth-worms-ga-129595

  • Why do you want to do this? If you need to change the color of red area, there are much easier ways - you can use "Set color" effect or blend modes.

  • Use "Is touching object" events to move left or right and "On touched object" event to jump. Also, I suggest previewing your project in Chrome, as Firefox doesn't work well with multi-touches.

    See this tutorial:

    scirra.com/tutorials/4973/multi-touch-movement-controls

    .

    If all of the above doesn't help, please post your capx file.

  • Also, to make the final part of the lerp faster you can increase the destination value a bit. So if you want to zoom from 0.5 to 1, instead of this:

    set scale to lerp(layerscale, 1, dt*10)

    do this:

    set scale to min(lerp(layerscale, 1.1, dt*10), 1)

    lerp will be changing the scale to 1.1, but the min() function will stop it at 1.

  • I made a demo for you:

    dropbox.com/s/7g0bhiv1kokxgum/ArrayDemo4.capx

  • On every tick

    If object opacity>35 : Object set opacity to (object.opacity-0.1)

  • "On collision" picks only 1 instance of the object (the one that collided). You need to pick all instances, do this:

    Snake On collision with bonus
    ...(subevent)..System Pick All Snake 
    .......(subevent)..Snake set width to [something]
    

    .

    Another option is to use a function -

    On collision call function "IncreaseSnakeSize"

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • You do not have permission to view this post

  • When you create a family object, a random member of the family is created. So you need to specify which object you want to create.

    Do this:

    Note that DragDrop behavior is enabled by default for all parts.

    Another option is to add an instance variable "type" to the Parts family and do something like this:

    Parts on GragDrop Start
    ...Parts type=24 -> Parts spawn Attack24
    ...Parts type=26 -> Parts spawn Attack26
    ...
    ...
    
  • There are several ways to do this:

    1. Create a dummy object (an empty sprite for example), set it as Global and add No Save behavior. Move all your global variables to instance variables on this sprite.

    2. Save these variables to Local Storage. After loading a saved game, retrieve variables from Local Storage.