У меня есть спрайт, и я установил его скорость y
на 200, чтобы он двигался вниз.Спрайт перемещается заикается много случайно
Спрайт отлично перемещается, за исключением того, что иногда он заикается много. В других случаях он шелковистый. Его как fps падает до 20.
Как остановить это заикание?
Ниже мой код, и вы можете try it live here
var SimpleGame = (function() {
function SimpleGame() {
this.game = new Phaser.Game(800, 400, Phaser.AUTO, 'content', { preload: this.preload, create: this.create, update: this.update });
}
SimpleGame.prototype.preload = function() {
this.game.load.image('logo', 'Sprites/icon.png');
};
SimpleGame.prototype.create = function() {
//Create Sprite
this.speed = 133;
this.game.stage.backgroundColor = 0xffffff;
this.logo = this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, 'logo');
this.logo.position.set(200, 50);
this.game.physics.arcade.enable(this.logo);
//Set velocity
this.logo.body.velocity.y = this.speed;
};
return SimpleGame;
})();
window.onload = function() {
var game = new SimpleGame();
};
Его не веб-сервер. Phaser - это Javascript, который запускается в вашем браузере. Вся память Phaser находится в вашем веб-браузере. Не сервер. Но спасибо за попытку помочь – Krimson
Также спасибо за тестирование на других компьютерах :) Возможно, это просто моя – Krimson