• Content Count

  • Joined

  • Last visited

About SpyCrab13

  • Rank

Recent Profile Visitors

718 profile views
  1. So I'm creating my player object and setting up some animations for him player = game.add.sprite(-40, game.world.height - 97, "DoomGuy"); player.animations.add("walk"); player.animations.play("walk", 4, true); player.anchor.setTo(0.5, 0.6); player.scale.setTo(0.7, 0.7); game.camera.follow(player); game.physics.arcade.enable(player); player.body.gravity.y = 680; player.body.collideWorldBounds = true; then later on say when the player is killed by an enemy or completes the level i want him to reset back to spawn and kill him so that i can display a score and i do this with thise line player.reset().kill();
  2. Hey all! I'm having an issue where i'm trying to reset the player sprite, but it doesn't do anything, and the console yields no errors and i know i'm trying to reset the right thing. I recently grabbed a copy of Phaser 2.5, and yet if i switch back to the older phaser i was using (2.4.4) the reset i have works correctly. I'm a little stumped on what I'm missing here, any help would be appreciated!
  3. I've done a little research and i've found a window.atob method that should decode base64 and eliminate any problems. The issue is, for whatever reason it's finding an invalid character somewhere in my JSON? And the issue with my map is its already base64 so i believe i'd have to redo it to get it to CSV format, would i be better off doing that or is there another way?
  4. Alright, dumb question since I don't know Tiled that well, how do i prevent it from being encoded when i export it?
  5. Hello all! I am trying to create a Tiled map for a little sidescrolling game i'm making, and I've followed the Phaser and Tiled documentation, but I for whatever reason cannot get the map imported correctly. I'm using Phaser v2.4.4, and one of the errors I'm getting is "Phaser.Tileset - image tile area is not an even multiple of tile size", and through a series of tests I found that my tilemap isn't even loading in which is probably the main reason for my issues. I have it in the preload (game.load.tilemap('Doom_Map', 'js/Doom_Map.json', null, Phaser.Tilemap.TILED_JSON); ) and in the create function (map = game.add.tilemap('Doom_Map');) but it seems to die out here. Any help or ideas would be appreciated!
  6. SpyCrab13

    Enemy respawn?

    Changing the line to demons still does not appear to work, i tried changing both cases of it to demons, EnemyDemon etc, but still was not able to get any results, except for the one sprite that does work was somehow flipped upside down by this?
  7. SpyCrab13

    Enemy respawn?

    Update: I did something a little different "function EnemyDemon() { var x = game.world.randomX; var y = game.world.randomY; demon = game.add.sprite(x, y, "demon"); demon.anchor.setTo(0.5, 0.5); game.physics.arcade.enable(demon); demon.body.allowRotation = false; demon.body.collideWorldBounds = true; } function create() { var enemiesTotal = 40; demons = []; for (var index = 0; index < enemiesTotal; index++) { demons.push(new EnemyDemon(index, game, demon)); } } function update() { demon.rotation = game.physics.arcade.moveToObject(demon, player, 200); } " and this causes a mess of sprites to appear on screen, but only one of them actually chases after my player, any idea what i should do?
  8. SpyCrab13

    Enemy respawn?

    Is there a way to call on an enemies state when the enemy.kill(); line is run, and use it to cause eemies to respawn and have their speed increased?
  9. Hey another quick question, is there some kind of state i can call on when an enemy is killed that i could im plement later? For example, when the enemy is killed, is there something along the lines of an "enemy.dead" state i can use?
  10. Hey all! Sorry for the radio silence, i figured it out, the overlap and collission handlers didn't want to play nice so i merged them into one line ( game.physics.arcade.collide(demon, bullets, killDemon, null, this); ) and that worked perfectly! Next up im going to be trying to make a loop that will spawn a new enemy every time i kill the one, and (provided i can find a way) have every additional enemy spawned be faster, and maybe have a random scale as compared to the last one spawned But, thanks to everyone who posted and helped me out! Your all awesome!
  11. Yep the killDemon (should) be running, and i'm using verson 2.4.4, i did notice i am using the min version of it, will that end up making a huge difference? Other than that, no errors in the console and i ran it through js hint, and there are no semi colons or anything too obvious missing, i'll keep hacking at it see if i can find something
  12. Yeah, no change in the results either way, and i have the bullets group defined as such under the create function //Bullets bullets = game.add.group(); bullets.enableBody = true; bullets.createMultiple(1, "bullet"); bullets.setAll("checkWorldBounds", true); bullets.setAll("outOfBoundsKill", true); //Bullet physics game.physics.arcade.enable(bullets); Its kind of odd to, i have a seperate function to kill the player whenever the demon touches him, and that works just fine, I've tried to copy the basic format of this function as well but with no result
  13. This is what i have so far related to all that, I'm a bit new to this as well so if you have any suggestions i'll take them! function update() { game.physics.arcade.overlap(bullets, demon, killDemon, null, this); //Enables bullets to hit demon game.physics.arcade.collide(demon, bullets); game.physics.arcade.collide(bullets, demon); } function killDemon (bullet, demon) { demon.kill(); scoreText += 10; }
  14. So i managed to get my player to shoot, but every time i shoot my enemy the bullets just kind of bounce off him, and neither the kill or destroy functions are working for me. Any ideas on what i can do?