Zebbi's Recent Forum Activity

  • >

    > Okay, so I need to run a loop to create an animated sprite for each of the tiles of a specific ID? I'm not really sure how to go about doing this.

    >

    So, do you like that x&y loop in that capx ?

    yes

    Perfect, thankyou! Especially like the trick to only work on tiles in the viewport to save on resources, brilliant example!!

  • When you have your menu selection variables (if menu = 3 > highlight item3, if menu = 7 > highlight item) just have it so, if item4 is locked AND menu = 4 > set menu to 5)

  • You can actually animate tiles themselves, but you need to get creative. Basically, you should ensure that all animated tile sprites are consecutive in the spritesheet, and then, using a for loop, you iterate through all visible tiles and normalize tile IDs that refer to animated tile to the tile ID they should actually show.

    Here's a small example.

    https://dl.dropboxusercontent.com/u/700 ... lemap.capx

    Perfect, thankyou! Especially like the trick to only work on tiles in the viewport to save on resources, brilliant example!!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If you know the tile, you know its X and Y coordinates.

    You can convert between tile positions (px,py) and layout co-ordinates (x,y) using the PositionToTileX/Y and TileToPositionX/Y expressions.

    There must be something that is specific for that tile. You have 'painted' it on the map.

    On the moment that you are 'painting' tiles, you see numbers in the tilemap bar. That is the ID of that tile (zero based). Once you painted a "square" on the map. I gets a position, in the form of numberd positions. (forgot if its zero based, i suppose so) Positions are like 4th sprite from the left, 2nd kolom. Or px=4, py = 2.

    The condition > Tilemap > Compare tile at px=4 py=2 will give you the ID of that tile. The ID refers to wich square you painted in there.

    If the ID matches the square that you want to pick. Translate its px,py to real layout x,y coordinates.

    You can ofcours loop true the tilemap with a px and py loop and compare them one by one.

    So far for the system you asked to explain. But in the end you dont seem to care that much.

    Your tile is at px=2, py=1.

    So if you place on object on the x,y of that tile you set position of that object to

    (for x) Tilemap.TileToPositionX(2)

    (for y) Tilemap.TileToPositionY(1)

    But, i told you that allready.

    Okay, so I need to run a loop to create an animated sprite for each of the tiles of a specific ID? I'm not really sure how to go about doing this.

  • If you know the tile, you know its X and Y coordinates.

    But in the end you dont seem to care that much.

    But, i told you that allready.

    ???????

  • The Tilemap object.

    You have all those conditions/actions/expressions to adress and manipulate a certain tile.

    https://www.scirra.com/manual/172/tilemap

    So, adressing the tile should be easy, its has x/y coordinates.

    Also the source squares in the tilemap are numberd. Setting one as a tile should be easy. The numbers you find in de Tilemap editor.

    So far i understand the question. I dont understand the reference to 'sprites' in the question.

    Either you use sprites on a grid. Those sprites you can give frames, and those frames can loop automaticaly, creating an animation.

    Or you use the Tilemap. Now, i have not seen someone yet making animations into a Tilemap by swapping squares.

    Its is possible for sure. Its an idea that i will try, never thaught of it before. You just use 'set tile'. All frames have to be in the Tilemap.

    Third option. Interpreting the question a bit differend. You want to place a animated sprite above a certain tile in the tilemap. For that you have the Tilemap expressions:

    TileToPositionX(x)

    TileToPositionY(y)

    Convert a tile position to layout co-ordinates. For example, this can be used to position a Sprite object on top of a given tile.

    Hope i did't guess to much.

    Forget the "destroy" part, I really just need to create an animated sprite over each placement of a particular tile. This post: how-do-i-create-animated-tileset-tilemap_p756298?#p756298 mentions the how:

    Technically you can't, as a tile is an inanimate sprite. If you wanted to do so, you would need to spawn a sprite on each specific tilemap tile.

    For example,

    if tilemap tile = 0, spawn sprite1

    if tilemap tile = 1, spawn sprite2

    etc

    and each sprite would be what is animated.

    I just can't figure out the way of expressing how to create the objects over the tiles.

    For reference, the tile I need to "animate" is two tiles right one tile down.

  • I'd like to do a simple animated tile by creating a sprite at every placement of a particular tile across the tilemap, and destroying/hiding it to give the illusion of a simple animation, but the actual expression is a bit tricky for me, am I supposed to create the sprite (which contains the second frame) at the tiles coordinate? How can I let C2 figure out where each tile of a specific number is on the map?

  • Are we anywhere near cocoon.io framerates yet?

  • Pinning another instances using family: pin_to_pin.capx

    Thanks, I'll take a look!

  • Zebbi - Did you answer your question about instance based update vs object based update? If I'm understanding you correctly, then I use it to control each instance as I see fit. You can update all of the objects or you can use the conditions to narrow down which ones are affected.

    You need to make sure all get updated though and that none get updated more than once... unless you are simulating high speed and need more checks per tick for whatever reason.

    -Honestly though, at the end of the day, I have yet to be able to put the platformer behavior to a good use baring simple use case scenarios. I usually end up making my own, that way it is something new, unique, and mine. Its hard but then you can do anything and not worry about side effects of using the behavior.

    Addressing this would be great (collision filtering solids)... though I believe the most useful thing that Ashley could provide is more tools for lower level designs (access to the built in collision detection for example). Custom movement is an idea in the right direction but really lacks the tools needed to work with ideas similar to what Zebbi noted. Not being able to access collision information, I had to basically make my own collision detection, filtering, and then built a custom platformer behavior over that. At this point I still tell people c2 is great for speed and prototyping, but once you get down to "making the game" you have to script- even in c2 - if you want something original, that is, from a mechanical perspective.

    I see what you mean, I'm still in the middle of switching to using this method fulltime since I'm not sure if it will work in the way I need, here is the example I built for Ashley to look at: https://www.dropbox.com/s/3ezha00yp7da5 ... tairs.capx as you can see, that just uses the stock c2 event, but you can understand with that how it SHOULD work, and how it's not possible to work currently due to the collision restrictions. Can I use the Ruskul mod to get this to work in the way I've exemplified?

    Of course, we might be closer if Ashley goes ahead with adding the simplest little event to disable collisions per instance: viewtopic.php?f=151&t=170337

  • I just wish it wouldn't lose my place when I clear the search.

  • Topic starter: Last online: 11 months ago

    ^^

    An awesome list nonetheless.

Zebbi's avatar

Zebbi

Member since 20 Jan, 2014

None one is following Zebbi yet!

Connect with Zebbi

Trophy Case

  • 10-Year Club
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

12/44
How to earn trophies