Jump to content

updated phaser, game not working anymore


Dread Knight
 Share

Recommended Posts

I always have huge issues with getting games to work after updating phaser to a newer version -_- ​ 

 

I got a prototype going and not even the main menu is working properly after updating from 2.1.3 to 2.2.1

 

Here's the code for my main menu http://jsfiddle.net/DreadKnight/xmr8jgbe/

 

All I see in the Chrome console is this

 

Phaser v2.2.1 | Pixi.js v2.2.0 | WebGL | WebAudio     http://phaser.io ♥♥♥

phaser.min.js:15 Phaser.Tween.to cannot be called after Tween.start
phaser.min.js:15 Uncaught TypeError: object is not a function
/Shirt/js/phaser.map:1 GET http://localhost/Shirt/js/phaser.map 404 (Not Found)
 
Any ideas?
Link to comment
Share on other sites

Probably your chained tween.

 

Also this:

this.add.tween(Frank).to( { alpha: 1 }, 3000, null, true, 500);

"null" shouldn't really be passed as a type of tween. Just use this instead:

this.add.tween(Frank).to( { alpha: 1 }, 3000, "Linear", true, 500);

This is almost certainly the issue though:

this.add.tween(press).to( { alpha: 1 }, 800, null, true, 6000).to( { alpha: 0 }, 800, null, true, 100, Number.MAX_VALUE, true);

I'm not totally sure what's going on here :) Are you trying to fade on something (after 6 seconds) and then fade off and then repeat?! Should the whole lot repeat or just the final part?

 

Either way maybe like this:

var tween = this.add.tween(press).to( { alpha: 1 }, 800, "Linear", false, 6000);tween.to( { alpha: 0 }, 800, "Linear", false, 100);tween.loop(true);tween.start();

Although hard to know fully really.

Link to comment
Share on other sites

Thanks, seems the ease type really needs to be specified now, had a feeling that might be the case though I constantly forget the order of the parameters and need to check a guide or something (too many of them).

 

Regarding the other stuff, I avoided chains before because I found them a bit stiff as I can't chain stuff with branches apparently.

In my case some of the branches would end with looping animations, which in a linear chain that totally breaks things off.

Also, it seems when playing a yoyo loop, the delay is no longer taken into consideration, regression/bug most likely https://github.com/photonstorm/phaser/issues/1469

Here's an older version (simpler) of the prototype I'm working on so you can get an idea http://gamejolt.com/games/adventure/frank-in-shirt/40025/

Source code now available on github, using Phaser 2.1.3 for now since that regression https://github.com/FreezingMoon/Frank-in-Shirt

Link to comment
Share on other sites

Yeah that was happening to me, exact same error...

I was creating a tween with autostart set to true, and then had several .to() calls chained on...

It doesn't work like that anymore, because the tween is started before the first to() call...

Hence the error: Phaser.Tween.to cannot be called after Tween.start

While you never called start, you did autostart it, and to() doesn't like that anymore...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...