class Scene_OF ARROW_SIZE = 32 ARROW_SCALE = 2 ARROWS_PADDING = 12 ARROWS_TOP_MARGIN = 32 ARROWS_SIDES_MARGIN = 48 SPRITES = { :cat_base_arrow_left => Rect.new(0, 0, 32, 32), :cat_base_arrow_down => Rect.new(32, 0, 32, 32), :cat_base_arrow_up => Rect.new(64, 0, 32, 32), :cat_base_arrow_right => Rect.new(96, 0, 32, 32), :cat_pressed_arrow_left => Rect.new(0, 32, 32, 32), :cat_pressed_arrow_down => Rect.new(32, 32, 32, 32), :cat_pressed_arrow_up => Rect.new(64, 32, 32, 32), :cat_pressed_arrow_right => Rect.new(96, 32, 32, 32), :cat_target_arrow_left => Rect.new(0, 64, 32, 32), :cat_target_arrow_down => Rect.new(32, 64, 32, 32), :cat_target_arrow_up => Rect.new(64, 64, 32, 32), :cat_target_arrow_right => Rect.new(96, 64, 32, 32), :cat_best_arrow_left => Rect.new(0, 96, 32, 32), :cat_best_arrow_down => Rect.new(32, 96, 32, 32), :cat_best_arrow_up => Rect.new(64, 96, 32, 32), :cat_best_arrow_right => Rect.new(96, 96, 32, 32), :cat_tail_left => Rect.new(0, 128, 32, 16), :cat_tail_down => Rect.new(32, 128, 32, 16), :cat_tail_up => Rect.new(64, 128, 32, 16), :cat_tail_right => Rect.new(96, 128, 32, 16), :cat_tail_end_left => Rect.new(0, 144, 32, 16), :cat_tail_end_down => Rect.new(32, 144, 32, 16), :cat_tail_end_up => Rect.new(64, 144, 32, 16), :cat_tail_end_right => Rect.new(96, 144, 32, 16), :player_base_arrow_left => Rect.new(128, 0, 32, 32), :player_base_arrow_down => Rect.new(160, 0, 32, 32), :player_base_arrow_up => Rect.new(192, 0, 32, 32), :player_base_arrow_right => Rect.new(224, 0, 32, 32), :player_pressed_arrow_left => Rect.new(128, 32, 32, 32), :player_pressed_arrow_down => Rect.new(160, 32, 32, 32), :player_pressed_arrow_up => Rect.new(192, 32, 32, 32), :player_pressed_arrow_right => Rect.new(224, 32, 32, 32), :player_target_arrow_left => Rect.new(128, 64, 32, 32), :player_target_arrow_down => Rect.new(160, 64, 32, 32), :player_target_arrow_up => Rect.new(192, 64, 32, 32), :player_target_arrow_right => Rect.new(224, 64, 32, 32), :player_best_arrow_left => Rect.new(128, 96, 32, 32), :player_best_arrow_down => Rect.new(160, 96, 32, 32), :player_best_arrow_up => Rect.new(192, 96, 32, 32), :player_best_arrow_right => Rect.new(224, 96, 32, 32), :player_tail_left => Rect.new(128, 128, 32, 16), :player_tail_down => Rect.new(160, 128, 32, 16), :player_tail_up => Rect.new(192, 128, 32, 16), :player_tail_right => Rect.new(224, 128, 32, 16), :player_tail_end_left => Rect.new(128, 144, 32, 16), :player_tail_end_down => Rect.new(160, 144, 32, 16), :player_tail_end_up => Rect.new(192, 144, 32, 16), :player_tail_end_right => Rect.new(224, 144, 32, 16), :player_idle1 => Rect.new(0, 160, 128, 128), :player_idle2 => Rect.new(128, 160, 128, 128), :player_idle3 => Rect.new(256, 160, 128, 128), :player_idle4 => Rect.new(384, 160, 128, 128), :player_sign_left1 => Rect.new(0, 288, 128, 128), :player_sign_left2 => Rect.new(128, 288, 128, 128), :player_sign_left3 => Rect.new(256, 288, 128, 128), :player_miss_left => Rect.new(384, 288, 128, 128), :player_sign_down1 => Rect.new(0, 416, 128, 128), :player_sign_down2 => Rect.new(128, 416, 128, 128), :player_sign_down3 => Rect.new(256, 416, 128, 128), :player_miss_down => Rect.new(384, 416, 128, 128), :player_sign_up1 => Rect.new(0, 554, 128, 128), :player_sign_up2 => Rect.new(128, 554, 128, 128), :player_sign_up3 => Rect.new(256, 554, 128, 128), :player_miss_up => Rect.new(384, 554, 128, 128), :player_sign_right1 => Rect.new(0, 682, 128, 128), :player_sign_right2 => Rect.new(128, 682, 128, 128), :player_sign_right3 => Rect.new(256, 682, 128, 128), :player_miss_right => Rect.new(384, 682, 128, 128), :cat_idle1 => Rect.new(0, 800, 128, 128), :cat_idle2 => Rect.new(128, 800, 128, 128), :cat_idle3 => Rect.new(256, 800, 128, 128), :cat_idle4 => Rect.new(384, 800, 128, 128), :cat_sign_left1 => Rect.new(0, 928, 128, 128), :cat_sign_left2 => Rect.new(128, 928, 128, 128), :cat_sign_left3 => Rect.new(256, 928, 128, 128), :cat_miss_left => Rect.new(384, 928, 128, 128), :cat_sign_down1 => Rect.new(0, 1056, 128, 128), :cat_sign_down2 => Rect.new(128, 1056, 128, 128), :cat_sign_down3 => Rect.new(256, 1056, 128, 128), :cat_miss_down => Rect.new(384, 1056, 128, 128), :cat_sign_up1 => Rect.new(0, 1194, 128, 128), :cat_sign_up2 => Rect.new(128, 1194, 128, 128), :cat_sign_up3 => Rect.new(256, 1194, 128, 128), :cat_miss_up => Rect.new(384, 1194, 128, 128), :cat_sign_right1 => Rect.new(0, 1322, 128, 128), :cat_sign_right2 => Rect.new(128, 1322, 128, 128), :cat_sign_right3 => Rect.new(256, 1322, 128, 128), :cat_miss_right => Rect.new(384, 1322, 128, 128), } PLAYER_ARROWS_SPRITES = { :base => [:player_base_arrow_left, :player_base_arrow_down, :player_base_arrow_up, :player_base_arrow_right ], :pressed => [:player_pressed_arrow_left, :player_pressed_arrow_down, :player_pressed_arrow_up, :player_pressed_arrow_right ], :target => [:player_target_arrow_left, :player_target_arrow_down, :player_target_arrow_up, :player_target_arrow_right ], :best => [:player_best_arrow_left, :player_best_arrow_down, :player_best_arrow_up, :player_best_arrow_right ], :tail => [:player_tail_left, :player_tail_down, :player_tail_up, :player_tail_right ], :tail_end => [:player_tail_end_left, :player_tail_end_down, :player_tail_end_up, :player_tail_end_right ], } CAT_ARROWS_SPRITES = { :base => [:cat_base_arrow_left, :cat_base_arrow_down, :cat_base_arrow_up, :cat_base_arrow_right ], :pressed => [:cat_pressed_arrow_left, :cat_pressed_arrow_down, :cat_pressed_arrow_up, :cat_pressed_arrow_right ], :target => [:cat_target_arrow_left, :cat_target_arrow_down, :cat_target_arrow_up, :cat_target_arrow_right ], :best => [:cat_best_arrow_left, :cat_best_arrow_down, :cat_best_arrow_up, :cat_best_arrow_right ], :tail => [:cat_tail_left, :cat_tail_down, :cat_tail_up, :cat_tail_right ], :tail_end => [:cat_tail_end_left, :cat_tail_end_down, :cat_tail_end_up, :cat_tail_end_right ], } def main Audio.bgm_stop @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @spritesheet = RPG::Cache.misc(".cats") @player_arrows = [] @cat_arrows = [] for i in 0..3 player_arrow = Sprite.new(@viewport) player_arrow.bitmap = Bitmap.new(ARROW_SIZE, ARROW_SIZE) player_arrow.bitmap.stretch_blt(Rect.new(0, 0, ARROW_SIZE, ARROW_SIZE), @spritesheet, SPRITES[PLAYER_ARROWS_SPRITES[:base][i]]) player_arrow.zoom_x = player_arrow.zoom_y = ARROW_SCALE player_arrow.x = Graphics.width - ARROWS_SIDES_MARGIN + (ARROW_SIZE * ARROW_SCALE + ARROWS_PADDING) * i - (ARROW_SIZE * ARROW_SCALE * 4 + ARROWS_PADDING * 3) player_arrow.y = ARROWS_TOP_MARGIN @player_arrows << player_arrow cat_arrow = Sprite.new(@viewport) cat_arrow.bitmap = Bitmap.new(ARROW_SIZE, ARROW_SIZE) cat_arrow.bitmap.stretch_blt(Rect.new(0, 0, ARROW_SIZE, ARROW_SIZE), @spritesheet, SPRITES[CAT_ARROWS_SPRITES[:base][i]]) cat_arrow.zoom_x = cat_arrow.zoom_y = ARROW_SCALE cat_arrow.x = ARROWS_SIDES_MARGIN + (ARROW_SIZE * ARROW_SCALE + ARROWS_PADDING) * i cat_arrow.y = ARROWS_TOP_MARGIN @cat_arrows << cat_arrow end # Execute transition Graphics.transition(40) # Main loop while true # Update game screen Graphics.update # Update input information Input.update # only for legacy funcs Audio.update # Frame update update # Abort loop if screen is changed if $scene != self break end end Graphics.freeze end def update end def map_input(input) case input when 2 1 when 4 0 when 6 3 when 8 2 end end end # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ # ████████████ ██████████████████████████████████ ██████████████████████████████████████████████████████████ ████████ ██████ # ██████████ ████████ ████████████ ████████████████ ██ ████████████████████████████████████████████████████████ ████ ██████ # ████████ ████████████████ ██████ ██████████ ██████ ██████████████████████████████████████████████████████████ ████████ # ████████ ██████████████ ██ ██ ████████ ████ ██████████████████████████████████████████████████████████████ ██████████ # ████████ ██████████████ ██ ████ ████████████████████ ████████████████████████████████████████████████████████████ ██████████ # ████████ ██████████████ ██ ████ ████████████████████ ██████████████████████████████████████████████████████████ ████████ # ██████████ ████████ ██ ██ ████ ██ ████████ ██ ██ ████████████████████████████████████████████████████████ ████ ██████ # ████████████ ██████ ██ ████ ██████████ ████ ██████████████████████████████████████████████████████████ ████████ ██████ # ██████████████████████████████████████████████ ████████████████████████████████████████████████████████████████████████████████████████ # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ # ████ ████ # ████ ██████ ████ # ████ ████████ ████ # ████ ████████ ████ # ████ ██████████ ████ # ████ ██████████ ████ # ████ ████████████ ████ # ████ ██████████████ ████ # ████ ██████████████ ████ # ████ ████████████████ ████ # ████ ████████████████ ██████ ████ # ████ ██████████████████ ████████ ████ # ████ ██████████████████ ████████████ ████ # ████ ████████████████████ ████████████████ ████ # ████ ██████████████████████ ████████████████████ ████ # ████ ██████████████████████ ██████████████████████ ████ # ████ ████████████████████████ ██████████████████████████ ████ # ████ ████████████████████████ ████████████████████████████ ████ # ████ ██████████████████████████ ████████████████████████████████ ████ # ████ ████████████████████████ ████████████████████████████████ ████ # ████ ██████████████████████████ ████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████ ██████ ████████████████████████████████████████████ ████ # ████ ████████████████ ████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████ ██████ ██████ ████ # ████ ██████████████████████████████████████████████ ████████ ████████ ████ # ████ ██████████████████████████████████████████████ ████████ ████████ ████ # ████ ██████████████████████████████████████████████ ████████ ████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████ ██████ ██████████ ████ # ████ ████████████████████████████████████████████████ ████ ██ ████████ ████ # ████ ████████████████████████████████████████████████ ████████ ████ # ████ ██████████████████████████████████████████████████ ████ ██████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ██████████████████████████████████████████████████████████████████████████ ████ # ████ ████ ██████████████████████████████████████████████████████████████████ ████ # ████ ██████████ ████ # ████ ██████████████ ████ # ████ ██████████████ ████████████████████████████ ████ # ████ ██████████████████ ████████████████████████████████████████████████████ ████ # ████ ████████████████████ ████████████████████████████████████████████████████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████ ██ ████ # ████ ██████████████████████ ████████████████████████████████████████████████████████ ████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████ ██████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████████████████ ██████ ████ # ████ ████████████████████ ████████████████████████████████████████████████████████████████████ ████████ ████ # ████ ████████████████████ ████████████████████████████████████████████████████████████████████ ██████ ████ # ████ ████████████████████ ████████████████████████████████████████████████████████████████████████ ████████ ████ # ████ ████████████████████ ████████████████████████████████████████████████████████████████████████ ██████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████████████████████████ ██████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████████████████████████ ██████ ████ # ████ ██████████████████ ████████████████████████████████████████████████████████████████████████████ ██████ ████ # ████ ██████████████████ ██████████████████████████████████████████████████████████████████████████ ████████ ████ # ████ ████████████████████ ████████████████████████████████████████████████████████████████████████ ██████████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████████████████████ ████████████ ████ # ████ ████████████████████ ██████████████████████████████████████████████████████████████████████ ████████████████ ████ # ████ ██████████████████ ██████████████████████████████████████████████████████████████████ ████████████████ ████ # ████ ██████████████████ ████████████████████████████████████████████████████████████████ ████████████████████ ████ # ████ ██████████████████ ██████████████████████████████████████████████████████████████ ████████████████████████ ████ # ████ ██████████████████ ████████████████████████████████████████████████████████████ ██████████████████████████ ████ # ████ ████████████████ ████████████████████████████ ██████████████████████████████ ████████████████████████████ ████ # ████ ██████████████████ ████████████████████████████ ██████████████████████████████ ██████████████████ ██████ ████ # ████ ██████████████████ ██████████████████████████ ████████████████████████████████ ████████████ ██████ ████ # ████ ██████████████████ ██████████████████████████ ██████████████████████████████ ██ ████████ ████ # ████ ████████████████ ██████████████████████████ ██████████████████████████████ ████████████████████ ████ # ████ ████████████████ ████████████████████████ ██████████████████████████████ ████████████████████████ ████ # ████ ████████████████ ████████████████████████ ██████████████████████████████ ████████████████████████ ████ # ████ ████████████████ ████████████████████████ ██████████████████████████████ ████████████████████████ ████ # ████ ████████████████ ██████████████████████ ██████████████████████████████ ████████████████████████ ████ # ████ ████████████████ ██████████████████████ ████████████████████████████████ ██████████████████████ ████ # ████ ████████████████ ██████████████████████ ████████████████████████████████ ██████████████████████ ████ # ████ ██████████████████ ██████████████████████ ████████████████████████████████ ██████████████████████ ████ # ████ ████████████████████ ██████████████████████ ██████████████████████████████ ██████████████████████ ████ # ████ ██████████████████ ██████████████████████ ████████████████████████████████ ██████████████████ ████ # ████ ██████████████████ ██████████████████████ ████████████████████████████████ ████████████████ ████ # ████ ████████████████ ██████████████████████ ██████████████████████████████████ ████████ ████ # ████ ████████████████ ████████████████████████ ████████████████████████████████████ ██ ████ # ████ ██████████████ ████████████████████████ ██████████████████████████████████ ██████ ████ # ████ ████████████ ████████████████████████ ██████████████████████████████████████ ████ ████ # ████ ██████████ ████████████████████████ ████████████████████████████████████████ ██ ████ # ████ ████████ ██████████████████████ ████████████████████████████████████████ ██ ████ # ████ ████████ ████████████████████ ██████████████████████████████████████████ ██████ ████ # ████ ██████ ████████████████████ ██████████████████████████████████████████ ██████ ████ # ████ ████ ████████████████████ ████████████████████████████████████████ ████████ ████ # ████ ██ ████████████████████ ████████████████████████████████████████ ████████ ████ # ████ ████████████████████ ████████████████████████████████████████ ██████████ ████ # ████ ████████████████████ ██████████████████████████████████████████ ██████████ ████ # ████ ████████████████████ ██████████████████████████████████████████ ██████████ ████ # ████ ████████████████████ ██████████████████████████████████████████ ██████████ ████ # ████ ████████████████████ ████████████████████████████ ██████████████ ██████ ████ # ████ ██████████████████ ████████████████████████████ ██████████████ ██████ ████ # ████ ██████████████████ ████████████████████████████ ██████████████ ████ ████ # ████ ██████████████████ ████████████████████████████ ████████████████ ████ # ████ ████████████████ ██████████████████████████████ ██████████████████ ████ # ████ ████████████████ ██████████████████████████████ ██████████████████ ████ # ████ ████████████████ ██████████████████████████████ ████████████████ ████ # ████ ████████████████ ██████████████████████████████ ████████████████ ████ # ████ ████████████████ ██████████████████████████████ ████████████████ ████ # ████ ████████████████ ██████████████████████████████ ████████████████ ████ # ████ ██████████████ ██████████████████████████████ ████████████████ ████ # ████ ██████████████ ████████████████████████████ ████████████████ ████ # ████ ████████████████ ████████ ████████ ██████████████ ████ # ████ ████████████████████ ████ ████ ████ ████ ██████████████ ████ # ████ ██████████████████████ ██ ████ ████ ██ ██ ██████████████ ████ # ████ ████████████████████████ ██ ██ ██ ██████████████ ████ # ████ ██████████████████ ██ ██ ████ ██ ██ ██████████████ ████ # ████ ████████████████ ██████ ████ ████ ████ ██████████████ ████ # ████ ████████████████ ██████ ██ ██ ████████████ ████ # ████ ████████████████ ██████ ████ ████ ████ ██████████ ████ # ████ ████████████████ ██████ ██ ██ ████ ██ ██ ██████████ ████ # ████ ██████████████████ ██ ████ ██ ██████████ ████ # ████ ████████████████████████ ████ ████ ██ ██ ██████████ ████ # ████ ██████████████████ ████ ████ ████ ████ ██████████ ████ # ████ ██████████ ████████ ██████████ ████ # ████ ████████████████████████████████████ ████████ ████ # ████ ████████████████████████████████████ ████████ ████ # ████ ████████████████████████████████████ ████████ ████ # ████ ████████████████████████████████████ ████████ ████ # ████ ██████████████████████████████████ ████████ ████ # ████ ██████████████████████████████████ ████████ ████ # ████ ████████████████████████████████ ████ ████ # ████ ████████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ██████ ████ # ████ ████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ████ ████ # ████ ██████████████████████████████ ████ ████ # ████ ████████████████████████████████ ██████ ████ # ████ ████████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ██████ ████ # ████ ██████████████████████████████ ██████ ████ # ████ ████████████████████████████ ██████ ████ # ████ ████████████████████████████ ████████ ████ # ████ ██████████████████████████ ████████ ████ # ████ ████████████████████████ ██████████ ████ # ████ ████████████████████████ ████████ ████ # ████ ██████████████████████ ██████████ ████ # ████ ██████████████████████ ██████████ ████ # ████ ████████████████████ ████████████ ████ # ████ ████████████████████ ████████████ ████ # ████ ██████████████████ ████████████ ████ # ████ ████████████████████ ██████████████ ████ # ████ ██████████████████ ██████████████ ████ # ████ ██████████████████ ████████████████ ████ # ████ ████████████████ ██████████████ ████ # ████ ████████████████ ██████████████ ████ # ████ ██████████████ ████████████ ████ # ████ ██████████████ ████████████ ████ # ████ ██████████████ ██████████████ ████ # ████ ██████████████ ████████████████ ████ # ████ ██████████████████ ████████████████████ ████ # ████ ████████████████████ ████████████████████████ ████ # ████ ██████████████████████████ ██████████████████████ ████ # ████ ██████████████████████████████ ██████████████████████ ████ # ████ ██████████████████████████████ ████ # ████ ████ # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████ # ████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████