• Content Count

  • Joined

  • Last visited

About wamballa

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi I am converting a Phaser 2 game to Phaser 3 and I'm stuck. Really irritating me now. The code I am working on is here: https://github.com/wamballa/jetpac2019 All I want to do is create an animation inside a gameobject called Player. I create this player object in src/scenes/Level1.js with new Player() Inside the Player object ( src/object/player.js ) i used this.anims.create and then try to play it by pressing left with this.anims.play() but i get an error. There error i get is: phaser.js:108624 Uncaught TypeError: Cannot read property 'getFirstTick' of null Can anyone help me please? Thanks Stece
  2. Hi there, I've been searching for ages to figure out how to do bloom effects in my game. I'd just like to know if this is possible or not. I can see that glow effects are possible https://gamemechanicexplorer.com/#lightning-3 but have found nothing on bloom effects. I'd like to do something like in this game - http://godotengine.org/qa/23711/godot-3-shaders-replace-color-and-add-glow-effect I know I can bake the glow into the sprite image but wanted to see if there is a shader that can do this? Thanks Steve
  3. Wow. EUREKA! That is works great. I did need to put super(); before this.global...... and now it works perfectly. Thanks!!!!!!!!!!!!!
  4. Hi I've created a game which is pretty cool ( for me ) but I'm stuck now on the simplest of things. How do I run global variables across the different level states. the variables I want to use are; highscore, score, lives Where in the code do i declare these variables? I've tried a load of things but can't seem to crack it. https://github.com/wamballa/games/tree/master/arcade/category/jetpac3 Any help would be appreciatd and let me know if I need to explain more. Thanks
  5. Hi there How can I have fancy particlestorm trails coming out of by sprite bullets and do collision detection? I've managed to get the basic PS emitter example working. But there is no way of getting the emitter position or doing collision detection between the emitter and another object (that I know of) I've tried to put a sprite over the emitter but it's hard to match the velocities and stop the emitter when I want to kill the bullet. I've tried to create a sprite with a render texture but nothing happens. Also tried adding the emitter as a child. I presume I need to create a sprite and attach the emitter to it but am now stuck. Any help is much appreciated and code below. Thanks! var game = new Phaser.Game(400, 300, Phaser.AUTO, 'Particles', { preload: preload, create: create, update: update, render: render }); var manager = null; var emitter = null; var object; var bullet = { image: 'bullet', anchorX : 0.8, anchorY : 0.5, vy: -8.0, scale: 0.5, rotation: -90.0, emit: { name: 'data', value: 0.07 } }; var data = { lifespan: 6000, image: 'white', scale: 0.5, blendMode: 'ADD', hsv: { initial: 0, value: 359, control: 'linear' }, vx: { min: -0.5, max: 0.5 }, vy: { min: -1, max: -2 } }; var player; function preload() { game.load.script('particlestorm', './assets/particle-storm.min.js'); // game.forceSingleUpdate = true; game.load.image('bullet', './assets/bullet.png'); game.load.image('white', './assets/white.png'); game.load.image('player', './assets/turret.png'); } function create() { manager = this.game.plugins.add(Phaser.ParticleStorm); manager.addData('bullet', bullet); manager.addData('data', data); //emitter = manager.createEmitter(); emitter = manager.createEmitter(Phaser.ParticleStorm.RENDERTEXTURE); emitter.addToWorld(); //player = game.add.sprite ( 100, 100,emitter.renderer.renderTexture); player = game.add.sprite ( 100, 100, 'player'); game.physics.enable(player, Phaser.Physics.ARCADE); player.enableBody = true; //player.addChild(emitter); } function fire(pointer) { emitter.renderer.display.visible = true; console.log ("PointerX= "+pointer.x); player.reset (pointer.x,300); player.body.velocity.y = -500; emitter.emit('bullet', pointer.x, 300); } function update(){ game.input.onDown.add(fire, this); if (player.body.y < 50 ){ player.kill(); emitter.renderer.display.visible = false; } } function render() { game.debug.text('Click to fire', 32, 32); }