Caveman1217 Posted August 29, 2016 Share Posted August 29, 2016 I need help!! So i have been staring at example codes and tutorial for the past 4 hours and i still cant seem to get this thing to work. I am new to coding, but I have to learn in to keep up in my current job. If anyone has any suggestions or any pointers on how to make colliders work with this script I could use all the help i can get. var game = new Phaser.Game(728, 1280, Phaser.CANVAS, 'Bombs_Away', { preload: preload, create: create, update: update, render: render }); function preload() { game.load.atlas('assets', 'assets/Images/assets.png', 'assets/Images/assets.json', Phaser.Loader.TEXTURE_ATLAS_JSON_HASH); game.load.image('background', 'assets/Images/Background.png'); } function create() { game.physics.startSystem(Phaser.Physics.ARCADE); bg = game.add.sprite(0, 0, 'background'); bg.width = 728; bg.height = 1280; sprite3 = game.add.sprite (-35, -190, 'assets', 'healthframe.png'); sprite3.width = 300; //sprite1.hight = 5; herobase = game.add.sprite (0, 450, 'assets', 'herobase.png'); game.physics.enable(herobase, Phaser.Physics.ARCADE); bomb = this.game.add.sprite (50, 0, 'assets', 'bomb'); game.physics.enable( bomb, Phaser.Physics.ARCADE); bomb.body.velocity.y= 50 + Math.random() * 600; bomb.animations.add('fall', [0,1 ], 15, true); bomb.animations.play('fall'); game.add.text(20,30, 'SCORE:', { font: "40px Impact", fill: "#ffffff" }); } function update(){ } //function colliderHandler(obj1, obj2){ //} function render (){ } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.