Class: EndCredits

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

Overview

END CREDITS GAMESTATE

the end of the end of the end - big thanks to everyone who helped out!

Instance Method Summary collapse

Constructor Details

#initializeEndCredits

Returns a new instance of EndCredits.



243
244
245
246
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/ending.rb', line 243

def initialize
  super
  self.input = { :esc => :exit, [:enter, :return] => Introduction, :p => Pause, :r => lambda{current_game_state.setup}, [:q, :l] => :pop }
end

Instance Method Details

#popObject



319
320
321
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/ending.rb', line 319

def pop
  pop_game_state(:setup => false)
end

#setupObject



248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/ending.rb', line 248

def setup
  $window.caption = "Credits"
  @scroll_speed = 0.6
  @st = 580  # starting y position for text
  @sp = 50   # spacing for text

  @cheering1 = Sound["media/audio/huge_crowd.ogg"]
  @cheering2 = Sound["media/audio/huge_crowd_roar.ogg"]

  # end credits start offscreen
  @t1 = Chingu::Text.create(:text=>"" , :y=>675, :size=>40, :font => "GeosansLight")
  @t1.x = 400 - @t1.width/2   # @t1 is currently blank
  @t2 = Chingu::Text.create(:text=>"Created by Matt Lemmon and Fractional" , :y=>@st+@sp*2, :size=>40, :font => "GeosansLight")
  @t2.x = 400 - @t2.width/2
  @t3 = Chingu::Text.create(:text=>"Gosu by jlnr" , :y=>@st+@sp*3, :size=>40, :font => "GeosansLight")
  @t3.x = 400 - @t3.width/2
  @t4 = Chingu::Text.create(:text=>"Chingu by ippa" , :y=>@st+@sp*4, :size=>40, :font => "GeosansLight")
  @t4.x = 400 - @t4.width/2
  @t5 = Chingu::Text.create(:text=>"Ruby by Yukihiro Matsumoto" , :y=>@st+@sp*5, :size=>40, :font => "GeosansLight")
  @t5.x = 400 - @t5.width/2
  @t6 = Chingu::Text.create(:text=>"Game Theme Music by ExplodingCookie " , :y=>@st+@sp*6, :size=>40, :font => "GeosansLight")
  @t6.x = 400 - @t6.width/2
  @t7 = Chingu::Text.create(:text=>"Intro Music from StarryKnight by burtlo" , :y=>@st+@sp*7, :size=>40, :font => "GeosansLight")
  @t7.x = 400 - @t7.width/2
  @t8 = Chingu::Text.create(:text=>"Knight and Voice from StarryKnight by burtlo" , :y=>@st+@sp*8, :size=>40, :font => "GeosansLight")
  @t8.x = 400 - @t8.width/2

  @t9 = Chingu::Text.create(:text=>"End Music creator unknown" , :y=>@st+@sp*9, :size=>40, :font => "GeosansLight")
  @t9.x = 400 - @t9.width/2
#    @t10 = Chingu::Text.create(:text=>"Sound Effects need additional attribution" , :y=>@st+@sp*10, :size=>40, :font => "GeosansLight")
#    @t10.x = 400 - @t10.width/2
  @t11 = Chingu::Text.create(:text=>"Future Earth by" , :y=>@st+@sp*11, :size=>40, :font => "GeosansLight")
  @t11.x = 400 - @t11.width/2
  @img11 = Signature1.create
  @img11.x = 400 + @t11.width/2 + 5 + @img11.width/2
  @img11.y = @st+@sp*11+20
  @t12 = Chingu::Text.create(:text=>"Future Earth 2 by" , :y=>@st+@sp*12, :size=>40, :font => "GeosansLight")
  @t12.x = 400 - @t12.width/2
  @img12 = Signature2.create
  @img12.x = 400 + @t12.width/2 + 10 + @img12.width/2
  @img12.y = @st+@sp*12+20
  @t13 = Chingu::Text.create(:text=>"Additional thanks to Linux/Ubuntu" , :y=>@st+@sp*13, :size=>40, :font => "GeosansLight")
  @t13.x = 400 - @t13.width/2
  @t14 = Chingu::Text.create(:text=>"Additional thanks to rvm" , :y=>@st+@sp*14, :size=>40, :font => "GeosansLight")
  @t14.x = 400 - @t14.width/2
  @t15 = Chingu::Text.create(:text=>"Additional thanks to SublimeText2" , :y=>@st+@sp*15, :size=>40, :font => "GeosansLight")
  @t15.x = 400 - @t15.width/2
  @t16 = Chingu::Text.create(:text=>"Additional thanks to Gimp" , :y=>@st+@sp*16, :size=>40, :font => "GeosansLight")
  @t16.x = 400 - @t16.width/2
