0 Favourites

How do I position tiles incrementally by 64 pixels

  • So I've been working on an infinite level generator, and it works like this:

    There are spawner objects all around the player. If they are active, they spawn the tiles as you run. They become active under 2 conditions

    Condition 1: If the spawner is not currently overlapping an existing tile

    Condition 2: If the player is running in the direction of the spawner. So the right spawners are only active when the player is moving right, bottom are only active when player is falling, etc.

    This leaves 1 big problem, the tiles look a little odd when they are placed like 4 pixels above the one next to it, or 25 pixels apart, making the player think they can squeeze between the gaps. It's on the Level 2 Sheet, events 16-43 in a group called NewGen

    Thanks!

  • Can you use the show grid option under view? This would be the easiest way with clicking snap to grid.

  • would that automatically only place them in 64x64 increments? I was looking for it before, but i can't find the option under view

  • would that automatically only place them in 64x64 increments? I was looking for it before, but i can't find the option under view

    If you set your grid at 64x64, click snap to grid, and if your images are 64x64, then they should snap to grid perfectly. And I'm looking at these very options under view (inside C2) while I type this.

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Ah, I was looking int the project properties, not the view. I set this on, but it doesnt work as the sprites arent placed in the editor, they are spawned as the player runs along. Each sprite tile can be anywhere from 64,64 to 320,320 (Multiples of 64). I have it set to move the top tile when they are overlapping eachother, but this still only works to an extent as it will leave little gaps between the tiles that are spawned.

    I edited the link to use the capx, I had the wrong link up before

  • Ah, I was looking int the project properties, not the view. I set this on, but it doesnt work as the sprites arent placed in the editor, they are spawned as the player runs along. Each sprite tile can be anywhere from 64,64 to 320,320 (Multiples of 64). I have it set to move the top tile when they are overlapping eachother, but this still only works to an extent as it will leave little gaps between the tiles that are spawned.

    I edited the link to use the capx, I had the wrong link up before

  • So here's a little more description as to what I'm trying to do. It's like snap to grid, but only in game. I'm trying to make the spawners stay attached to the player at a 64x64 basis like the spawner will only move at 64x64 pixel rate, and it will always stay within a range that is divisible by 64

  • I think I figured it out. I just move the spawning boxes when they are too close or too far away from the player, and move them by increments of 64

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)