Collision Jousting

Blitz3D Forums/Blitz3D Beginners Area/Collision Jousting

Rabies(Posted 2007) [#1]
Hi
I'm trying to make a basic jousting game.
However I'm having some problem with the collision.
Thanks for your time.




Graphics3D 800,600

Const CUBE_COL=1
Const SPHERE_COL=2

SetBuffer BackBuffer()

camera=CreateCamera()
CameraViewport camera,0,0,800,600
PositionEntity camera,0,0,-5

light=CreateLight()

cube=CreateCube()
PositionEntity cube,-5,0,5
EntityColor cube,70,80,190
EntityType cube,CUBE_COL

sphere=CreateSphere(12)
PositionEntity sphere,5,0,5
EntityColor sphere,170,80,90
EntityType sphere,SPHERE_COL

Collisions SPHERE_COL,CUBE_COL,3,1
Collisions CUBE_COL,SPHERE_COL,3,1

While Not KeyHit(1)

If KeyDown(30) MoveEntity sphere,-0.02,0,0

If KeyDown(31) MoveEntity Cube,0.02,0,0

UpdateWorld
RenderWorld

If EntityCollided(sphere,1) Then
Text 370,60,"sphere Collided !"
EndIf

If EntityCollided(cube,2) Then
Text 370,80,"Cube Collided !"
EndIf

Text 300,40,"Use (A) and (S) keys to move."
Text 335,500," Collision Demo "
Flip

Wend

End


Yo! Wazzup?(Posted 2007) [#2]
Hmmm... I'll check this out.

EDIT: Wait... It works perfectly for me. What exactly do you want it to do?


Rabies(Posted 2007) [#3]
Wow that was quick.
Thanks alot.


Yo! Wazzup?(Posted 2007) [#4]
Thanks a lot for what? All I did was tell you it was working perfectly.
Oh, and nice homepage ;)


Rabies(Posted 2007) [#5]
What hapening for me is that if you move the sphere
the text comes up for both the cube and the sphere.
but if you move cube the text for just the cube prints to screen.
I want it so that only one will print to the screen.
not both.


Rabies(Posted 2007) [#6]
Your posting faster then I can write lol


Yo! Wazzup?(Posted 2007) [#7]
What hapening for me is that if you move the sphere
the text comes up for both the cube and the sphere.


Right... I noticed That...
Your posting faster then I can write lol


Yeah... I'm surprised I can type this fast. I can't seem to get my hands in the right position though...


Rabies(Posted 2007) [#8]
I was wondering do I need to make some kind of timer?


Yo! Wazzup?(Posted 2007) [#9]
I have no idea.


b32(Posted 2007) [#10]
You could use ResetEntity:



Rabies(Posted 2007) [#11]
Thanks for all your help. I'll give it a try.
Sorry it took so long for me
to reply.