akwa6950

Members
  • Content Count

    3
  • Joined

  • Last visited

About akwa6950

  • Rank
    Newbie

Recent Profile Visitors

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

  1. Every time i put the create cursor in it gives this eror: Uncaught TypeError: Cannot read property 'index' of undefined at c.Animation.updateCurrentFrame (phaser.min.js:19) at c.Animation.play (phaser.min.js:19) at c.AnimationManager.play (phaser.min.js:19) This is the code i'm using: var game = new Phaser.Game(1200, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('sky', 'asset/sky.png'); game.load.image('ground', 'asset/ground.png'); game.load.image('burger', 'asset/burger.png'); game.load.spritesheet('dude', 'asset/dude.png'); } var player; var platforms; var cursors; function create() { game.physics.startSystem(Phaser.Physics.ARCADE); game.add.sprite(0, 0, 'sky'); platforms = game.add.group(); platforms.enableBody = true; var ground = platforms.create(0, game.world.height - 50, 'ground'); ground.scale.setTo(5, 5); ground.body.immovable = true; var ledge = platforms.create(700, 400, 'ground'); ledge.body.immovable = true; ledge = platforms.create(-100, 250, 'ground'); ledge.body.immovable = true; player = game.add.sprite(32, game.world.height - 150, 'dude'); game.physics.arcade.enable(player); player.body.bounce.y = 0.2; player.body.gravity.y = 300; player.body.collideWorldBounds = true; player.animations.add('left', [0, 1, 2, 3], 10, true); player.animations.add('right', [5, 6, 7, 8], 10, true); cursors = game.input.keyboard.createCursorKeys(); } function update() { game.physics.arcade.collide(player, platforms); player.body.velocity.x = 0; if (cursors.left.isDown) { player.body.velocity.x = -150; player.animations.play('left'); } else if (cursors.right.isDown) { player.body.velocity.x = 150; player.animations.play('right'); } else { player.animations.stop(); player.frame = 4; } if (cursors.up.isDown && player.body.touching.down) { player.body.velocity.y = -350; } }
  2. Hello guys, I'm trying to get an image in my game, but it simply will not load. There's nothing wrong with my assets. this is the error i'm getting : Uncaught DOMException: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at file:///C:/Users/Gebruiker/Documents/school/jaar%202/kwartiel%201/project%20creative%20technology/phaser/assets/images/background.jpg may not be loaded. at PIXI.WebGLRenderer.updateTexture. Could it be the size of the image?
  3. Hello guys, I'm just starting out with Phaser and i have an error, my image wil not load when using: var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create, update: update }); function preload() { game.load.image('background', 'assets/background.jpg'); } function create() { game.add.sprite(0, 0, 'background'); } function update() { } all i get is a little green box, what could it be? greetings