heliogame's Recent Forum Activity

  • Hi Guys, I am trying to create a gun turret that shoots like that

    Gravity and Set angle behaviors do not help much in that case. What do you think?

  • nimos100,

    There is one problem with setting a new tile to a range of tiles around the hit. As long as it is always a square that fills the whole new area, it adds unnecessary tiles like I highlighted (crossed) in your picture.

    So, imagine that we hit at what an arrow points out

    How should we deal with changing tiles without adding unnecessary ones?

    I guess we should add some kind of loop that goes through all the tilemap making a check against a tile that is not empty and then changing only those tiles, but it seems wacky combining it with functions. Uhh..

  • > Thanks nimos100,

    > Is tile 12 a red one that replaces 9 tiles?

    >

    >

    Yes this example only use one tilemap.

    Without the Capx it im not 100% certain.

    But think the wait 3 seconds might be causing the problem as you destroy the bullet, but want to pass it to the function 3 seconds later, im not certain if that is working well or how it works, as i tend to avoid waits. But you have to remember that the rest of your program doesn't pause while this wait is going on. If i remember correct objects that are destroyed will be removed from the game at the next tick. Meaning that the bullet you are trying to pass to the function doesn't exist anymore when you actually need the tile position, and since you are waiting 3 seconds which is 180 ticks a lot of things can go on in the meantime. But anyway im not 100% certain, but regardless of that, i think such situations are best to be avoided because you lack overview of whats going on with waits in your programs.

    So i would use the bomb you create to spawn at the correct Tile (Where the bullet hit) and then add a timer behaviour to that and set it to 3 second, store the Tile position in the bomb or you can generate it later when the timer is up, then use the bomb tile position with the function. Meaning you pass the bomb coordinates to the function rather than the bullet. Think that will solve the problem.

    Otherwise try to add the capx.

    I passed the bomb coordinates to the function and it worked! Thank you.

  • Thanks nimos100,

    Is tile 12 a red one that replaces 9 tiles?

    Here is what i tried but it does not trigger the change

    here is how it looks as the base

    and this is what i want to achieve

  • nimos100

    I am wondering how do we erase/change a range of tiles on a collision with a bullet. For instance, a bullet hits a tile, and then it should trigger a change of 8 tiles around the one that was hit. Let's say we erase those 9 tiles of tilemap 1 and replace them with tiles of tilemap 2 (the red one).

    I only managed to erase and set a tile that was hit , but no luck with erasing and setting neighboring tiles.

    Haven't read all the replies. So this might not be what you mean, but how I understood the original question. But in that case you can just ignore it

    Here is a simple example of how to get the tile.

    (Be advise that the tilemap at row 0 for both X and Y is empty so its not an error that it seems like it should be tile 3,7, its just me that didn't put any tiles in that row, so the white area around the tiles are actually row 0)

    If you want the coordinate in X,Y you can just convert the TileX and TileY to that.

  • MultipleChoice, solved! Thank you!

  • I got 2 tilemaps. One is solid (tilemap), another one is unsolid (tilemap2).

    When a bullet is collided with a tilemap, I am trying to do the following

    1) The solid tile of tilemap which we hit is erased

    2) and is replaced with a tile of unsolid tilemap2 ( I used "set a tile" trick, not sure if it is right).

    It drives me mad for over two weeks. I cannot achieve any of these effects while a tilemap is being hit with a bullet.

  • Hello Guys, I am looking for a tutor and I am ready to pay at the similar rate I found on fiverr: 5$ per 20 minutes (which is paused though). I have some difficult questions that I cannot solve here on the forum. For instance, look at

    "How do I know which tile is being hit on collision" thread. Google it or use search box as I cannot post links here.

    P.s. I still do not have enough rep for pm or posting links on the forum, so pm me please or post on the thread, tagging me.

    For tutoring I prefer skype or e-mail, for payment - paypal. Thanks.

  • R0J0hound, I slowed the bullet down, but collision does not appear. No visual change.

    I also added an unsolid tilemap2 to the list.

    When a bullet is collided with a tilemap, we should see the following:

    1) The tile of tilemap is erased

    2) and is replaced with a tile of unsolid tilemap2 ( I used "set a tile" trick, not sure if it is right).

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • R0J0hound, I replaced the sprite 2, which overlaps a tile, with a bullet. While bullet is colliding with a tile, the effect of overlapping does not appear. What was wrong?

    Also, I am thinking about an interaction of 2 tilemaps on one layout. One tilemap is solid, the other one is unsolid. When I shoot at the tile of solid tilemap, this tile would be replaced with a tile of unsolid tilemap.

    When I shoot at the tile of unsolid tilemap, this tile would be replaced with a tile of solid tilemap.

    Is this interaction of 2 tilemaps possible in C2?

    Thanks

  • Ruskul, so, no chances to make the same thing with tiles? I am afraid my game will be too heavy... or limited. I want to spread those boxes everywhere.

  • Hi guys, thank you for your discussion, but it is just beyond my comprehension . I could only grab the whole section of the tilemap since my boxes are 50 X 50. So, I can not know where is my box is placed on the tilemap, since my box is the whole tilemap now.

    I attached here capx with 2 sprites and 2 tilemaps. 2 sprites demonstrates what I want to do. A -shoots and make the grey box the yellow solid one, D shoots and the yellow box becomes the grey unsolid one.

    I am wondering maybe I would stick to sprites as my boxes? I want to use boxes only ( no slopes or other shapes). If I use say 100 of them per one layout, will my game be lagging? Thanks.

heliogame's avatar

heliogame

Member since 14 Jan, 2015

None one is following heliogame yet!

Trophy Case

  • 9-Year Club
  • Email Verified

Progress

10/44
How to earn trophies