Space Lander
#2
I like your lander design.

Some advice about Background:
1. make the background and take a snapshot of it, 
background_handle = _newimage(_width, _height, 32)
_putimage ,0, background_handle '  screen to snapshot

then in main loop
_putImage , background_handle, 0 'snapshot to screen
that way you don't have to worry about blanking out the last drawing of lander, you just overlay background and then draw lander in new place, way faster and more efficient.

2. Put more layers of background mountains in (or just do 1 layer), right now it looks like you are in a strange tunnel with only foreground and background.

3. On the ground you land on (or crash) add more Red or green or blue or (easier) just make one shade only different from the other color levels. Then for collision, check for that one color with POINT to see if lander feet are on level ground. BTW
_SOURCE background_handle
before you check POINT colors for "collision" with ground.

Here is some nice landscape layering:
Code: (Select All)
Screen _NewImage(640, 350, 32)
Dim k As _Unsigned Long
Color , _RGB32(30, 30, 60)
Do
    Cls
    DrawTerrain 100, 25, &HFF332211
    DrawTerrain 150, 20, &HFF443322
    DrawTerrain 200, 15, &HFF554433
    DrawTerrain 250, 10, &HFF665544
    DrawTerrain 300, 5, &HFF776655
    Sleep 5
Loop Until _KeyDown(27)

Sub DrawTerrain (h, modN, c As _Unsigned Long) ' modN for ruggedness the higher the less smooth
    For x = 0 To _Width
        If x Mod modN = 0 Then ' adjust mod number for ruggedness the higher the number the more jagged
            If h < 350 - modN And h > 50 + modN Then
                dy = Rnd * 20 - 10
            ElseIf h >= 350 - modN Then
                dy = Rnd * -10
            ElseIf h <= 50 + modN Then
                dy = Rnd * 10
            End If
        End If
        h = h + .1 * dy
        Line (x, _Height)-(x, h), c
    Next
End Sub
b = b + ...
Reply


Messages In This Thread
Space Lander - by james2464 - 09-03-2022, 01:22 AM
RE: Space Lander - by bplus - 09-03-2022, 11:34 PM
RE: Space Lander - by james2464 - 09-04-2022, 01:56 AM
RE: Space Lander - by james2464 - 09-04-2022, 05:16 PM
RE: Space Lander - by james2464 - 09-04-2022, 05:41 PM
RE: Space Lander - by bplus - 09-04-2022, 06:48 PM
RE: Space Lander - by james2464 - 09-04-2022, 07:24 PM
RE: Space Lander - by james2464 - 09-06-2022, 12:35 AM
RE: Space Lander - by OldMoses - 09-06-2022, 01:31 AM
RE: Space Lander - by johnno56 - 09-07-2022, 06:07 AM
RE: Space Lander - by james2464 - 09-07-2022, 11:19 PM
RE: Space Lander - by james2464 - 09-07-2022, 11:23 PM
RE: Space Lander - by bplus - 09-07-2022, 11:34 PM
RE: Space Lander - by james2464 - 09-07-2022, 11:48 PM
RE: Space Lander - by johnno56 - 09-08-2022, 05:10 AM
RE: Space Lander - by james2464 - 09-08-2022, 12:25 PM
RE: Space Lander - by johnno56 - 09-08-2022, 06:38 PM
RE: Space Lander - by james2464 - 09-11-2022, 11:28 PM
RE: Space Lander - by johnno56 - 09-12-2022, 04:06 AM
RE: Space Lander - by james2464 - 09-12-2022, 02:48 PM
RE: Space Lander - by james2464 - 09-14-2022, 08:13 PM
RE: Space Lander - by james2464 - 09-30-2022, 11:13 PM
RE: Space Lander - by TerryRitchie - 10-01-2022, 01:23 AM



Users browsing this thread: 1 Guest(s)