Flying mini game
Version: 9.28.07
Introduction
Edit: This script adds controls for stopping left scrolling, preventing the player from moving off screen during auto right scroll and game over options for touching the left side of the screen.
Features
Really not usefull as it doesn't have graphic effects
Demo
http://www.savefile.com/files/1086743
Instructions
Place this code above main and below the sdk if you use it
FAQ
none yet
Compatibility
Without editing the sdk itself this code will not work with the sdk, no other known compatibility issues.
Credits and Thanks
Many thanks to Eilei for help getting this up and running and to trickster for help with aliasing and sdk compatibility.
Author's Notes
As stated before this is mostly an event based mini game that uses a regular map.
NOTE: the demo has an older version of the script
Terms and Conditions
Free to use for non commercial games, no credit needed.
Version: 9.28.07
Introduction
Edit: This script adds controls for stopping left scrolling, preventing the player from moving off screen during auto right scroll and game over options for touching the left side of the screen.
Features
- stops left scrolling
- prevents player from moving off screen while map is scrolling right
- Game over option if player touches the left side of the screen
Really not usefull as it doesn't have graphic effects
Demo
http://www.savefile.com/files/1086743
Instructions
Place this code above main and below the sdk if you use it
Content Hidden
Spoiler
class Game_Temp
#We have now made a reference point to store the data of our flying options
#to access later
attr_accessor :left_scroll_off
attr_accessor :scroll_game_over
attr_accessor :flying_scene_on
end
#-----------------------------------------
#class: Game_Map
#this class sets our boolean values to false by default and controls our left scroll option
#-----------------------------------------
class Game_Map
#thi sets up an alias for the method initialize so that we're not replacing the default method. we do this for compatibility with
#other scripts.
alias_method :soul_flying_map_initialize, :initialize
def initialize
#sets starting values for the flying game when the map loads
$game_temp.left_scroll_off = false
$game_temp.scroll_game_over = false
$game_temp.flying_scene_on = false
#this calls the script to use the alias instead of the default from here out for this part of the script/
soul_flying_map_initialize
end
def scroll_left(distance)
#turns off left scroll if the flying game is loaded and lets left scroll resume if the option for it is off while the game is loaded
if $game_temp.flying_scene_on == true
if $game_temp.left_scroll_off == false
@display_x = [@display_x - distance, 0].max
end
else
#sets handling conditions for left scroll if the game isn't on at all
@display_x = [@display_x - distance, 0].max
end
end
end
#---------------------------------------------------------------------
#class: Game_Player
#we use this class to set our handling events for hen the player hits the left side of the screen
#to have them move right a bit the flying_scene_on just has to be set to true
#to have hitting the left part of the screen cause a game over set $game_temp.scroll_game_over to true with a call script
#-----------------------------------------------------------------------------
class Game_Player < Game_Character
alias_method :soul_flying_player_update, :update
def update
#moves the player right one space if they hit the left edge of the screen to force a "keep on screen effect"
if $game_temp.flying_scene_on == true
if @real_x < $game_map.display_x
move_right
end
#calls a game over if the player touches the left side of the screen and the game over option is on
if @real_x < $game_map.display_x && $game_temp.scroll_game_over == true
$scene = Scene_Gameover.new
end
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
case Input.dir4
when 2
move_down
when 4
#tells the game to only move left if they are still on screen when the left arrow is pressed
if @real_x > $game_map.display_x
move_left
end
when 6
move_right
when 8
move_up
end
end
end
soul_flying_player_update
end
end
#We have now made a reference point to store the data of our flying options
#to access later
attr_accessor :left_scroll_off
attr_accessor :scroll_game_over
attr_accessor :flying_scene_on
end
#-----------------------------------------
#class: Game_Map
#this class sets our boolean values to false by default and controls our left scroll option
#-----------------------------------------
class Game_Map
#thi sets up an alias for the method initialize so that we're not replacing the default method. we do this for compatibility with
#other scripts.
alias_method :soul_flying_map_initialize, :initialize
def initialize
#sets starting values for the flying game when the map loads
$game_temp.left_scroll_off = false
$game_temp.scroll_game_over = false
$game_temp.flying_scene_on = false
#this calls the script to use the alias instead of the default from here out for this part of the script/
soul_flying_map_initialize
end
def scroll_left(distance)
#turns off left scroll if the flying game is loaded and lets left scroll resume if the option for it is off while the game is loaded
if $game_temp.flying_scene_on == true
if $game_temp.left_scroll_off == false
@display_x = [@display_x - distance, 0].max
end
else
#sets handling conditions for left scroll if the game isn't on at all
@display_x = [@display_x - distance, 0].max
end
end
end
#---------------------------------------------------------------------
#class: Game_Player
#we use this class to set our handling events for hen the player hits the left side of the screen
#to have them move right a bit the flying_scene_on just has to be set to true
#to have hitting the left part of the screen cause a game over set $game_temp.scroll_game_over to true with a call script
#-----------------------------------------------------------------------------
class Game_Player < Game_Character
alias_method :soul_flying_player_update, :update
def update
#moves the player right one space if they hit the left edge of the screen to force a "keep on screen effect"
if $game_temp.flying_scene_on == true
if @real_x < $game_map.display_x
move_right
end
#calls a game over if the player touches the left side of the screen and the game over option is on
if @real_x < $game_map.display_x && $game_temp.scroll_game_over == true
$scene = Scene_Gameover.new
end
unless moving? or $game_system.map_interpreter.running? or
@move_route_forcing or $game_temp.message_window_showing
# Move player in the direction the directional button is being pressed
case Input.dir4
when 2
move_down
when 4
#tells the game to only move left if they are still on screen when the left arrow is pressed
if @real_x > $game_map.display_x
move_left
end
when 6
move_right
when 8
move_up
end
end
end
soul_flying_player_update
end
end
Expand to see the code.
FAQ
none yet
Compatibility
Without editing the sdk itself this code will not work with the sdk, no other known compatibility issues.
Credits and Thanks
Many thanks to Eilei for help getting this up and running and to trickster for help with aliasing and sdk compatibility.
Author's Notes
As stated before this is mostly an event based mini game that uses a regular map.
NOTE: the demo has an older version of the script
Terms and Conditions
Free to use for non commercial games, no credit needed.