Jump to content

What is the best framework to Cocoon ?


penpen5624
 Share

Recommended Posts

Hello everybody, 

 

I've just made a game with PhaserJs 1.1.3.  This one work very well on web browser but on mobile ... I've used CocoonJs to improve the performance. It's better (53-60 fps) but when I do an action (jump) the number of fps fall at 43 fps. So, It's very unpleasant to play.

 

I very optimize the game : remove unneccessary calculation, replace the division (/2) by ( x 0.5)...

 

So, I would like know what is the best html5 framework to made arcade game with CocoonJs (the best for the performance).

 

Thanks for your futures responses ;)

Link to comment
Share on other sites

I guess It's because they are several objets in movement in the same time. 
If I paused the other objects it's fast. May be with Phaser.Webgl mode it's be better, no ?
 
The jump function :

jump: function() {        var min = 20,            min_r;        this.men.forEachAlive(function(r) {            if (r.jump == false && r.pos < min) {                min = r.pos;                min_r = r;            }        }, this);        var man = min_r;        if (min != 20 && !man.t.isRunning) {            this.change_level = true;            //calcul of position of jump because It's variable            var x = w * 0.5 + (this.circle.width * 0.5 + hauteurSaut) * Math.cos(man.rotation - Math.PI * 0.5); //40            var y = h * 0.5 + (this.circle.width * 0.5 + hauteurSaut) * Math.sin(man.rotation - Math.PI * 0.5 ); //40            man.t2 = this.game.add.tween(man).to({                x: x,                y: y            }, 250).to({ //200                x: man.x,                y: man.y            }, 380); //400            man.t2.start();            man.jump = true;             score += 1;            localStorage.setItem("score",score);            //Fix bug Cocoon because There were a problem of refresh score. (the score get above of the precedent ...)              this.world_label.destroy();              this.world_label =  game.add.text (w * 0.5, h * 0.5, score, s2);              this.world_label.anchor.setTo(0.5, 0.4);            soundJump.play();                    }    },

I don't see what I could remove on this code. If you see anything to modify. Do not hesitate.

 

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