Class: OpeningCredits2

Inherits:
Chingu::GameState
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/gui/gosu/chinguroids/beginning.rb

Overview

OPENING CREDITS 2 GAMESTATE

Ruby  with animated sparkle

Instance Method Summary collapse

Instance Method Details

#drawObject



116
117
118
119
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/beginning.rb', line 116

def draw
  Image["../media/assets/ruby-logo.png"].draw(0, 0, 0)
  super
end

#introObject

pressing ‘enter’ skips ahead to the Introduction



112
113
114
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/beginning.rb', line 112

def intro # pressing 'enter' skips ahead to the Introduction
  push_game_state(Chingu::GameStates::FadeTo.new(Introduction.new, :speed => 11))
end

#setupObject



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/beginning.rb', line 92

def setup
  self.input = { :esc => :exit, [:enter, :return] => :intro, :p => Pause, :r => lambda{current_game_state.setup} }
  Sparkle.destroy_all
  @sparkle = Sparkle.create(:x => 373, :y => 301, :zorder => 20) # Sparkle is defined in objects.rb
  after(20) {  # make the sparkle grow and turn, then stop turning
    @sparkle.turnify1  # turnify methods are defined in Sparkle class in objects.rb
    after(100) {
      @sparkle.turnify2
      after(400) {
        @sparkle.turnify3
        after(400) {
          @sparkle.turnify4
          after(400) {
            @sparkle.turnify5
            after(400) {
              @sparkle.turnify6
  } } } } } }
  after (2400) { push_game_state(Chingu::GameStates::FadeTo.new(Introduction.new, :speed => 8)) }
end