source: 2014/27/AleksanteriV/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Protokolla236TrueSurvivor/Enemy1.cs @ 5395

Revision 5339, 794 bytes checked in by mijoilmo, 6 years ago (diff)
RevLine 
[5307]1using System;
2using System.Collections.Generic;
3using Jypeli;
4using Jypeli.Assets;
5using Jypeli.Controls;
6using Jypeli.Effects;
7using Jypeli.Widgets;
8
9class Enemy1 : PhysicsObject
10{
11    Proto236b parent;
[5324]12    public Enemy1(Proto236b parent, double w, double h,Vector position)
[5307]13        : base(w, h)
14    {
15        this.parent = parent;
16        //ensimmäisenä parametrina on siis peli. voit tehdä enemyn tyylillä "new Enemy1(this, w, h)".
17
18        //image laitetaan esim:
19        //this.Image = parent.Images["vihu1_image"];
[5324]20        this.Position = position;
[5339]21        this.Animation = new Animation(parent.ImageLists["enemy1"]);
22        this.Animation.FPS = 10;
23        this.Animation.Start();
24        this.AngularDamping = 0.1;
[5307]25
[5324]26        parent.Add(this);
[5307]27    }
28}
Note: See TracBrowser for help on using the repository browser.