Graphics3D 1280, 720
SetBuffer BackBuffer()
Type medkit
Field nesh
Field x#
Field y#
Field z#
End Type
cam = CreateCamera()
cube_tx = LoadTexture("textures\texture2.jpg")
plane = CreatePlane()
PositionEntity plane, 0, -1, 0
plane_tx = LoadTexture("textures\texture1.jpg")
EntityTexture plane, plane_tx
mk.medkit = New medkit
mk\nesh = CreateCube()
mk\x# = 0
mk\y# = 0
mk\z# = 5
EntityTexture mk\nesh, cube_tx
ScaleEntity mk\nesh, 0.5, 0.5, 0.5
PositionEntity mk\nesh, 0, 0, 5
lifes = 85
While Not KeyDown(1)
If KeyDown(17) Then TranslateEntity cam, 0, 0, 0.01 ;W
If KeyDown(31) Then TranslateEntity cam, 0, 0, -0.01 ;S
If KeyDown(30) Then TranslateEntity cam, -0.01, 0, 0 ;A
If KeyDown(32) Then TranslateEntity cam, 0.01, 0, 0 ;D
If KeyDown(203) Then TurnEntity cam, 0, 0.3, 0 ; <--
If KeyDown(205) Then TurnEntity cam, 0, -0.3, 0 ; -->
For mk.medkit = Each medkit
TurnEntity mk\nesh, 0, 1, 0
If EntityDistance(cam, mk\nesh) < 2 Then
lifes = lifes + 15
HideEntity mk\nesh
Delete mk
EndIf
Next
RenderWorld
Text 0, 0, lifes
Flip
Wend
End
Graphics3D 1280, 720
SetBuffer BackBuffer()
Type medkit
Field nesh
Field x#
Field y#
Field z#
End Type
cam = CreateCamera()
cube_tx = LoadTexture("textures\texture2.jpg")
plane = CreatePlane()
PositionEntity plane, 0, -1, 0
plane_tx = LoadTexture("textures\texture1.jpg")
EntityTexture plane, plane_tx
mk.medkit = New medkit
mk\nesh = CreateCube()
mk\x# = 0
mk\y# = 0
mk\z# = 5
EntityTexture mk\nesh, cube_tx
ScaleEntity mk\nesh, 0.5, 0.5, 0.5
PositionEntity mk\nesh, 0, 0, 5
lifes = 85
While Not KeyDown(1)
If KeyDown(17) TranslateEntity cam, 0, 0, 0.01 ;W
If KeyDown(31) TranslateEntity cam, 0, 0, -0.01 ;S
If KeyDown(30) TranslateEntity cam, -0.01, 0, 0 ;A
If KeyDown(32) TranslateEntity cam, 0.01, 0, 0 ;D
If KeyDown(203) TurnEntity cam, 0, 0.3, 0 ; <--
If KeyDown(205) TurnEntity cam, 0, -0.3, 0 ; -->
For mk.medkit = Each medkit
TurnEntity mk\nesh 0, 1, 0
If EntityDistance(cam, mk\nesh) < 2
lifes = lifes + 15
HideEntity mk\nesh
Delete mk
EndIf
Next
RenderWorld
Text 0, 0, lifes
Flip
Wend
End