Yann's Recent Forum Activity

  • + System: isMoving = 0
      + Mouse: on Left Click on SpriteA
        -> System: set isMoving to 1
        -> Ajax: request [spritA call] tag:"myCall"
      + Mouse: on Left Click on SpriteB
        -> System set isMoving to 1
        -> Ajax: request [spritB call] tag:"myCall"
    + System: isMoving = 1
      -> SpriteC: move
    + Ajax: on completed "myCall"
      -> System: set isMoving to 0
    // And to not get stuck
    + Ajax: on error "myCall"
      -> System: set isMoving to 0
  • System:Every 5 seconds
    System:Pick random Spawn instance
    [ul]
    	[li]> Create Object Enemy on layer 0 at (Spawn.X , Spawn.Y)
  • Zetar read my previous post

  • Noga I actually provided a capx some months later in this topic http://www.scirra.com/forum/grid-movement-with-gravity-changing_topic48129.html

    But I think how the movement was designed isn't really usefull in a game

  • yeah I was too tired I guess

    You can notice that I didn't even use the "choice" variable I built

    And I also made a mistake building this variable

    Global number Last_Left_Angle=-1 // no discarding at start
    +TrenchTile: Wall = "Left"
    +TrenchTile: Pick nearest to (0,0)
    +TrenchTile: Y > 60
      Local choice = ""  // to store the possible angles 0,1,2,3 * 90
      +System: repeat 4 times
      +System: loopindex is not equal to Last_Left_Angle
        -> System: set choice to (choice = "") ? loopindex : choice&","&loopindex
      -> System: Create object TrenchTile on layer "Tiles Front" at (Left_Wall+Wall_Move, TrenchTile.Y-TrenchTile.Height)
      -> System: set Last_Left_Angle to int(tokenat(choice,floor(random(tokenCount(choice,","))),","))
      -> TrenchTile: set angle to Last_Left_Angle*90[/code:1bw4a28f]
    
    with an example
    [url=https://app.box.com/s/5jdruw05v9s4z5od8sik]randomWithExclusion.capx[/url]
  • Create a detector sprite, make it follow the player sprite but make it so it sticks out of the feet. Then you can check for platform overlap to know on which platform you're on.

    For the every x seconds

    Global number disable = 0
    +System: Every x seconds
    +System: disable = 0
      -> do stuff
    

    If you want to disable the event, set disable to 1

  • Did you try the canvas plugin?

  • Your code is weird. On creation you directly set a random angle, and then you store it in Last_Left_Angle to discard it afterward... What is the point? It will still look like a basic choose(0,90,180,270)

    But I think I understand what you want to do, I would do it like that:

    Global number Last_Left_Angle=-1 // no discarding at start
    +TrenchTile: Wall = "Left"
    +TrenchTile: Pick nearest to (0,0)
    +TrenchTile: Y > 60
      Local choice = ""  // to store the possible angles 0,1,2,3 * 90
      +System: repeat 4 times
      +System: loopindex is not equal to Last_Left_Angle
        -> System: set choice to (choice = "") ? loopindex : ","&loopindex
      -> System: Create object TrenchTile on layer "Tiles Front" at (Left_Wall+Wall_Move, TrenchTile.Y-TrenchTile.Height)
      -> System: set Last_Left_Angle to floor(random(4))
      -> TrenchTile: set angle to Last_Left_Angle*90
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For now, spawning a high amount of tiles isn't super efficient performance wise. I did a little tetris for fun some weeks ago, and the more block you have in the layout, the slower and laggy it gets

    You can see for yourself

    http://dl.dropbox.com/u/23551572/C2-Games/tetris/index.html

  • The main difference are that collision is a trigger and overlap isn't.

    Thus collision is an instant condition, it's true the first tick where the object start overlapping, and then false.

    But! It's a trigger. So it's not exactly the same as doing

    Object: is overlapping
    System: trigger once

    The main difference as far as I know is that triggers aren't checked in the main event loop order. But (not sure) checked before even running the entire game loop, for better speed.

    So you have to be aware that orders between triggered and non trigger events might not be respected. (but order inside a triggered block or between triggers of the same nature are respected)

  • No need to throw toggling into the pit of obliviousness, toggling is usefull and not that buggy.

    But you should either toggle an entire event or some specific actions.

    Toggling a condition is seldom use.

    It's only usefull if you want to rapidly compare two conditions without deleting any.

    The difference between toggling a condition and an entire event, in the UI, is that when you select a condition you only see the condition outlined whereas when you select an event the entire condition+action block (+ eventually sub-events) should turn yellow.

  • I get a js bug 'cause you toggled off two for loop at start of frame (GameSheet event 2 and 3) but still refer to loopindex in the action.

    Just delete that part. Didn't test it but that might be the issue.

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann