How do I check for a tile in a tilemap: and check around it for other tiles?

0 favourites
  • 5 posts
From the Asset Store
Piano tiles
$9.99 USD
Template for a piano tiles game, fully documented in comments and video
  • ive tried so many things. i just want to check a tile map for a tile. then check how many are next to it.

    spawn a sprite on the tile. and expand its width to how many are next to it.

    i get close. but then the next stage throws me off.

    i need to check Y going down.

    aim: to make a sprite that covers all tiles that are connected. updating itself as new tiles are added.

    ive had a ton of help, and really refined what it is im trying to do. but at this point. if anyone can make it work. you are a hero

    heres my current attempt. ive removed arrays making it as simple as possible

    sprite is a button that sets the room type to 4 btw

    heres the layout

  • ok. so, i got it to check in a row. and create a sprite at the correct width.

    how do i destroy the other sprites?

    next gotta do y... but, that melts my brain

  • I'm not sure if I'm following correctly. Can you elaborate on what specifically you are trying to create?

    Also, for deleting the extra sprites you could go through all of them and see which ones is the biggest. Or by the order they were created. Or you delete the previous ones as you go before adding a larger one.

  • BaconSwagg what im creating is a building system like dungeon keeper. press tile to build a room. simples.

    but. i need to know how big a room is. like in dungeon keeper. if a training room is 3x3 it has a rotating spike thing. increasing room efficiency.

    same for hatchery. 3x3, it can spawn chickens.

    same for graveyard. 3x3 has a grave that can store dead bodies in.

    library bookshelf, increasing efficiency.

    i tried deleting sprites: on created, is overlapping sprite, choose instance of sprite where sprite width< sprite width : destroy sprite... does nothing...

    the aim is just to have 1 sprite covering over all the tiles (THAT ARE CONNECTED)

    and.. somehow performs this on another tile with same y and >X... as im ending the loop it wont get there.. setting the search to start from the click i guess.

    i also ideally want to use a tilemap, not a sprite, so i can tell exactly how many tiles are in the room. but, ill work on that later. with some words of wisdom from rojohound.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • slowly working on it.

    sorry its a complicated mess.. i dont get it.. numbs my brain.. hoping someone will see what my aim is

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