January 16, 2021, 05:19:35 AM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Home
Forum
Help
Search
Gallery
Login
Register
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Easy Collisions Example by Captain Wicker (crazy hillbilly) [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Easy Collisions Example by Captain Wicker (crazy hillbilly) [ 1+ years ago ] (Read 602 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Easy Collisions Example by Captain Wicker (crazy hillbilly) [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:43 AM »
Title :
Easy Collisions Example
Author :
Captain Wicker (crazy hillbilly)
Posted :
1+ years ago
Description :
An easy example of collision detection by me
Code :
Code: BlitzBasic
AppTitle
(
"Collisions Example"
)
Graphics3D
800
,
600
,
32
,
2
SetBuffer
BackBuffer
(
)
camera=
CreateCamera
(
)
light=
CreateLight
(
)
Const
entity_sphere=
1
Const
entity_sphere2=
2
sphere=
CreateSphere
(
32
)
PositionEntity
sphere,-.85,
0
,
5
sphere2=
CreateSphere
(
32
)
PositionEntity
sphere2,.85,
0
,
5
EntityType
sphere,entity_sphere
EntityType
sphere2,entity_sphere2
While
Not
KeyDown
(
1
)
EntityColor
sphere,
Rnd
(
255
)
,
Rnd
(
255
)
,
Rnd
(
255
)
MoveEntity
sphere,
0
,.1,
0
TurnEntity
sphere,
1
,
0
,
1
EntityColor
sphere2,
Rnd
(
255
)
,
Rnd
(
255
)
,
Rnd
(
255
)
MoveEntity
sphere2,
0
,.1,
0
TurnEntity
sphere2,
1
,
0
,-
1
Collisions
entity_sphere,entity_sphere2,
1
,
2
Collisions
entity_sphere2,entity_sphere,
1
,
2
If
EntityCollided
(
sphere,entity_sphere2
)
Then
RuntimeError
(
"Collisions Detected!!!"
)
If
EntityCollided
(
sphere2,entity_sphere
)
Then
RuntimeError
(
"Collisions Detected!!!"
)
UpdateWorld
RenderWorld
Flip
Wend
Comments :
Captain Wicker (crazy hillbilly)(Posted 1+ years ago)
Very Nicely Done if I do say so myself.
big10p(Posted 1+ years ago)
Why do you insist on spamming the code archives with pointless code?
Captain Wicker (crazy hillbilly)(Posted 1+ years ago)
It isn't pointless, It shows how simple it is to detect collisions. :PWhat's so wrong about a fellow doing some good for people struggling with collisions eh?
Rob the Great(Posted 1+ years ago)
<div class="quote"> What's so wrong about a fellow doing some good for people struggling with collisions eh? </div>Nothing's wrong with it, but this belongs in tutorials, not in the archives. The archives should be reserved for advanced or complicated processes that simplify a technique, usually in 1 to 2 line functions."Collisions" is a Blitz native command, and while you demonstrate its use effectively, it was not designed by you, and so this really doesn't belong in the archives.Instead, this should go in tutorials because you are showing how the Blitz system works.However, if you made your own custom Collisions system that is better or easier to use than Blitz's, the archives would be the perfect place to submit this.
Captain Wicker (crazy hillbilly)(Posted 1+ years ago)
Oops! I suppose so then ^^;
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Graphics
»
[bb] Easy Collisions Example by Captain Wicker (crazy hillbilly) [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal