Ooops
January 26, 2021, 06:39:11 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
»
Algorithms
»
[bb] Pushing Objects by Neochrome [ 1+ years ago ]
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: [bb] Pushing Objects by Neochrome [ 1+ years ago ] (Read 552 times)
BlitzBot
Jr. Member
Posts: 1
[bb] Pushing Objects by Neochrome [ 1+ years ago ]
«
on:
June 29, 2017, 12:28:42 AM »
Title :
Pushing Objects
Author :
Neochrome
Posted :
1+ years ago
Description :
Basically i came up with this idea after playing unreal! it works!!!
this is a snippet from my game but its so easy i thought id share it, Its very basic so there are some things i haven
Code :
Code: BlitzBasic
(
I let this code free
)
[
codebox
]
If
lpEnvpushable=
True
;translateentity lpEnvmodel,0,-.1,0
z =
EntityCollided
(
ThisActor, coll_objects
)
If
z = lpEnvmodel
i=
1
; Calculate bounce:
; Get the normal of the surface which the entity collided with.
Nx# =
CollisionNX
(
ThisActor%, i
)
Ny# =
CollisionNY
(
ThisActor%, i
)
Nz# =
CollisionNZ
(
ThisActor%, i
)
vy# =
VectorYaw
(
-nx, -ny, -nz
)
tfm_z# =
Cos
(
vy#
)
/
5
tfm_x# = -
Sin
(
vy#
)
/
5
tfm_y# =
VectorPitch
(
-nx, -ny, -nz
)
If
Abs
(
tfm_y
)
<
60
Then
TranslateEntity
lpEnvmodel,tfm_x,
0
,tfm_z
End If
End If
[
/codebox
]
Comments :
Regular K(Posted 1+ years ago)
I dont have B3D, so I havnt tested it out but I think this function would be great if someone could translate it to 2D!?
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
SyntaxBomb - Indie Coders
»
Languages & Coding
»
Blitz Code Archives
»
Algorithms
»
[bb] Pushing Objects by Neochrome [ 1+ years ago ]
SimplePortal 2.3.6 © 2008-2014, SimplePortal