home *** CD-ROM | disk | FTP | other *** search
- class Entity
- {
- var collide;
- var myname;
- var size;
- var x;
- var y;
- var z;
- var xv;
- var yv;
- var zv;
- var entity;
- static var ENTITY_ID = "entities";
- static var ENTITY_DEPTH = 0;
- function Entity(target, entityname, startx, starty, startz, startsize, collides)
- {
- Entity.ENTITY_DEPTH = Entity.ENTITY_DEPTH + 1;
- this.collide = collides;
- this.myname = entityname;
- this.size = startsize;
- this.x = startx;
- this.y = starty;
- this.z = startz;
- this.xv = 0;
- this.yv = 0;
- this.zv = 0;
- this.entity = target.attachMovie(Entity.ENTITY_ID,entityname + Entity.ENTITY_DEPTH,Entity.ENTITY_DEPTH);
- this.entity._x = this.x;
- this.entity._y = GameStage.GROUND_LEVEL + this.y / 3 - this.z;
- this.entity.myname = this.myname;
- this.entity.dead = false;
- }
- function getScreenX()
- {
- return this.entity._x;
- }
- function getScreenY()
- {
- return this.entity._y;
- }
- function getX()
- {
- return this.x;
- }
- function getXV()
- {
- return this.xv;
- }
- function getY()
- {
- return this.y;
- }
- function getZ()
- {
- return this.z;
- }
- function getS()
- {
- return this.size;
- }
- function nudge(xnudge, ynudge)
- {
- this.x += xnudge;
- this.y += ynudge;
- }
- function impulsenudge(xnudge, ynudge)
- {
- this.xv += xnudge;
- this.yv += ynudge;
- }
- function remove()
- {
- this.entity.removeMovieClip();
- }
- }
-