Report a Bug

SIGN IN!

So you want to make a title screen?


There were some questions and I personally struggled with it when I started with Impact - so here we go. Check zipped file for the whole code as there are some issues when displaying the code.
  1. Check the zip for the full source...
  2.  
  3. Its fairly simple add this at the end of your main.js before your canvas call.
  4. Intro = ig.Class.extend({
  5. introTimer: null,
  6. font: new ig.Font( 'media/04b03.font.png' ),
  7. init: function() {
  8. this.timer = new ig.Timer(30);
  9. ............
  Source/Support Files:  TitlescreenSnippet.zip

Its fairly simple to achieve. The whole idea is to create additional class extension that will hold your intro screen and then just switch between them using ig.system.setGame() call.

To ensure consistency make sure stuff like score or lives is held in a global variable rather as an attribute of your game object as every time you change the to intro and then to game your data will be reset.


gettoarun
Aah.. Fixed it. There is a typo. The timer is 'introTimer' not 'timer' as referred in the init method.

Fixed init method...

init: function() {
this.introTimer = new ig.Timer(30);
},
gettoarun
Hi, I followed the snippet and I get this on chrome. Any ideas?

Uncaught TypeError: Cannot call method 'delta' of null
ig.Class.extend.runmain.js:65
ig.System.ig.Class.extend.runsystem.js:101
(anonymous function)
Contributed by:
Jerczu
View Profile
Category:Game Elements
Updated:October 2, 2011
Rating:
Your Rating (0)
Average Rating (4)
Ready to get to the point?

Your Email will remain private and is only used for good. We promise!


Please use only letters, numbers or underscores.

SIGN UP!