larrynachos's Recent Forum Activity

  • I'm working on a zombie game that has zombies spawning off screen (all 4 directions). However, I can't figure out how to make them move onto the layout before they begin wandering/attacking the enemy.

    I found the if enemy is outside layout statement, but I don't know how to go about making the zombies move in the respective direction onto the layout. Pls Help!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • TileMap object has a number of expressions to convert tile coordinates to screen coordinates and vice-versa.

    PositionToTileX(x)

    PositionToTileY(y)

    SnapX(x)

    SnapY(y)

    TileToPositionX(x)

    TileToPositionY(y)

    Use TileAt(x,y) to get tile ID.

    As for your second question, it depends on your game. If this is just for storing customizable properties for individual tiles, I would probably use an array or dictionary. If you need to add animations, behaviors etc. to your tiles, you will need to replace them with sprites. (or put sprites on top of them)

    > I have an event set up so when I click the tilemap in an editor window (separate layer, paralax 0,0), but it selects tile id -1 instead of the tile I clicked on. I'm assuming it's not translating the mouse coordinates to the editor tilemap because of the parallax (the tilemap technically isn't moving)..

    >

    Not sure I understand.. You may need to add scrollx, scrolly to your mouse coordinates. And probably subtract WindowWidth/2, WindowHeight/2. It's hard to tell without seeing your capx.

    Sorry I'm late, it's been a long week. Anyhow, here is what I'm using to select tiles and place them.

    tile selector is the tileset the user clicks to choose which block they are placing down. world 1 is the tileset where the user draws the level. the tile selector is on layer 5, which has a parallax of 0,0 (so it remains on screen while the user scrolls around the layout).

  • Are you assigning any value to that instance variable after you spawn a new instance of the sprite?

    You need to specifically assign the proper value, unless you want it to be default. I'm guessing your default value is 'slime'.

    Same applies to the animation.

    I had it set as a number, 0 for slime, 1 for snail. The problem was that the newly spawned enemy wasn't setting it's variable to 1 and changing its skin. I ended up doing separate sprites. anyways. I reckon it'll be better in the long run.

  • Quick follow up, one of my events breaks when I leave the initial screen of the layout and move around the camera. I have an event set up so when I click the tilemap in an editor window (separate layer, paralax 0,0), but it selects tile id -1 instead of the tile I clicked on. I'm assuming it's not translating the mouse coordinates to the editor tilemap because of the parallax (the tilemap technically isn't moving). I think this because if I move my camera into the top left corner, I can click on the tiles and select them properly. Is there a way to fix this? mouse position and absolute position both result in the same thing.

  • I'm working on a level editor, and when placing enemies I have it set to spawn a sprite on the object in the editor menu, but here's the catch. I'm trying to get away with using just one sprite object, and using different animations to represent different objects/enemies. To identify which object is which, I assigned a variable with a number to correspond with each object preview animation. However, when I try to spawn the second kind of object (a snail enemy), it spawns the object, but with the first object animation (a slime enemy). In the debug, it shows that the newly spawned object (the one placeable in the editor) won't spawn with the proper variable (it's at 0 when I want it to spawn as 1, so it will switch to the second animation).

    Pls help

  • I'm building a level editor, and right now I'm trying to use tilemaps for both terrain tiles and objects (like boxes). I would like to check when the level is tested for box tiles anywhere in the level (by tile id), delete the tile, and replace it with a sprite object instead (so I could make it interactive). If it works properly, I could probably use that method for things like coins, collectibles, doors and stuff.

    Also, would it maybe be better to use sprites instead of tilemaps for objects? I just considered that maybe I could maybe assign customizable properties to things like enemies and boxes (properties like health or loot or timers, idk).

  • No rush, but any updates?

  • Instead, you should use Audio.PlaybackTime(Tag) for everything.

    Oh man, how did I never think of that?

    Fixed my capx to include that, but something's not registering with the event. If I do if Audio.PlaybackTime("blank") >= 6.62 (in debug, the time is rounded to 6.62), it'll stop on the first bar and not play any of the other ones.

    I set it to 6.6, which almost does the trick, but it's still iffy. Also, sometimes in the debug I'll pause it and the times for a few of the tracks aren't the same as the rest (off by like 0.01 or 0.02, but noticeable).

    Updated capx: https://www.mediafire.com/?qy02hu2y52x2b3n

  • I have no experience with timing of sounds so this is all a complete guesswork, but did you do the timing with the overlapping the pattern with your seekbar? I wouldn't do something what needs a exact timing with a collision or overlapping event.

    I would put the pattern in an array and use the array to play the sounds in the correct order.

    Okay, so the overlapping isn't the problem. I tried using a function that loops itself every 6.621 seconds (the EXACT timing of all of the loops), but there's still a timing issue. This is what the function looked like

    And since I'm getting desperate, here's the capx: https://www.mediafire.com/?nrdsqhvdd45b0mg Please don't use it for anything more than helping me :X

  • I have no experience with timing of sounds so this is all a complete guesswork, but did you do the timing with the overlapping the pattern with your seekbar? I wouldn't do something what needs a exact timing with a collision or overlapping event.

    I would put the pattern in an array and use the array to play the sounds in the correct order.

    Sorry for the late reply; this week's been nuts. I'll definitely try that! I'm not a big fan of arrays, but today's a good day to learn

  • Bump. Pls ;-;

  • Bump. Guyyyys, I'm really at a loss here.

larrynachos's avatar

larrynachos

Member since 6 Jan, 2013

Twitter
larrynachos has 1 followers

Connect with larrynachos

Trophy Case

  • 12-Year Club
  • Entrepreneur Sold something in the asset store
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

17/44
How to earn trophies