smurfee's Recent Forum Activity

  • Thanks, I'm so blind I completely missed the 'toggle' action. This is exactly what I was looking for.

  • Hello all,

    Im trying to get my each around this event based programming and I can't seem to solve this problem of using the same keyboard button to toggle a state on or off.

    Attached is my implementation:

    http://dl.dropbox.com/u/5760424/lol.capx

    What it is suppose to do:

    When the black square moves (using the w,a,s,d keys) to a grey square and presses the space button (while facing the square) a message pops up and the black sprite is frozen until the interaction message is terminated with the space button again. However I am unable to terminate the interaction message with the space button and I am temporary using the control button to terminate the interaction message. This is because the space triggers both popup and termination of the message at the same time. This is where I need help. If you don't get what I mean please download the file from the dropbox link.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hey thanks! Didn't expect a reply so soon. Your way of doing it much better. But when I added continuous movement with 'key pressed down' the sprite was slightly out of alignment with the grid. This meant that the timer was set to 16 while the sprite is moving between two squares and when it stops moving it is slightly out of place.

    Any idea on how to set the timer so that the key held down does not reset the timer to while it is counting down?

    Edit: We'll I sort figured out the problem, I also had to add the condition that the Timer <= 0 together with the 'Key Down' and I noticed that you subtracted the timer by dt*60 instead of 1, I think this is to set the speed of the movement (please confirm because I am not too sure) but it is also causing the sprite to be out of alignment by a pixel or two.

  • Hi Im new to C2 and I found the example from this post interesting. But I was wondering how to implement the same grid-like movement but you can see the player move between each square rather than just teleport between each grid.

    Here are my thoughts:

    When a directional key is pressed: An instance variables on the player (object to be moved) to store the 'target' X,Y coordinates to the next grid and for every 'n' ticks increment (or decrement) the players current direction until the players 'current' X,Y is equal to the target X,Y.

    I think this might work but I was wondering if there was a more optimal way of implementing this tile movement. Also I want the camera to lock on to the player during this transition. Since I've only started using C2 I'm guessing that this is simply done in one of the attributes of the player, 'scrolling' is it?

    I want to implement my game so that the player sprite is shown moving between two adjacent tiles with a duration of 0.5 seconds.

    Thanks.

  • Hi Im new to C2 and I found your example very interesting. But I was wondering how to implement the same grid-like movement but you can see the player move between each square rather than teleport.

    I want to implement my game so that the player sprite is shown moving between two adjacent tiles with a duration of half a second.

    Thanks.

smurfee's avatar

smurfee

Member since 29 Oct, 2011

None one is following smurfee yet!

Trophy Case

  • 13-Year Club
  • Email Verified

Progress

14/44
How to earn trophies