#    @t17 = Chingu::Text.create(:text=>"Additional thanks to gamedev.stackexchange.com" , :y=>@st+@sp*17, :size=>40, :font => "GeosansLight")
#    @t17.x = 400 - @t17.width/2
  @t18 = Chingu::Text.create(:text=>"Special thanks to PeterT and Spooner" , :y=>@st+@sp*19, :size=>40, :font => "GeosansLight")
  @t18.x = 400 - @t18.width/2
  @t19 = Chingu::Text.create(:text=>"Extra Special thanks to jlnr and libgosu.org" , :y=>@st+@sp*20, :size=>40, :font => "GeosansLight")
  @t19.x = 400 - @t19.width/2
  @t20 = Chingu::Text.create(:text=>"Thanks to the people of Sweden and Honduras" , :y=>@st+@sp*26, :size=>40, :font => "GeosansLight")
  @t20.x = 400 - @t20.width/2
  @t21 = Chingu::Text.create(:text=>"Thanks to the people of Japan and Germany" , :y=>@st+@sp*27, :size=>40, :font => "GeosansLight")
  @t21.x = 400 - @t21.width/2

  after(100) { @cheering2.play(0.3) }    # scripts for crowd noise, music, and returning to Introduction gamestate
  after(2700) { @cheering2.play(0.2) }
  after(5000) { @cheering2.play(0.2) }
  after(8000) { @cheering2.play(0.1) }
  after(11000) { @cheering1.play(0.2) }
  after(11000) { $music.volume = 0.9 }
  after(14000) { $music.volume = 1.0 }

  after(45300) { push_game_state (Chingu::GameStates::FadeTo.new(Introduction.new, :speed => 10)) }
end

#updateObject



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/games_and_rpg_paradise/gui/gosu/chinguroids/ending.rb', line 323

def update
  @t1.y -= @scroll_speed  # move text slightly upward each tick
  @t2.y -= @scroll_speed
  @t3.y -= @scroll_speed
  @t4.y -= @scroll_speed
  @t5.y -= @scroll_speed
  @t6.y -= @scroll_speed
  @t7.y -= @scroll_speed
  @t8.y -= @scroll_speed
  @t9.y -= @scroll_speed
#    @t10.y -= @scroll_speed
  @t11.y -= @scroll_speed
  @img11.y -= @scroll_speed
  @t12.y -= @scroll_speed
  @img12.y -= @scroll_speed
  @t13.y -= @scroll_speed
  @t14.y -= @scroll_speed
  @t15.y -= @scroll_speed
  @t16.y -= @scroll_speed
#    @t17.y -= @scroll_speed
  @t18.y -= @scroll_speed
  @t19.y -= @scroll_speed
  if @t20.y > 650             # ease in last, final credits
    @t20.y -= @scroll_speed
    @t21.y -= @scroll_speed
  elsif @t20.y > 625
    @t20.y -= 0.4
    @t21.y -= 0.4
  elsif @t20.y > 600
    @t20.y -= 0.5
    @t21.y -= 0.5
  elsif @t20.y > 500
    @t20.y -= 0.4
    @t21.y -= 0.4
  elsif @t20.y > 492
    @t20.y -= 0.2
    @t21.y -= 0.2
  elsif @t20.y > 490
    @t20.y -= 0.1
    @t21.y -= 0.1
  end
end