Various improvements/cases for GDC

This commit is contained in:
Mathew Velasquez 2016-03-07 18:47:34 -05:00
parent 3bc60bb45d
commit f90828be05
3 changed files with 33 additions and 19 deletions

View File

@ -17,6 +17,8 @@ class Game_Switches
# switch_id : switch ID # switch_id : switch ID
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def [](switch_id) def [](switch_id)
assert_not_deprecated(switch_id)
return true if switch_id == 25
if switch_id <= 5000 and @data[switch_id] != nil if switch_id <= 5000 and @data[switch_id] != nil
return @data[switch_id] return @data[switch_id]
else else
@ -29,8 +31,15 @@ class Game_Switches
# value : ON (true) / OFF (false) # value : ON (true) / OFF (false)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def []=(switch_id, value) def []=(switch_id, value)
assert_not_deprecated(switch_id)
if switch_id <= 5000 if switch_id <= 5000
@data[switch_id] = value @data[switch_id] = value
end end
end end
def assert_not_deprecated(switch_id)
if switch_id == 10 || switch_id == 21
STDERR.puts "deprecated switch referenced in map #{$game_map.map_id}"
end
end
end end

View File

@ -5,6 +5,7 @@
#============================================================================== #==============================================================================
begin begin
$console = Graphics.fullscreen
Graphics.frame_rate = 60 Graphics.frame_rate = 60
Font.default_size = 20 Font.default_size = 20

View File

@ -31,8 +31,8 @@ class Scene_Title
new_game unless load new_game unless load
# Make system object # Make system object
$game_system = Game_System.new $game_system = Game_System.new
# Skip title screen if debug mode # Skip title screen if debug mode (or demo, but not GDC)
if $debug if $debug || ($demo && !$GDC)
$game_map.update $game_map.update
$scene = Scene_Map.new $scene = Scene_Map.new
return return
@ -45,7 +45,9 @@ class Scene_Title
@menu.z += 1 @menu.z += 1
@menu.bitmap = Bitmap.new(640, 480) @menu.bitmap = Bitmap.new(640, 480)
@menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start")) @menu.bitmap.draw_text(MENU_X, MENU_Y, 150, 24, tr("Start"))
if !$GDC
@menu.bitmap.draw_text(MENU_X, MENU_Y + 28, 150, 24, tr("Exit")) @menu.bitmap.draw_text(MENU_X, MENU_Y + 28, 150, 24, tr("Exit"))
end
# Make cursor graphic # Make cursor graphic
@cursor = Sprite.new @cursor = Sprite.new
@cursor.zoom_x = @cursor.zoom_y = 2 @cursor.zoom_x = @cursor.zoom_y = 2
@ -53,7 +55,7 @@ class Scene_Title
@cursor.z += 2 @cursor.z += 2
@cursor.bitmap = RPG::Cache.menu('cursor') @cursor.bitmap = RPG::Cache.menu('cursor')
@cursor.x = MENU_X - 12 @cursor.x = MENU_X - 12
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 @cursor.y = MENU_Y + (22 - @cursor.bitmap.height) / 2
# Initialize cursor position # Initialize cursor position
@cursor_pos = 0 @cursor_pos = 0
# Play title BGM # Play title BGM
@ -95,6 +97,7 @@ class Scene_Title
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def update def update
# Handle cursor movement # Handle cursor movement
if !$GDC
update_cursor = false update_cursor = false
if Input.trigger?(Input::UP) if Input.trigger?(Input::UP)
if @cursor_pos > 0 if @cursor_pos > 0
@ -111,6 +114,7 @@ class Scene_Title
Audio.se_play('Audio/SE/title_cursor.wav') Audio.se_play('Audio/SE/title_cursor.wav')
@cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 24 * @cursor_pos @cursor.y = MENU_Y + (24 - @cursor.bitmap.height) / 2 + 24 * @cursor_pos
end end
end
# Handle confirmation # Handle confirmation
if Input.trigger?(Input::ACTION) if Input.trigger?(Input::ACTION)
@ -156,7 +160,7 @@ class Scene_Title
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def command_continue def command_continue
# Play decision SE # Play decision SE
$game_system.se_play($data_system.decision_se) Audio.se_play('Audio/SE/title_decision.wav')
# Update map (run parallel process event) # Update map (run parallel process event)
$game_map.update $game_map.update
# Switch to map screen # Switch to map screen
@ -167,7 +171,7 @@ class Scene_Title
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def command_shutdown def command_shutdown
# Play decision SE # Play decision SE
$game_system.se_play($data_system.decision_se) Audio.se_play('Audio/SE/title_decision.wav')
# Fade out BGM, BGS, and ME # Fade out BGM, BGS, and ME
Audio.bgm_fade(800) Audio.bgm_fade(800)
Audio.bgs_fade(800) Audio.bgs_fade(800)