mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Intro movie (still need to make it skippable)
This commit is contained in:
@@ -19,9 +19,9 @@ def pbSetPokemonCenter
|
||||
end
|
||||
|
||||
def Kernel.Autosave
|
||||
Game.auto_save
|
||||
#Game.auto_save
|
||||
#showSaveIcon()
|
||||
# pbSave(false)
|
||||
pbSave(false)
|
||||
# #hideSaveIcon()
|
||||
end
|
||||
|
||||
|
||||
@@ -15,10 +15,25 @@ class Scene_Intro
|
||||
|
||||
alias main_old main
|
||||
|
||||
def playIntroCinematic
|
||||
intro_frames_path = "Graphics\\Pictures\\Intro\\INTRO-%03d"
|
||||
intro_bgm = "INTRO_music_cries"
|
||||
intro_movie = Movie.new(intro_frames_path,intro_bgm,230,true)
|
||||
intro_movie.playInViewPort(@viewport)
|
||||
while(!intro_movie.finished)
|
||||
echo intro_movie.finished
|
||||
echo "\n"
|
||||
wait(8)
|
||||
end
|
||||
end
|
||||
|
||||
def main
|
||||
Graphics.transition(0)
|
||||
# Cycles through the intro pictures
|
||||
@skip = false
|
||||
|
||||
|
||||
playIntroCinematic
|
||||
# Selects title screen style
|
||||
@screen = GenOneStyle.new
|
||||
# Plays the title screen intro (is skippable)
|
||||
|
||||
89
Data/Scripts/050_AddOns/Movie.rb
Normal file
89
Data/Scripts/050_AddOns/Movie.rb
Normal file
@@ -0,0 +1,89 @@
|
||||
class Movie
|
||||
attr_reader :finished
|
||||
|
||||
def initialize(framesPath, bgm, maxFrame = 1000, canStopEarly=false)
|
||||
@currentFrame = 1
|
||||
@initialTime = nil
|
||||
@timeElapsed = nil
|
||||
@maxFrame = maxFrame
|
||||
@framesPath = framesPath
|
||||
@bgm = bgm
|
||||
@canStopEarly = canStopEarly
|
||||
@finished=false
|
||||
end
|
||||
|
||||
def play(imageNumber = 12)
|
||||
@finished=false
|
||||
@currentFrame = 1
|
||||
@initialTime = Time.now
|
||||
@timeElapsed = Time.now
|
||||
|
||||
pbBGMPlay(@bgm)
|
||||
while (@currentFrame <= @maxFrame)# && !(@canStopEarly && Input::ACTION))
|
||||
if Input.trigger?(Input::C)
|
||||
echo "bruh"
|
||||
echo "\n"
|
||||
|
||||
end
|
||||
frame = sprintf(@framesPath, @currentFrame)
|
||||
picture = Game_Picture.new(imageNumber)
|
||||
picture.show(frame, 0, 0, 0, 100, 100, 255, 0)
|
||||
pbWait(Graphics.frame_rate / 20)
|
||||
picture.erase
|
||||
@currentFrame += 1
|
||||
end
|
||||
@finished=true
|
||||
pbBGMStop
|
||||
end
|
||||
|
||||
def playInViewPort(viewport)
|
||||
@finished=false
|
||||
@currentFrame = 1
|
||||
@initialTime = Time.now
|
||||
@timeElapsed = Time.now
|
||||
|
||||
pbBGMPlay(@bgm)
|
||||
while (@currentFrame <= @maxFrame)# && !(@canStopEarly && Input::ACTION))
|
||||
Input.update
|
||||
if Input.trigger?(Input::C)
|
||||
echo "bruh"
|
||||
echo "\n"
|
||||
|
||||
end
|
||||
break if Input.trigger?(Input::ACTION) && @canStopEarly
|
||||
frame = sprintf(@framesPath, @currentFrame)
|
||||
picture = Sprite.new(viewport)
|
||||
picture.bitmap = pbBitmap(frame)
|
||||
picture.visible=true
|
||||
pbWait(Graphics.frame_rate / 20)
|
||||
picture.dispose
|
||||
@currentFrame += 1
|
||||
end
|
||||
@finished=true
|
||||
pbBGMStop
|
||||
end
|
||||
|
||||
# not really necessary I think
|
||||
def pbAutoregulador()
|
||||
hora_inicio = $game_variables[VARIABLE_TIME_INITIAL]
|
||||
hora_actual = Time.now
|
||||
diferencia = (hora_actual - hora_inicio) * 20 #20 frames corresponde a 1 seg
|
||||
#Redondeo
|
||||
diferencia_entera = diferencia.to_i
|
||||
|
||||
diferencia_entera = diferencia_entera.to_f
|
||||
|
||||
if diferencia - diferencia_entera >= 0.5
|
||||
diferencia_entera = diferencia_entera + 1
|
||||
end
|
||||
|
||||
$game_variables[VARIABLE_CURRENT_FRAME] = diferencia_entera.to_int
|
||||
|
||||
$game_variables[VARIABLE_TIME_ELAPSED] = Time.now
|
||||
|
||||
return $game_variables[VARIABLE_CURRENT_FRAME]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def pbPlayMovie(framesPath, bgm, maxFrame = 1000, imageNumber = 12) end
|
||||
Reference in New Issue
Block a user