nicwins

Members
  • Content count

    27
  • Joined

  • Last visited

  1. ***Also, why to I get 32 warnings for that texture_2d thing in virtual joystick?
  2. Hi, in my render function, I have the following: render: function() { this.game.debug.body(this.player); this.game.debug.body(this.redMonstarsGroup); }, Now, the player, has a little green box around him, however the monster (or the group of monsters) has nothing and I get a warning: " gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, texture.source);" HOW TO I GET A LITTLE GREEN DEBUG BODY ON A GROUP OF OBJECTS?
  3. I actually solved this with: sticker.frame = 0;
  4. Hi I have a spritesheet consisting of 2x images. When my player moves over the sprite I want it to change to the other image. I know it's probably very simple but I cannot do it. this.load.spritesheet('stickers','assets/images/stickers01.png', 76, 96, 2); //as you can see it has two indexes (0 & 1) And what is the link to see all the phaser syntax? that would help
  5. I have a follow up question if anybody can figure it out: Can you have some (not all!) of the frames in the enemy animation cause damage to the player?
  6. I did it with the following code: var animArray = data.animationFrames.split(','); for (a in animArray ) { animArray[a] = parseInt(animArray[a], 10); } If anybody wants to know how its done, just converts it from a string to an array of integers
  7. If I hard code an enemy... var enemyData = { health: 20, attack: 40, animationFrames: [1, 2, 3, 4, 3, 2, 1] } ... it animates fine through the enemy prefab. But if I load an object with the same properties from a Tiled map - IT WONT WORK! I know to convert the strings to numbers with: this.data.attack = +this.data.attack; But when I have an array, it doesn't seem to work
  8. I gotta go now... will continue this later. thanks SQULI!
  9. I'm not sure about using the game time, because what if I get the enemies to respawn?
  10. There's something wrong with the math there: this.game.physics.arcade.velocityFromAngle(anglesArray[(this.game.time.totalElapsedSeconds() % shootingDelay) % anglesLen], 100, newElement.body.velocity); I put in: this.game.physics.arcade.velocityFromAngle(90, 100, newElement.body.velocity); And it shoots
  11. hmm well, there was no velocity!??
  12. i'll check
  13. Ok, that sort of worked! But it doesn't utilize the anglesArray! It just divides the length into the timer amount
  14. Sorry! No that worked thanks! I'll try what you said now..
  15. What about the function?? RoboticdogGame.OrangeMonstars.prototype.shoot = function(x,y) { I tried x,y ... didn't take