heliogame's Forum Posts

  • 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).

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

  • Shooting left illustration

  • [quote:2gifubnp]You are genius, Sir! Solved!.

    heliogame Your welcome, there's a bug if we are shooting at the top limit angle.

    From all of this I think you will get the idea of how to apply it and fine tune those number to fit your game.

    But if you still need help just tag me.

    newlee, sorry to bother you again, I got 2 problems that i really cannot resolve.

    1. I cannot fix the bug when we are shooting to the right side of the player (a,d) at the top limit angle or at bottom limit angle. The gun cannot set at the real top limit or real bottom limit.

    2. Oh, I am stuck again with this shooting left , the bullet shoots always right. I know how deal with it when I know an actual angle of the gun, but this is not the case of the fixed angle.

    I attached the sample capx of my problem .

  • [quote:1vqcfjub] How would you solve the issue when you raise the arm (W) up to the limits and then when you move it down (S) , it is moving on the other side of the player?

    Yup, it happened because, the limit point are too much (more than 360 degrees)

    I fixed it by offset the limit point for both top and bottom, by plus 5px from the X origin point of the Dude.

    I have updated the so, check it out.

    You are genius, Sir! Solved!.

  • heliogame

    Dude, there it is.

    Enjoy !

    Thank youuuuuuuuuuuuuuu!!!!

    Almost done! How would you solve the issue when you raise the arm (W) up to the limits and then when you move it down (S) , it is moving on the other side of the player?

    But thanks again, c2 is not so easy as i thought.

  • It's all a guessing game from here, why don't you share the capx?

    Sure, here you go

    Ups.. I do not have enough rep to post urls here...

  • I am guessing that I should work more with events 30-32 to make it work.

  • [attachment=2:1g4tdgr3][/attachment:1g4tdgr3]

    Basically, you can change the variables to what you want, but essentially, I have 1 bullet and block

    the bullet has a variable i called color and stores a string. The block has a Boolean variable, but you could even use the solid behavior as the flag instead (is solid enabled).

    Basically, when a bullet hits a block we check to see if the block is the right color (on or off) to be changed by the bullet. If it needs changing we do so.

    I use animation frames on the block to what color it is. Since a boolean = 1 or 0 (true and false) when I set an animation frame to the boolean, I am setting it to either be 1 or 0. Just remember if you use frames in the animation, you need to make sure you have the animation speed set to 0;

    1) Is block a sprite? If so, I am facing a problem with using hundreds of sprites in one layout.

    2) It is not about just changing colors of one object, 2 bullets differ a little from each by texture(or shadows) , the same may go for boxes.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • When you say tile, are you referring to the tilemap? In which case you don't spawn it but rather set the tile at x,y to be what you want (0-n)

    also... you destroy the object before you have it spawn a new one. Is it still spawning the new one?

    Also, instead of destroying the object and creating a different one, you can simply change animations, and set a flag for whether it is yellow or white. If it just comes down to changing the color of the sprite (or tile in a tilemap) I wouldn't destroy and create objects.

    (be sure to use Ruskul if you respond or I won't see the post!)

    After your comment, I switched to tilemap ( before I used tile background as a tile ). In short, I want to shoot with a yellow bullet at the white unsolid box to make it yellow solid box. If I shoot with white bullet at this yellow solid box, it will turn out again an unsolid white box.

    So, I tried to set "set a position", but it seems that I badly understand its function. I thought that it should replace one object with another, but it did not work here.

  • This is what I got..