Turn without moving.
#1
So I made the following modification to Game_Player to allow turning when a key is tapped, as opposed to just move right off the bat. Problem is, is that there's a too-long-a-pause from turn to continue moving. Is there perhaps a better way to go about this?

PHP Code:
<?php 
#--------------------------------------------------------------------------
# ● Frame Update : Player Movement
#--------------------------------------------------------------------------
def update_player_movement
# Move player in the direction the directional button is being pressed
if Input.trigger?(Input::DOWN) || Input.trigger?(Input::LEFT) ||
Input.trigger?(Input::RIGHT) || Input.trigger?(Input::UP)
case
Input.dir4
when 2
@direction = 2
when 4
@direction = 4
when 6
@direction = 6
when 8
@direction = 8
end
elsif Input
.repeat?(Input::DOWN) || Input.repeat?(Input::LEFT) ||
Input.repeat?(Input::RIGHT) || Input.repeat?(Input::UP)
case
Input.dir8
when 1
move_left
; move_down
when 2
move_down
when 3
move_right
; move_down
when 4
move_left
when 6
move_right
when 7
move_left
; move_up
when 8
move_up
when 9
move_right
; move_up
end
end
end
Reply }


Messages In This Thread
Turn without moving. - by Taylor - 05-29-2012, 11:12 AM
RE: Turn without moving. - by PK8 - 05-29-2012, 11:55 AM
RE: Turn without moving. - by Taylor - 05-30-2012, 01:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
   A way to get players to stop moving PK8 0 3,762 08-04-2011, 01:17 PM
Last Post: PK8



Users browsing this thread: 1 Guest(s)