Jump to content

pac-man behaviour using tweens (without the worldbounds).


Terumi
 Share

Recommended Posts

Hello,

 

How can you implement a pacman like behaviour without using worldbounds?

Say that I have a 5x5 grid in the middle of the stage. Whenever a sprite exits the grid I want it to 'wrap around '.

 

I could do something like

  • tween a sprite till the end of the grid
  • teleport it just outside the other side of the grid
  • tween it to its destination

But this would seem like a glitch in the teleportation part.

 

It would be nicer to have the grid simulate the game bounds and if a sprite exits the stage , the teleportation to the other side would be transparent.

 

This effect could be achieved using a mask, but I don't know if such a thing can implemented using phaser.

 

Sorry If I sound weird, it was just random thoughts...

Does anyone has any ideas on how to implement such a behaviour?

 

Thank you

 

 

Link to comment
Share on other sites

Hm... if I understand the problem is that if you "teleport" the sprite than for brief second it will disappear or it will disapear early because it hit the right side....

 

I'm not realy into tween animation... but beside that there is example where sprite goes out from one side and then comes form the the other:

 

http://gametest.mobi/phaser/examples/_site/view_full.html?d=animation&f=looped+animation.js&t=looped%20animation

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...