Zebbi's Forum Posts

  • Use a function (add a function object), set the triggering event to call the function "sfx" (you can name it what you wish) with whatever parameters you wish as an action. Also pass "sound file" (or some other kind of flag) as parameter 0. Once you get comfortable with using functions you can experiment with multiple parameters.

    On function call "sfx":

    Define/add a local variable for "sound file" under the function "sfx" called event.

    Set "sound file" to function.param(0) (this will retreive parameter 0)

    Next do subevents under the function called condition:

    on "sound file"=whatever

    play sound applicable to whatever

    Thanks, I forgot about functions! Need to learn a bit more about the parameters :/

  • I want to keep all of my sound events in a sound group, but I have a few conditions/events that are specific and I'd like to have a "play sound" event in my soundfx group happen when a condition outside of the group occurs. I tried using signals, but the only way it worked was by having "if true once" as a condition, and that wasn't useful since it only happened once. Can you trigger events in one event FROM another event?

  • Maybe your game loading time is not that long to show the bar. Keep working and try again later with more game content.

    It takes, like, 3 seconds to load on mobile and half a second on PC, that should be enough?

  • It doesn't usually show on a PC. Read the documentation. Try running it on your mobile device in a web browser, it will show up.

    I'll be using cocoon.io, will it show in that? If not, what other ways of showing a loader bar are there?

  • I have a player that's controlled y the computer using the Car behavior. The car can turn at different speeds depending on the type of corner it is on, therefore acting as if it's being operated by an analog gamepad rather than a digital keyboard (where the turn speed is fixed). Is there a way of measuring how fast the car is turning, ad be able to assign different "screech" soundfx? A slow, gentle turn has a miniscreech, a full push of the joystick give a huge screen, etc?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I tried this: https://www.scirra.com/tutorials/533/fo ... ing-screen

    And it doesn't update the bar width with anything, does this function still work in nw.js? Would it work in Cordova as well?

  • >

    > 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!!

  • 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!