Skip to content

Commit

Permalink
new elite intro state - ippa & deps g4m1ng!
Browse files Browse the repository at this point in the history
  • Loading branch information
ippa committed Oct 24, 2009
1 parent a11c822 commit eb70b8f
Show file tree
Hide file tree
Showing 10 changed files with 63 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Main.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def initialize(width = 800, height = 600, fullscreen = false, update_interval =
# Normal font used elsewhere
@font = Font.new($window, default_font_name, 30)


push_game_state( ScamState )
push_game_state( IntroState )
end

#
Expand Down
23 changes: 23 additions & 0 deletions high_score_list.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
- :name: IPP
:score: 2340
- :name: CCC
:score: 2190
- :name: FOO
:score: 1480
- :name: BZR
:score: 500
- :name: BZR
:score: 450
- :name: BZR
:score: 400
- :name: BZR
:score: 350
- :name: BZR
:score: 300
- :name: BZR
:score: 250
- :name: BZR
:score: 200
- :name: BZR
:score: 150
Binary file added media/game_over.ttf
Binary file not shown.
Binary file added media/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/intro.ogg
Binary file not shown.
Binary file added media/intro_1.wav
Binary file not shown.
Binary file added media/intro_2.wav
Binary file not shown.
Binary file added media/intro_3.wav
Binary file not shown.
Binary file added media/skull.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions models/intro_state.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
class IntroState < Chingu::GameState
#has_trait :timer, :effect
def initialize(options = {})
super
self.input = { :space => :pop_game_state, :esc => :pop_game_state }
@skull = GameObject.create(:image => "skull.png", :rotation_center => :top_left, :color => 0x00FFFFFF, :zorder => 2)
@gradient = GameObject.create(:image => "gradient.png", :rotation_center => :top_left, :color => 0x00FFFFFF, :zorder => 1)

# remove when new chingu comes out
@skull.rotation_center(:top_left)
@gradient.rotation_center(:top_left)

@sweep = Song["intro.ogg"]
@sweep.play

Text.size = 120
Text.font = "media/game_over.ttf"
@drop_text = Array.new
@drop_text << Text.create("IPPA", :y => -600*4, :color => 0xFFFF0000, :stop_at => 100, :sound => "intro_1.wav", :falling => true)
@drop_text << Text.create("& DEPS", :y => -700*4, :color => 0xFF00FF00, :stop_at => 200, :sound => "intro_2.wav", :falling => true)
@drop_text << Text.create("GAMING", :y => -800*4, :color => 0xFF0000FF, :stop_at => 300, :sound => "intro_3.wav", :falling => true)
end

def update
@skull.alpha += 1
@gradient.alpha += 1

@drop_text.select { |text| text.options[:falling] }.each do |text|
if text.y > text.options[:stop_at]
Sound[text.options[:sound]].play(0.4)
text.options[:falling] = false
@sweep.stop if @sweep
else
text.y += 10
end
end
end

end

0 comments on commit eb70b8f

Please sign in to comment.