Jump to content

Panda v1.13 fork with some v2(develop) API


PixelPicoSean
 Share

Recommended Posts

Hi everyone,

 

Since Panda v2 is under development and is not ready for use in production yet, I make a fork and add some newly introduced API to v1.13.

 

Check it out here: https://github.com/pixelpicosean/panda.js

 

List of changes:

  • Replace Animation with the new one in v2 branch.
  • Add "fadeIn" and "fadeOut" methods to Audio, which is also available in v2.
  • Move Vector from physics to geometry module and use it as a better replacement of PIXI.Point.
  • No need to call this.super(); in Scene.update and you can custom its update order like v2 does.

Some features like "pixel based anchor" is much harder to add so I did not change.

 

It is made for people who want to create NEW games and worried the code may not work when v2 is released or want to use new API for next serious game.

 

Hope you like it :D

Link to comment
Share on other sites

forget about animation loop and speed, I edited and add the properties on the renderer class, and send the parameters this way, myAnimation = new Animation(MyarrayTexture,Myspeed,IsLoop), so this way I have some as before, I don't know why the new anim system don't have some speed and loop params to individual anim, or at least I don't know a way, but it's not a problem now, Still dont know where I can find mouseX and Y...

Link to comment
Share on other sites

You can define animations by using "addAnim" method, here's an example:

// Create an animation instancevar myAnim = new Animation(['p001.png', 'p002.png']);// Define a new sequenced animationmyAnim.addAnim('animA', [0, 1], {   loop: false,   speed: 6,   onComplete: function() { console.log('anim finished'); }});// PlaymyAnim.play('animA');

My fork does not have any improvements related to official v1.13.1, it just brings some v2 APIs.

Link to comment
Share on other sites

this system is REALYY GOOD!, thanks!

 

it's this a real advantage over the current anim system? for example, I have an spritesheet with 80 frames, where are anims up down left an right, current I do this way:

arrayFramesUP = [frame 1, frame2.... frame20];

arrayFramesDOWN = [frame21,frame22,frame40];,

.... etc, and then create the animations:

 

player[0] = new Animation(arrayFramesUP);

player[1] = new Animation(arrayFramesDown);

player[2] = new Animation(arrayFramesLeft);

player[3] = new Animation(arrayFramesRight);

 

then I create a playerContainer and add the four anims, and make visible only the anim I need and play it,

with the new method, I can create only one var anim player, and then add the four sub anins, so I have

player.up

player.down

player.left

player.right

 

it's better for understand, I like more, BUT the real important thing, is there a performance difference, to have one var anim and subs anims, or it''s the same thing I have four vars anims with no subs anims?

 

thanks!

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