How do you push an object?

Blitz3D Forums/Blitz3D Beginners Area/How do you push an object?

Something simple would be to use the direction of the car and move the object B using this direction with MoveENtity. You could then implement some kind of inertia:

moving the car:

...
Moveentity car,0,0,speed
...

if crash:
rotateentity rock_pivot,0,entityyaw(car),0
rotateentity rock,0,0,0,1
rock_speed=speed
endif

somewhere else you'll update all objects that are in motion (other than cars):

if rock_speed>0 then
moveentity rock_pivot,0,0,rock_speed
rock_speed=rock_speed *0.9
if rock_speed< 0.05 then rock_speed=0
endif

Note rock_pivot is the parent of rock, You need it to be able to move the rock away from the car without to alter the rocks current rotation. Speed and rock_speed are floats. For simplicity you may use a type structure or arrays to hold all objects like rocks or things that may be pushed, So you'd have an array for all rock entities, their additional pivots, their speed, etc. so you could handle them in a FOR/NEXT loop by index easily.