2
ベクトルを使用してXNA / C#でスプライトを移動する
現在、C#言語を使用したXNAゲーム開発を検討しています。 メインのゲームハンドラーと「スプライト」クラスの2つのクラスがあります。以下は、いくつかの基本的な疑似コードで、問題を適切に説明していると思います。 Game.cs class game { sprite the_sprite; void update(time) { var mouse = mouse.state if(mouse.clicked) { this.the_sprite.moveTo(mouse.x, mouse.y) } this.the_sprite.update(time) base.update(time) } } Sprite.cs class sprite { vector2 location; vector2 move_to; void moveTo(x, y) { this.move_to = new vector2(x, y) } void update(time) { if(this.location.x > this.move_to.x /* (or …