source: 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Player.cs @ 5264

Revision 5264, 1.4 KB checked in by mijoilmo, 6 years ago (diff)
Line 
1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9public 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    public override void Update(Time time)
48    {
49        if (this.Position.X>Level.Left){}
50        base.Update(time);
51    }
52}
Note: See TracBrowser for help on using the repository browser.