Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function createShip(x,y,angle,ship){
- var s = game.add.sprite(x,y,ship);
- s.rotation = angle;
- s.anchor.setTo(0.5,0.5);
- return s;
- }
- for(var i in data){
- if(others[i] == undefined && i != socket.id){
- var d = data[i];
- others[i] = createShip(d.x,d.y,d.angle,d.ship);
- }
- found[i] = true;
- if(i != socket.id){
- others[i].x = data[i].x;
- others[i].y = data[i].y;
- others[i].rotation = data[i].angle;
- others[i].ship = data[i].ship;
- }
- }
- game.physics.startSystem(Phaser.Physics.ARCADE);
- game.physics.arcade.enable(others);
- game.physics.arcade.collide(others);
Add Comment
Please, Sign In to add comment