Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Game_System
- attr_accessor :achievements
- alias :um_initialize :initialize unless $@
- def initialize()
- um_initialize()
- @achievements = []
- end
- def achieved?( id )
- return @achievements.include?( id )
- end
- def add_achievement( id )
- @achievements << id
- @achievements.uniq!()
- end
- end
- $game_system.add_achievement( 1 )
- $game_system.achieved?( 1 ) # => true
Advertisement
Add Comment
Please, Sign In to add comment