# Object Velocity issue on different devices

## Recommended Posts

Hey,

So I am working on a car game and I have 1 issue with the speed at which car drops.
My friend who owns a IPhone s6 complains that on his device the cars drop too fast, while on my Samsung s7 edge the car seems to drop slow enough.
I dont know what might cause it.

My obstacle velocity is set to 1200;

``````// OBSTACLES vars
var obstacleSpeed = 1200;
var obstacleDelay = 400;
var platforms;
var score;
``````

And this is my Loop + update function

``````  	// OBSTACLES OF THE CAR
game.time.events.loop(obstacleDelay, function(){
var obstacleSpeed = 1200;
var obstacleDelay = 400;
for(var i = 0; i < 1; i++){
if(game.rnd.between(0, 1) == 1){
var obstacle = new Obstacle(game, i);
obstacle.scale.setTo(scaleRatio, scaleRatio);
}
}
});

// Game on touch move car
if (game.input.x < w / 2 ){
if( canMove && goleftonce == 2 || goleftonce == 1) {
canMove = false;
goleftonce++;
gorightonce--;
game.add.tween(car).to({ angle: -30}, 100, Phaser.Easing.Linear.None, true).onComplete.addOnce(function(){ game.add.tween(car).to({ angle: 0}, 100, Phaser.Easing.Linear.None, true); canMove = true; }, this);
game.add.tween(car).to({x: car.x - w/3}, 100, Phaser.Easing.Linear.None, true);
}
}
else {
if( canMove && gorightonce == 2 || gorightonce == 1) {
canMove = false;
goleftonce--;
gorightonce++;
game.add.tween(car).to({ angle: 30}, 100, Phaser.Easing.Linear.None, true).onComplete.addOnce(function(){ game.add.tween(car).to({ angle: 0}, 100, Phaser.Easing.Linear.None, true); canMove = true; }, this);
game.add.tween(car).to({x: car.x + w/3}, 100, Phaser.Easing.Linear.None, true);
}
}
});
},
update: function() {
//  Collide the car and with the obstacles aka other cars
canMove = true;
countcars = 0;
goleftonce = 2;
gorightonce = 2;

game.state.start('gameover');
});
}
}

// Position where the obstacle spawns
Obstacle = function (game) {
var position = game.rnd.between(0, 2);
Phaser.Sprite.call(this, game, (w/3) * position + 130 , 0, "obstacle");
};

Obstacle.prototype = Object.create(Phaser.Sprite.prototype);
Obstacle.prototype.constructor = Obstacle;

Obstacle.prototype.update = function() {
this.body.velocity.y = obstacleSpeed;
if(this.y > game.height){
countcars++;
score.setText("Score: " + countcars);
this.destroy();
}
};``````