Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

How do i make the player to not move?

Saar

Member

Im doing a parpall process event, which doing couple of mssgs...Anway while im doing this, the player can still move. How do im doing that the player cannot move?
 
You could also try this:
Code:
class Game_Character
  attr_accessor :disable_movement
  alias_method :seph_disablemovement_gmchr_init, :initialize
  def initialize
    @disable_movement = false
    seph_disablemovement_gmchr_init
  end
  for m in ['move_down', 'move_left', 'move_right', 'move_up']
    s  = "alias_method :seph_disablemovement_gmchr_#{m}, :#{m};"
    s += "def #{m}(turn_enabled = false);"
    s += "  return if @disable_movement;"
    s += "  seph_disablemovement_gmchr_#{m}(turn_enabled);"
    s += "end"
    eval s
  end
end

So to disable movement, just use:
Code:
$game_player.disable_movement = true

Use false instead of true to re-enable it.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top