Yann's Forum Posts

  • "be moved without direct input"... well... In mario you have to press a button (direct input) to make mario move...

    To make him stop: if he overlap the node and he is moving -> stop him

    Once you have something on c2 you can share the capx too. It would probably be easier to pinpoint your potential mistakes.

  • Activate grid snapping on C2

    On some points place a sprite you can name "node"

    create 4 boolean insance variable named 'E' 'S' 'W' 'N' (for East, South, West and North)

    For each node you have to manually set the following:

    if you can go right set E to true, else false

    if you can go down set S to true, else false

    if you can go left set W to true, else false

    if you can go up set N to true, else false

    Then each time your player character is on a node, and you push an arrow key, check if the node allows you to go that way, if yes, start moving the character and disable control until it reaches the next node.

    (setting things with the snap feature enabled help to have things properly aligned)

    Now for levels, you can add a second instance variable named 'level' which can old text. You set it for each node to nothing if shouldn't lead to a level, else you set it to the layout name holding your level.

    And then if the player character is on a node (not moving) and the player hit the "enter the level" control, AND node.level is not equal to nothing, then go to layout (by name) node.level

  • you can always do the following:

    Have the same name for the colliding animation (like "collide") for all your hazard objects and then just call this animation. You then don't need to know which is which.

    However, if you need to create some special effect depending on the family member you collide with, you can always do:

    Add an instance variable to the family called 'fx'

    Then for each of your family member you can set a number for this variable like 0 for no fx, 1 for stone debris, 2 for anything else

    And then

    +Player: collides with Hazzard
      -> Hazzard: set animation to "collide"
      + Hazzard.fx = 1
        -> hazzard: spawn stoneDebris
      + Hazzard.fx = 2
        -> do something else
  • Ashley

    If I were to create a level editor, I would probably put all the game object in a family "gameObjects" and I would appreciate to be able to browse an array of indexes and do something like

    Global cols = 10
    Global rows = 10
    Global cellSize = 32
    +System: for "" from 0 to cols*rows-1
      Local x = 0
      Local y = 0
      -> System: Set x to loopindex%cols
      -> System: Set y to floor(loopindex/cols)
      -> System: Create gameObjects[Array.At(x,y)] on Layer "Game" at (x*cellSize,y*cellSize)

    using in short family[id] to access a specific member of a family.

    It would then be also interesting to be able to sort the members or assign specific ID in a family to keep consistency if I were to add gameObject to my level editor.

    For now the only way to achieve the same result is to make an event per gameObject which is a bit ugly :D

  • Well if it's lower than 5 it's lower than 10 too.... so you have to add another condition

    DeltaTime < 10

    DeltaTime > 5

    • > add 4000
  • The "math" just converts a 0 to 360? range into a 0 to 7 range to select the corresponding animation.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Step to reproduce:

    • Create a Sprite
    • Load a texture (I tried with a 256x256)
    • Resize the texture via the resize button (I set it to 32x32)
    • Look a the collision polygon, still covering a 256x256 square.

    Seems weird since I thought collision polygon points were in Texture space. Anyway I had some weird random missing collision because of that.

  • Did that a while ago

    Panning.capx

    middle mouse click to pan

  • I wouldn't use a super big image for collision but build the collision out of a little resized square. This way you only load a little texture and you get a good level of customisation directly inside C2

  • I prefer using instance variable. It greatly helps with picking and is way more readable than simple array indexes. Also it's more in the logic of OOP.

    To keep these data through layouts, I would make the object global.

    To save/retrieve these data with webstorage or server database it could be interesting to have an action for serializing/unserializing these data into an XML or whatever string easily saveable.

    Ashley has some ideas maybe.

  • healthBar.capx

  • a bit simpler healthState.capx

  • Be carefull only the origin point snaps to the grid

    If the origin point of your sprite is in the middle it will snap by the middle

    I often put the origin point at top-left for snapping