Deino

Members
  • Content Count

    12
  • Joined

  • Last visited

About Deino

  • Rank
    Member

Recent Profile Visitors

595 profile views
  1. Is the market so saturated that luck overshadows quality?
  2. Is it true that OpenFL-bitfive is using Pixi as backend? What version of pixi is being used? Is it now as fast as phaser?
  3. This is the code from my partially complete game, I ran into this problem with the animation part var game = new Phaser.Game(1350,600,Phaser.AUTO,'gameDiv');var mainState = { preload: function() { game.load.spritesheet('dude','assets/dude.png',32,48); game.load.image('wh','assets/wallHorizontal.png'); game.load.image('ground','assets/Ground.png'); }, create: function() { game.stage.backgroundColor = '#DB7093'; this.dude = game.add.sprite(80,482,'dude'); this.wh = game.add.sprite(10,10,'wh'); this.ground = game.add.sprite(0,530,'ground'); this.ground2 = game.add.sprite(476,530,'ground'); this.ground3 = game.add.sprite(952,530,'ground'); this.physics.enable(this.wh,Phaser.Physics.ARCADE); this.wh.body.immovable = true; this.physics.enable(this.dude,Phaser.Physics.ARCADE); this.facing = 'left'; this.cursors = this.input.keyboard.createCursorKeys(); this.physics.enable(this.ground,Phaser.Physics.ARCADE); this.ground.body.immovable = true; this.dude.animations.add('left', [0, 1, 2, 3], 10, true); this.dude.animations.add('right', [5, 6, 7, 8], 10, true); }, update: function() { game.physics.arcade.collide(this.dude,this.wh,null,null,this); this.dude.body.velocity.x = 0; if(this.cursors.left.isDown) { this.dude.body.velocity.x = -300; if(this.facing != 'left') { this.dude.animations.play('left'); this.facing = 'left'; } } else if(this.cursors.right.isDown) { this.dude.body.velocity.x = 300; if(this.facing != 'right') { this.dude.animations.play('right'); this.facing = 'right'; } } else { if (this.facing != 'idle') { this.dude.animations.stop(); if (this.facing == 'left') { this.dude.frame = 0; } else { this.dude.frame = 5; } facing = 'idle'; } } if(this.dude.inWorld == false) { game.state.start('main'); } }};game.state.add('main',mainState);game.state.start('main');
  4. Hello, I am an electronics student currently learning game development along with my artist friend. I have been leaning Phaser. I want to know the current situation in HTML5 game scene. I know the old days of gold-rush are over. I want to know if HTML5 game development still remains the low-risk comparatively higher return 'genre' as it used to be? Are sponsors paying on time or do they take months like some horror stories claim, even if the quality is optimum? How is the contract market and how to find contract works?
  5. I modified the jump function to include onFloor and changed gravity to 250 but it does not work jump: function() { if(this.dude.body.onFloor()) { this.dude.body.velocity.y = -300; } },
  6. Thanks, valueerror and hollowdoor, can you provide links for any such tutorial that covers everything? I have seen flappybird and platformer. I understand most of the code in phaser-examples but not all of it.
  7. I want the player to stop running after sometime, how do I do that?
  8. Hey everyone, I succeeded in adding animations to my character but it keeps running off the platform, I want it not to jump again until it has reached the platform as well. var game = new Phaser.Game(800,600,Phaser.AUTO,'gameDiv');var mainState = { preload: function() { game.load.spritesheet('dude','assets/dude.png',32,48); game.load.image('wh','assets/wallHorizontal.png'); }, create: function() { game.physics.startSystem(Phaser.Physics.ARCADE); game.stage.backgroundColor = '#71c5cf'; this.dude = game.add.sprite(400,330,'dude'); this.wh = game.add.sprite(380,380,'wh'); game.physics.arcade.enable(this.wh); this.wh.body.immovable = true; game.physics.arcade.enable(this.dude); this.dude.body.gravity.y = 1000; var spaceKey = game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); spaceKey.onDown.add(this.jump,this); var lcur = game.input.keyboard.addKey(Phaser.Keyboard.LEFT); lcur.onDown.add(this.lmove,this); var rcur = game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); rcur.onDown.add(this.rmove,this); game.physics.arcade.enable(this.dude); this.dude.animations.add('left', [0, 1, 2, 3], 10, true); this.dude.animations.add('turn', [4], 20, true); this.dude.animations.add('right', [5, 6, 7, 8], 10, true); }, update: function() { game.physics.arcade.collide(this.dude,this.wh,null,null,this); if(this.dude.inWorld == false) { game.state.start('main'); } }, jump: function() { this.dude.body.velocity.y = -300; }, lmove: function() { this.dude.body.velocity.x = -300; this.dude.animations.play('left'); }, rmove: function() { this.dude.body.velocity.x = 300; this.dude.animations.play('right'); }};game.state.add('main',mainState);game.state.start('main');
  9. Here is a game I wrote, I want to advance the level as soon as all the coins are collected. How can I do that? I can create another state but I don't know how to proceed from there var game = new Phaser.Game(1000,600, Phaser.AUTO, 'gameDiv');var mainState = { preload: function() { game.stage.backgroundColor = "#71c5cf"; game.load.image('ball','assets/fireball.png'); game.load.image('wv','assets/wallVertical.png'); game.load.image('wh','assets/wallHorizontal.png'); game.load.image('coin','assets/coin.png'); }, create: function() { game.physics.startSystem(Phaser.Physics.ARCADE); this.ball = this.game.add.sprite(100,250,'ball'); this.createworld(); game.physics.arcade.enable(this.ball); this.ball.body.gravity.y = 1000; var spacekey = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); spacekey.onDown.add(this.jump,this); var lkey = this.game.input.keyboard.addKey(Phaser.Keyboard.LEFT); lkey.onDown.add(this.lmove,this); var rkey = this.game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); rkey.onDown.add(this.rmove,this); this.score = 0; this.labelScore = this.game.add.text(30, 90, "", { font: "30px Arial", fill: "#ffffff" }); this.labelScore.text = this.score; }, update: function() { game.physics.arcade.collide(this.ball,this.walls); game.physics.arcade.collide(this.ball,this.coins,this.scoreincrease,null,this); if (this.ball.inWorld == false) { this.restartGame(); } }, restartGame: function() { game.state.start('main'); }, jump: function() { this.ball.body.velocity.y = -350;}, lmove: function() { this.ball.body.velocity.x = -200; }, rmove: function() { this.ball.body.velocity.x = 200; }, createworld: function() { this.walls = this.game.add.group() this.walls.enableBody = true; game.add.sprite(150,150,'wv',0,this.walls); game.add.sprite(170,180,'wh',0,this.walls); game.add.sprite(170,480,'wh',0,this.walls); game.add.sprite(450,480,'wh',0,this.walls); game.add.sprite(650,150,'wv',0,this.walls); game.add.sprite(450,180,'wh',0,this.walls); this.walls.setAll('body.immovable',true); this.coins = this.game.add.group(); this.coins.enableBody = true; game.add.sprite(10,10,'coin',0,this.coins); game.add.sprite(10,60,'coin',0,this.coins); game.add.sprite(30,10,'coin',0,this.coins); game.add.sprite(30,60,'coin',0,this.coins); }, scoreincrease : function(ball,coins) { this.score += 20; this.labelScore.text = this.score; coins.kill(); } };game.state.add('main',mainState);game.state.start('main');
  10. This is a small game I made, I need the coins to disappear as soon as the player touches them. I tried giving the coins high velocity so they can move away but that does not work very well. var game = new Phaser.Game(1000,600, Phaser.AUTO, 'gameDiv');var mainState = { preload: function() { game.stage.backgroundColor = "#71c5cf"; game.load.image('ball','assets/fireball.png'); game.load.image('wv','assets/wallVertical.png'); game.load.image('wh','assets/wallHorizontal.png'); game.load.image('coin','assets/coin.png'); }, create: function() { game.physics.startSystem(Phaser.Physics.ARCADE); this.ball = this.game.add.sprite(100,250,'ball'); this.createworld(); game.physics.arcade.enable(this.ball); this.ball.body.gravity.y = 1000; var spacekey = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); spacekey.onDown.add(this.jump,this); var lkey = this.game.input.keyboard.addKey(Phaser.Keyboard.LEFT); lkey.onDown.add(this.lmove,this); var rkey = this.game.input.keyboard.addKey(Phaser.Keyboard.RIGHT); rkey.onDown.add(this.rmove,this); this.score = 0; this.labelScore = this.game.add.text(30, 90, "", { font: "30px Arial", fill: "#ffffff" }); this.labelScore.text = this.score; }, update: function() { game.physics.arcade.collide(this.ball,this.walls); game.physics.arcade.collide(this.ball,this.coins,this.scoreincrease,null,this); game.physics.arcade.collide(this.ball,this.coins,this.coingoes,null,this); if (this.ball.inWorld == false) { this.restartGame(); } }, restartGame: function() { game.state.start('main'); }, jump: function() { this.ball.body.velocity.y = -350;}, lmove: function() { this.ball.body.velocity.x = -200; }, rmove: function() { this.ball.body.velocity.x = 200; }, createworld: function() { this.walls = this.game.add.group() this.walls.enableBody = true; game.add.sprite(150,150,'wv',0,this.walls); game.add.sprite(170,180,'wh',0,this.walls); game.add.sprite(170,480,'wh',0,this.walls); game.add.sprite(450,480,'wh',0,this.walls); game.add.sprite(650,150,'wv',0,this.walls); game.add.sprite(450,180,'wh',0,this.walls); this.walls.setAll('body.immovable',true); this.coins = this.game.add.group(); this.coins.enableBody = true; game.add.sprite(10,10,'coin',0,this.coins); game.add.sprite(10,60,'coin',0,this.coins); game.add.sprite(30,10,'coin',0,this.coins); game.add.sprite(30,60,'coin',0,this.coins); }, scoreincrease : function() { this.score += 20; this.labelScore.text = this.score; }, coingoes : function() { this.coin.body.velocity.y = -10000; } };game.state.add('main',mainState);game.state.start('main');
  11. I am new to Phaser-Javascript, I can't figure out why this piece of code is not working var game = new Phaser.Game(400, 490, Phaser.AUTO, 'gameDiv'); var mainState = { preload: function() { game.stage.backgroundColor = "#71c5cf"; game.load.image('ball','assets/fireball.png'); }, create: function() { game.physics.startSystem(Phaser.Physics.ARCADE); this.ball = this.game.add.sprite(100,250,'ball'); game.physics.arcade.enable(this.ball); var spaceKey = this.game.input.keyboard.addKey(Phaser.Keyboard.SPACEBAR); spaceKey.onDown.add(this.jump, this); this.ball.body.gravity.y = 1000; }, update: function() { if (this.ball.inWorld == false) { this.restartGame(); } }, restartGame: function() { game.state.start('main'); }, jump: function() { this.bird.body.velocity.y = -350; }, }; game.state.add('main',mainState);game.state.start('main'); [\code]