Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Use a comment with <collide: a b>
- # to specify an event that takes up a tiles horizontally and b tiles vertically,
- # going to the right and up from the event location
- #
- # <collide: 2 3>
- # represents an event that takes up its own tile and the one to the right, as well
- # as the two tiles above each of those
- class Game_Event < Game_Character
- alias shaz_large_event_collision_clear_page_settings clear_page_settings
- alias shaz_large_event_collision_setup_page_settings setup_page_settings
- def clear_page_settings
- shaz_large_event_collision_clear_page_settings
- @collide_width = 0
- @collide_height = 0
- end
- def setup_page_settings
- shaz_large_event_collision_setup_page_settings
- @collide_width = 0
- @collide_height = 0
- return if empty?
- @list.select{|cmd|
- [108,408].include?(cmd.code) &&
- cmd.parameters[0].to_s =~ /<collide: (\d+)\s*(\d+)>/}.each {|cmd|
- @collide_width = $1.nil? ? 0 : ($1.to_i)
- @collide_height = $2.nil? ? 0 : ($2.to_i)
- }
- end
- def pos?(x,y)
- x.between?(@x, @x + @collide_width) && y.between?(@y - @collide_height, @y)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment