• Content count

  • Joined

  • Last visited

About dthrasher90

  • Rank
    Advanced Member
  1. Yeah, just name, stats, etc. no need for sprites
  2. Is there an API out there that will create random NPCs built around predetermined specifications?
  3. The velocities in the above example work, but i cannot get it to update
  4. update: function(rg, dt1){ game.physics.arcade.collide(rg, dt1, this); //end update brackt }, // the below is in a separate file, called ona button press. function runPlayMiddle(){ playCount = +playCount; playCount += 1; console.log("playcount = ", playCount); if(playCount == 1){ var ct = game.add.sprite(220, 220, 'ct'); ct.scale.setTo(0.03); // this.game.physics.arcade.enable(ct, Phaser.Physics.ARCADE); } else{ var ct = game.add.sprite(newBallSpotx, 220, 'ct'); ct.scale.setTo(0.03); // this.game.physics.arcade.enable(ct, Phaser.Physics.ARCADE); } runningPlaysDownChecker(); Base43Defense(ct); var QBx = ct.x - 20; var QBy = ct.y; var qb = this.game.add.sprite(QBx, QBy, 'qb'); qb.scale.setTo(0.02); var RB1x = ct.x -70; var RB1y = ct.y; var rb1 = this.game.add.sprite(RB1x, RB1y, 'rb1'); rb1.scale.setTo(0.02); var spriteTextRB1 = game.add.text(RB1x, RB1y, 'RB1', { font: '9px Press Start 2P' }); var RGx = ct.x; var RGy = ct.y + 20; var rg = this.game.add.sprite(RGx, RGy, 'rg'); rg.scale.setTo(0.03); var spriteTextRG = game.add.text(RGx, RGy, 'RG', { font: '9px Press Start 2P' }); this.game.physics.arcade.enable(rg, Phaser.Physics.ARCADE); var RTx = ct.x; var RTy = rg.y + 20; var rt = this.game.add.sprite(RTx, RTy, 'rt'); rt.scale.setTo(0.03); var spriteTextRT = game.add.text(RTx, RTy, 'RT', { font: '9px Press Start 2P' }); this.game.physics.arcade.enable(rt, Phaser.Physics.ARCADE); var LGx = ct.x; var LGy = ct.y - 20; var lg = this.game.add.sprite(LGx, LGy, 'lg'); lg.scale.setTo(0.03); var spriteTextLG = game.add.text(LGx, LGy, 'LG', { font: '9px Press Start 2P' }); this.game.physics.arcade.enable(lg, Phaser.Physics.ARCADE); lg.body.velocity.x = + 25; var LTx = ct.x;
  5. is it possible to pass a sprite with an physics system from one function to another? Like i have spriteA with arcade physics enabled in file jsfile1.js. and I have a state in gamestate.js. How can I send that sprite with an active physics engine to the update function of gamestate.js
  6. is there a way to constantly check the sprite's x,y coordinates, so I can fire a callback when it crosses a certain area?
  7. hey guys, how do you set world bounds on a top down 2d game? I have an image I uploaded and I want to set the bounds to xy(700, 300), using arcade physics. What does that look like?
  8. nm, i have it figured out
  9. create: function(qb, wr1, wr2, wr3, ct, rg, rt, lg, lt, football){ var field = game.add.sprite(15, 50, 'field'); field.scale.setTo(1.1); field.anchor.setTo(0); game.physics.enable(field, Phaser.Physics.ARCADE); console.log(field); console.log("in Game Action State"); // console.log("GAS new spotws == ", newBallSpotx, newBallSpoty); Like is this correct?
  10. Is there a way to see if the body is correctly enabled on a spite. LIke should body in the console log say something other than null?
  11. is there a way for a sprite to continually update and follow another sprite? I cannot seem to figure out how to do this, every movement method isnt designed to update and change path
  12. can you chain movetobject events, like movetoobject().oncomplete(moveto another object).oncomplete( moveto another object) or something to that effect?
  13. update: function(dt1, WR1x, WR1y){ WR1x = +WR1x; WR1y = +WR1y; console.log(game.physics.arcade.angleToXY(dt1, WR1x, WR1y)); }, Is there a way i can get this to work with variables? WR1 is being tweened in another function, something like x: +500, i want to try to get other players to move towards him.
  14. Is there anyway to get a sprite to update and move towards another? After reading the docs, I ve found that moveToObject is a one shot deal. Any other ideas?
  15. I tried that, id didnt like it. So, I have a function that tweens a sprite to like x: +100 and y: + 100, I was trying to get moveToObject to essentilly follow that sprite, to make more of a dynamic feel.