Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Window_Base < Window
- def initialize(x, y, width, height)
- super()
- @windowskin_name = $game_system.windowskin_name
- self.windowskin = RPG::Cache.windowskin(@windowskin_name)
- self.x = x
- self.y = y
- self.width = width
- self.height = height
- self.z = 100
- @dest_x = self.x
- @dest_y = self.x
- @move = false
- end
- def start(dest_x, dest_y, move)
- @dest_x = dest_x
- @dest_y = dest_y
- @move = move
- end
- def update
- super
- # Reset if windowskin was changed
- if $game_system.windowskin_name != @windowskin_name
- @windowskin_name = $game_system.windowskin_name
- self.windowskin = RPG::Cache.windowskin(@windowskin_name)
- end
- if @move == true || self.x < @dest_x
- self.x += 32
- end
- if @move == true || self.x > @dest_x
- self.x -= 32
- end
- if self.x == @dest_x
- @move = false
- end
- if @move == true || self.y < @dest_y
- self.y += 32
- end
- if @move = true || self.y > @dest_y
- self.y -= 32
- end
- if self.x == @dest_y
- @move = false
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement