Post by epikhbk1 on Apr 14, 2012 20:30:45 GMT -5
how can i make an enemy kill you?? this is wat i got so far..
; /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
; SPIKE
; /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
; =========================================================================================================
; Object_Spike_Create
; =========================================================================================================
; Creates a New Spike Object
Function Object_Spike_Create.tObject(x#, y#, z#, rx#=0, ry#=0, rz#=0)
o.tObject = New tObject
o\ObjType = OBJTYPE_SPIKE
o\Position = New tVector
o\Position\x# = x#
o\Position\y# = y#
o\Position\z# = z#
o\Entity = LoadMesh("Objects\Spike\Spike.b3d")
o\IValues[0] = LoadMesh("Objects\Quad.b3d", o\Entity)
EntityBlend o\IValues[0], 3
EntityFX o\IValues[0], 1+16
EntityTexture o\IValues[0], LoadTexture("Textures\Woosh.png")
EntityAlpha o\IValues[0], 0.0
TranslateEntity o\IValues[0], 0, 1, 0
o\FValues[0] = 0
ScaleEntity o\Entity, 1.5, 1.5, 1.5
TranslateEntity o\Entity, x#, y#, z#
TurnEntity o\Entity, rx#, ry#, rz#
Return o
End Function
; =========================================================================================================
; Object_Spike_Update
; =========================================================================================================
; Updates the Spike object
Function Object_Spike_Update(o.tObject, p.tPlayer, d.tDeltaTime)
If (Abs(EntityX(p\Objects\Entity) - o\Position\x) < 12.5) And (Abs(EntityY(p\Objects\Entity) - o\Position\y) < 12.5) And (Abs(EntityZ(p\Objects\Entity) - o\Position\z) < 12.5) Then
;If Not p\Motion\Ground Then PositionEntity p\Objects\Entity, (EntityX(p\Objects\Entity)*39 + o\Position\x#)/40, (EntityY(p\Objects\Entity)*39 + o\Position\y#)/40, (EntityZ(p\Objects\Entity)*39 + o\Position\z#)/40
If (Abs(EntityX(p\Objects\Entity) - o\Position\x) < 5.5) And (Abs(EntityY(p\Objects\Entity) - o\Position\y) < 5.5) And (Abs(EntityZ(p\Objects\Entity) - o\Position\z) < 5.5) Then
; Add to ring counter
Game\Gameplay\Lives = Game\Gameplay\Lives + -1
Game\Gameplay\Score = Game\Gameplay\Score + -100000000
o\State = 1
o\FValues[0] = 0.0
; Transform the position vector to World space
TFormVector 0, 1, 0, o\Entity, 0
PositionEntity p\Objects\Entity, o\Position\x# + TFormedX()*4, o\Position\y# + TFormedY()*4, o\Position\z# + TFormedZ()*4
; Sproing!
PlaySound Sound_Spring
; Apply motion blur
PostEffect_Create_MotionBlur(0.0)
EndIf
EndIf
If o\State = 1 Then
o\FValues[0] = o\FValues[0] + 0.05*d\Delta
ScaleEntity o\IValues[0], 1+o\FValues[0]*6, 3+o\FValues[0]*6, 1+o\FValues[0]*6
TurnEntity o\IValues[0], 0, 5*d\Delta, 0
EntityAlpha o\IValues[0], (1-o\FValues[0])*0.7
ScaleEntity o\Entity, 1.5, 1.5 + Sin (o\FValues[0]*180)*1.5, 1.5
If o\FValues[0] >= 1.0 Then
ScaleEntity o\IValues[0], 1, 1, 1
o\FValues[0] = 0
o\State = 0
ScaleEntity o\Entity, 1.5, 1.5, 1.5
EndIf
EndIf
End Function
but after his life goes to zero he wont die... ima see if i can script it in stage.bb or game.bb