Pixel-precise custom movement on a grid.

Get help using Construct 2

Post » Sun Aug 12, 2012 5:38 pm

I don't think it's a problem with the events. I have not been able to move into the walls.

What browser are you using to test?
It's flawless for me in Firefox 14.0.1 and Chrome 20.0.1132.47.
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Sun Aug 12, 2012 6:22 pm

@Greg @R0J0hound
I see, in some rare cases the algo skip the wall check.
It can happen only if Player.move reach 0 without going into negative values. And the lower the speed the more likely it can happen.
Greg, to correct the problem you just have to put in event 10:
[code]Player: move = 0
-> System: Set timer to max(0,timer-dt)
-> Player: Set checked to false <-- that[/code]
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Aug 16, 2012 10:45 am

Sorry I couldn't get back to you sooner about this, but it works flawlessly! Thank you so much!
B
9
Posts: 59
Reputation: 997

Post » Wed Jan 09, 2013 2:36 pm

[QUOTE=Yann] http://dl.dropbox.com/u/23551572/C2/gridMovement.capx[/QUOTE]

thanks for sharing Jann. it's a great example. very useful to me.
B
2
Posts: 2
Reputation: 354

Post » Wed Aug 27, 2014 1:39 pm

@Yann About the grid-movements, what If Player intended to change direction without moving? Thanks :D
B
25
S
6
G
4
Posts: 76
Reputation: 5,163

Post » Wed Aug 27, 2014 2:27 pm

@Jaydon > yeah? what about it?
B
60
S
22
G
14
Posts: 1,479
Reputation: 16,346

Post » Thu Aug 28, 2014 1:50 am

@Yann in your example capx, the player moves forward with any direction key is pressed. What if I intended to have the player change direction rather than moving forward. If the player faced the direction it is moving, it will then move forward on direction key pressed.


Key hold more than x ticks - moves forward
else - only change direction (no moving forward)

I've tried different approaches to this but I've sort of stuck. Do let me know if you need more explanation. You can take Pokemon grid movement as an example.
B
25
S
6
G
4
Posts: 76
Reputation: 5,163

Post » Fri Oct 31, 2014 10:02 pm

hello guys!!!

how i make the drag and drop keep the grid positions!!!

thanks !!!

AJ
B
4
Posts: 16
Reputation: 234

Previous

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 24 guests