Ball Bouncing Help

BlitzPlus Forums/BlitzPlus Programming/Ball Bouncing Help

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.

Depends how accurate you want to make it. I thought of a visually effective but physically inaccurate trick on the Amiga. I kept a hidden bitmap with the solid objects to be bounced off having colours corresponding to the directions normal to the walls. Say if a wall was angled 45 degrees upward to the right, I coloured the underlying bitmap red along its bouncing edge - blue if it was 45 degress down and so on. The little ball tested the colour of the hidden bitmap and if it found red it changed direction appropriately.

If you used only eight wall directions you could change the direction of an arbitrary velocity without any trig at all and, for a miniature golf game it was good enough and looked surprisingly realistic.

I suppose there is no need to dodge true calculation now as things are faster. It would probably still work though if you want something very quick and easy.