04-15-2024, 04:16 PM
(04-15-2024, 12:48 AM)johnno56 Wrote: Ok. This is a VERY crude Lander test. It uses "pixeli()" for collision with the Landing Pad and normal AABB for the ground...
I would appreciate an examination of how I have implemented the pixeli command and suggest any and all corrections.
Note: The ship can land from beneath the pad... Not an error. The landing pad (except for a concept level) is always on the ground.
The usual controls: Arrow keys.
Note: BOTH landing struts MUST contact the pad.
Watch your landing velocity.
I would create a variabe,
Code:
visible padColor = RGB(255, 255, 0)
, and instead of
Code:
if alpha(getPixel) = 255 and red(getPixel) = 255 and green(getPixel) = 255 and blue(getPixel) = 0
if alpha(getPixel2) = 255 and red(getPixel2) = 255 and green(getPixel2) = 255 and blue(getPixel2) = 0
, just write:
Code:
if getPixel = padColor and getPixel2 = padColor
Works nice anyhow