splashState.js 779 B

12345678910111213141516171819202122232425262728293031
  1. function SplashState() {
  2. SplashState.superclass.constructor.apply(this);
  3. this.timer = 100;
  4. }
  5. extend(SplashState, TrinState);
  6. SplashState.prototype.create = function() {
  7. SplashState.superclass.create.apply(this);
  8. var back = new TrinSprite();
  9. back.addAnimationFromCache("ComicsBack");
  10. var a10Logo = new TrinButton(function() {
  11. _TrinGame.SPIL_SPLASH.action();
  12. }, "A10Splash", true);
  13. a10Logo.orign.x = a10Logo.width / 2;
  14. a10Logo.orign.y = a10Logo.height / 2;
  15. a10Logo.reset(320, 480);
  16. this.add(back);
  17. this.add(a10Logo);
  18. };
  19. SplashState.prototype.update = function() {
  20. SplashState.superclass.update.apply(this);
  21. this.timer--;
  22. if (this.timer <= 0) {
  23. _TrinGame.switchState(new MainMenuState());
  24. }
  25. };