Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #==============================================================================
- # ** Main
- #------------------------------------------------------------------------------
- # This processing is executed after module and class definition is finished.
- #==============================================================================
- #rgss_main { SceneManager.run }
- DataManager.init
- def start
- bitmap = Cache.battler("bat",0)
- $sprite.bitmap = bitmap
- puts "start"
- end
- def post_start
- $sprite.x = Graphics.width - $sprite.width
- $sprite.y = Graphics.height - $sprite.height
- puts "post start"
- end
- def updates
- Graphics.update
- Input.update
- $sprite.update
- update_movement
- update_flash
- update_jump
- end
- def update_movement
- case Input.dir8
- when 1
- $sprite.x -= 3
- $sprite.y += 3
- when 2
- $sprite.y += 3
- when 3
- $sprite.x += 3
- $sprite.y += 3
- when 4
- $sprite.x -= 3
- when 6
- $sprite.x += 3
- when 7
- $sprite.x -= 3
- $sprite.y -= 3
- when 8
- $sprite.y -= 3
- when 9
- $sprite.x += 3
- $sprite.y -= 3
- end
- end
- def update_flash
- if Input.trigger?(:CTRL)
- color = Color.new(255,255,255)
- $sprite.flash(color,60)
- end
- end
- def update_jump
- if Input.trigger?(:ALT)
- jump_height = 20
- $sprite.y -= jump_height
- while $sprite.y < Graphics.height
- Graphics.update
- jump_height -= 1
- puts jump_height
- $sprite.y -= jump_height
- end
- end
- end
- view = Viewport.new
- $sprite = Sprite.new(view)
- start
- post_start
- updates while true
Advertisement
Add Comment
Please, Sign In to add comment