Version: <1.0>
Introduction
Have you ever wanted to have that Mortal Kombat Mini Game, where you needed to press a button to increase a bar?Now you can Have it!
Features
Screenshots
No Need...
Demo
here it is...
http://up-file.com/download/77e46f174585/Emeraldon.rar.html
Please replace the Script in the demo with this one, the other one has a bug...
Script
#==============================================================================
# Script Test_Might
#
# By: Chaosg1
# Version : 1.0
# Date :13-09-2006
#==============================================================================
class Test_Might
#--------------------------------------------------------------------------
# * Main - Handles drawing/disposing windows and the main loop
#--------------------------------------------------------------------------
def initialize(time,increase,decrese)
$test_passed = false
@window_status = Window_Base.new(0,0 ,160,160)
@time = time + 4
@decrease = decrese
@increase = (increase*5) * $game_party.actors[0].str/100 + $game_party.actors[0].int/100
@might_value = 0
@window_status.contents = Bitmap.new(@window_status.width - 32, @window_status.height - 32)
@window_status.opacity = 0
end
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
def main
@spriteset_map = Spriteset_Map.new
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
#refresh
refresh
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@window_status.dispose
@spriteset_map.dispose
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@total_sec = Graphics.frame_count / Graphics.frame_rate
@window_status.contents.clear
@window_status.contents.draw_text(12,0,60,32,"Time Left:",2)
@window_status.contents.draw_text(72,0,30,32,@time.to_s,2)
@window_status.contents.draw_text(20,25,60,32,"Might",2)
@window_status.draw_gradient_bar(0, 60, @might_value, 1000, "014-Reds01.png", width = nil, height = nil, hue = 0, back = "Back", back2 = "Back2")
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
if @time <= 0 and @might_value < 800
$scene = Scene_Map.new
$game_system.se_play($data_system.buzzer_se)
elsif @might_value > 800 and @time > 0
$scene = Scene_Map.new
$test_passed = true
return
end
@might_value -= @decrease if @might_value > 0 and @might_value < 999
if Input.trigger?(Input::X)
@might_value += @increase
end
@spriteset_map.update
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
@time -=1
end
end
end
# Script Test_Might
#
# By: Chaosg1
# Version : 1.0
# Date :13-09-2006
#==============================================================================
class Test_Might
#--------------------------------------------------------------------------
# * Main - Handles drawing/disposing windows and the main loop
#--------------------------------------------------------------------------
def initialize(time,increase,decrese)
$test_passed = false
@window_status = Window_Base.new(0,0 ,160,160)
@time = time + 4
@decrease = decrese
@increase = (increase*5) * $game_party.actors[0].str/100 + $game_party.actors[0].int/100
@might_value = 0
@window_status.contents = Bitmap.new(@window_status.width - 32, @window_status.height - 32)
@window_status.opacity = 0
end
#--------------------------------------------------------------------------
# * Main
#--------------------------------------------------------------------------
def main
@spriteset_map = Spriteset_Map.new
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
#refresh
refresh
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@window_status.dispose
@spriteset_map.dispose
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
@total_sec = Graphics.frame_count / Graphics.frame_rate
@window_status.contents.clear
@window_status.contents.draw_text(12,0,60,32,"Time Left:",2)
@window_status.contents.draw_text(72,0,30,32,@time.to_s,2)
@window_status.contents.draw_text(20,25,60,32,"Might",2)
@window_status.draw_gradient_bar(0, 60, @might_value, 1000, "014-Reds01.png", width = nil, height = nil, hue = 0, back = "Back", back2 = "Back2")
end
#--------------------------------------------------------------------------
# * Update
#--------------------------------------------------------------------------
def update
if @time <= 0 and @might_value < 800
$scene = Scene_Map.new
$game_system.se_play($data_system.buzzer_se)
elsif @might_value > 800 and @time > 0
$scene = Scene_Map.new
$test_passed = true
return
end
@might_value -= @decrease if @might_value > 0 and @might_value < 999
if Input.trigger?(Input::X)
@might_value += @increase
end
@spriteset_map.update
if Graphics.frame_count / Graphics.frame_rate != @total_sec
refresh
@time -=1
end
end
end
Expand to see the code.
Credits
Me, and Trickster for his gradien bars..
Instruction
To fil the bar just press the A key...
just make in a call script
$scene = Test_Might.new(Time,Increase, decrease)
Expand to see the code.
wait 1
then a conditional branch. In the script line just make:
$test_passed = =true
That's it.
Authors Notes:
Enjoy:p expect and update when Trickster extra methods/classes pack are out...