Revision 5256,
1.3 KB
checked in by mijoilmo, 8 years ago
(diff) |
Tein liikkumisen uudestaan. Outo bugi että lieska ei näy kun peruuttaa vaikka pitäisi periaatteessa koodin mukaan näkyä.
|
Line | |
---|
1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using Jypeli; |
---|
4 | using Jypeli.Assets; |
---|
5 | using Jypeli.Controls; |
---|
6 | using Jypeli.Effects; |
---|
7 | using Jypeli.Widgets; |
---|
8 | |
---|
9 | public class Player : PhysicsObject |
---|
10 | { |
---|
11 | GameObject thrusterEffect; |
---|
12 | public void rotate(double rotSpeed) |
---|
13 | { |
---|
14 | this.AngularVelocity = rotSpeed; |
---|
15 | } |
---|
16 | public void thrusterStart(double speed) |
---|
17 | { |
---|
18 | this.thrusterEffect.IsVisible = true; |
---|
19 | this.Push(Vector.FromLengthAndAngle(speed*800, this.Angle + Angle.RightAngle)); |
---|
20 | } |
---|
21 | public void thrusterEnd() |
---|
22 | { |
---|
23 | this.thrusterEffect.IsVisible = false; |
---|
24 | //if this.ids, enable ids |
---|
25 | } |
---|
26 | public Player() |
---|
27 | : base(40, 40) |
---|
28 | { |
---|
29 | this.Image = Proto236b.images["player"]; |
---|
30 | bool IDS = true; //inertial dampening system, katsotaan pistetäänkö ostettavaksi peliin |
---|
31 | if (IDS == true) |
---|
32 | { |
---|
33 | this.LinearDamping = 0.97; |
---|
34 | } |
---|
35 | else |
---|
36 | { |
---|
37 | this.LinearDamping = 1; |
---|
38 | } |
---|
39 | this.AngularDamping = 0.7; |
---|
40 | |
---|
41 | this.thrusterEffect = new GameObject(40,40); |
---|
42 | thrusterEffect.Image = Proto236b.images["player_thruster"]; |
---|
43 | thrusterEffect.IsVisible = false; |
---|
44 | thrusterEffect.Y -= 20; |
---|
45 | Add(thrusterEffect); |
---|
46 | } |
---|
47 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.