Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # GAME LU GA BOLEH NEP!
- # =============================================================================
- class TitleCommandset
- alias new_update_index update_index
- def update_index
- new_update_index
- mx, my = *Mouse.position
- for i in 0...@commands.size
- px = @commands[i].pos_x; py = @commands[i].pos_y
- if mx.between?(px, px + @commands[i].lebar) &&
- my.between?(py, py + @commands[i].tinggi)
- Sound.play_cursor if @index != i
- @index = i
- @commands.each {|cmd| cmd.unselect}
- @commands[i].select
- break
- end
- end
- end
- end
- class TitleCommand < Sprite
- def pos_x; return self.x; end
- def pos_y; return self.y; end
- def lebar; return self.width; end
- def tinggi; return self.height; end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement