public CBombard(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, float pdAngle, CActObj pFromObj, Vector3 pTo, int pisound, bool loop) : base(pThucHanh) { try { this.Name = pName; this.fromObj = pFromObj; this.SpriteObj = this.myThucHanh.Add1SpriteObj(texfile, pWidth, pHeight, 0, this.fromObj.Position, 0f); this.topos = pTo; if (this.topos.Z == 0f) { this.topos.Z = this.myThucHanh.myTerrain.getZ(this.topos.X, this.topos.Y); } this.StartTickCount = start; this.duration = pduration; this.speed = pspeed; this.interval = (int)(this.speed * 1000f); this.dAngle = pdAngle; this.rAngle = Geometry.DegreeToRadian(this.dAngle); this.StopTickCount = this.StartTickCount + this.duration; this.isound = pisound; this.soundloop = loop; } catch (Exception ex) { throw ex; } }
private void CreatExplode(string pName, string texfile, float pWidth, float pHeight, float pShiftZ, int start, int pduration, float pspeed, int pisound, bool loop) { this.Name = pName; this.SpriteObj = this.myThucHanh.Add1SpriteObj(texfile, pWidth, pHeight, 1, new Vector3(0f, 0f, 0f), -pHeight / 2f); this.SpriteObj.AutoTurn = 1; this.shiftZ = pShiftZ; this.StartTickCount = start; this.duration = pduration; this.speed = pspeed; if (this.speed < 1f) { this.speed = 1f; } this.texcount = 0; this.texs = this.myThucHanh.GetTexs(texfile); if (this.texs != null) { this.texcount = this.texs.Count; } if (this.texcount > 0) { this.StopTickCount = this.StartTickCount + this.duration; } else { this.StopTickCount = this.StartTickCount; } this.interval = (int)(1000f / this.speed); this.isound = pisound; this.soundloop = loop; }
public CSpriteObj Add1SpriteObj(string texfile, float pwidth, float pheight, int pVertical, Vector3 pPos, float pshiftZ) { CSpriteObj cSpriteObj = null; try { cSpriteObj = new CSpriteObj(this, pwidth, pheight, pVertical, texfile, pPos, pshiftZ); this.SpriteObjs.Add(cSpriteObj); } catch { } return(cSpriteObj); }
public CShootFrom(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, CActObj pFromObj, Vector3 pTo, int pisound, bool loop) : base(pThucHanh) { this.Name = pName; this.fromObj = pFromObj; this.SpriteObj = this.myThucHanh.Add1SpriteObj(texfile, pWidth, pHeight, 0, this.fromObj.Position, 0f); this.topos = pTo; if (pTo.Z == 0f) { this.topos.Z = this.myThucHanh.myTerrain.getZ(this.topos.X, this.topos.Y) - 0.2f; } this.StartTickCount = start; this.duration = pduration; this.speed = pspeed; this.tickcount = (int)(this.speed * 1000f); this.StopTickCount = this.StartTickCount + this.duration; this.from2 = new CTarget(); this.to2 = new CTarget(); this.isound = pisound; this.soundloop = loop; }
public CShoot(CThucHanh pThucHanh, string pName, string texfile, float pWidth, float pHeight, int start, int pduration, float pspeed, Vector3 pFromPos, Vector3 pTo, int pisound, bool loop) : base(pThucHanh) { this.Name = pName; this.frompos = pFromPos; this.SpriteObj = this.myThucHanh.Add1SpriteObj(texfile, pWidth, pHeight, 0, this.frompos, 0f); this.origtopos = pTo; if (this.origtopos.Z == 0f & this.frompos.Z == 0f) { this.NeedShiftZ = true; } if (this.origtopos.Z == 0f) { this.origtopos.Z = this.myThucHanh.myTerrain.getZ(this.origtopos.X, this.origtopos.Y); } this.StartTickCount = start; this.duration = pduration; this.speed = pspeed; this.StopTickCount = this.StartTickCount + this.duration; this.from2 = new CTarget(); this.to2 = new CTarget(); this.Calc2(); this.isound = pisound; this.soundloop = loop; }
public void RemoveSpriteObj(CSpriteObj pObj) { this.SpriteObjs.Remove(pObj); }