Rebound object of edge of screen?

Blitz3D Forums/Blitz3D Beginners Area/Rebound object of edge of screen?

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

A simple version. To add code use ...

{code}
My code goes here
{/code}

But change the {} for []

Stevie

global GW = graphicswidth()
global GH = graphicsheight()


[your code]

[before update player coords ]

CheckX# = PlayerX + delta_x
CheckY# = PlayerY + delay_y

if CheckX < 0 or CheckX > GW delta_x = - delta_x
if CheckY < 0 or CheckY > GH delta_y = - delta_y