Jump to content

Search the Community

Showing results for tags 'phaser tile sprite cargame'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. hi im building car game , i want my car move around with no limits look to attached file the code is this.preload = function(){ game.load.image('redCar', 'assets/images/redCar.png'); game.load.image('picture2', 'assets/images/policCar.png'); game.load.image('land','assets/images/scorched_earth.png') }; this.create = function(){ game.world.setBounds(-3000, -3000, 4000, 4000); land = game.add.tileSprite(-3000, -3000, 4000, 4000, 'land'); //land.fixedToCamera = true; redCar = game.add.sprite(300, 500, 'redCar'); game.camera.follow(redCar); //redCar.anchor.setTo(0.5, 0.5); game.physics.enable(redCar, Phaser.Physics.ARCADE); redCar.body.drag.set(0.2); redCar.body.maxVelocity.setTo(400, 400); redCar.body.collideWorldBounds = true; redCar.body.allowRotation = false; redCar.anchor.setTo(0.5, 0.5); //redCar.body.drag.set(0.2); //redCar.body.maxAngular = 500; //redCar.body.angularDrag = 500; redCar.angle =90; cursors = game.input.keyboard.createCursorKeys(); //redCar.body.angularAcceleration = 0; }; this.update = function(){ if (currentSpeed > 0) { game.physics.arcade.velocityFromRotation(redCar.rotation, currentSpeed, redCar.body.velocity); } if (cursors.up.isDown) { currentSpeed += 5; if (currentSpeed>=500) {currentSpeed = 500}; }else{ if (currentSpeed>0) { currentSpeed -= 4; // if (currentSpeed<0) {currentSpeed=0}; }; }; if (cursors.right.isDown && currentSpeed >0) { redCar.angle += 2; //console.log(currentSpeed); }else if(cursors.left.isDown && currentSpeed >0) { redCar.angle -= 2; }; };
×
×
  • Create New...