I'm having a major problem with this, probably because of the way i do collision. Basically I have a level that looks like this (don't mind me using text to give you an idea):
------------------------------------------------|(EMPTYSPACE)|--------------
------------------------------------------------|(EMPTYSPACE)|--------------
|
|
|
|
|
|
|
|
|
----------------------------------------------------------------------------
----------------------------------------------------------------------------
Here's my code:
Sync On : Sync Rate 0
Set Display Mode 640, 480, 32 : Hide Mouse
` Pre-buffer the game.
GoSub Variables
GoSub Graphics
Do
` Play through the levels.
GoSub Level01
Loop
` *** LOADING ROUTINES ***
Variables:
` Character status.
RexX = 20
RexY = 7
MoveLeft = 0
MoveRight = 1
Frame = 1
Return
Graphics:
Ink RGB(255,255,255), 0
Data "MEDIALEVELSLEVEL01.BMP"
Data "MEDIASPRITESREX_1.BMP"
Data "MEDIASPRITESREX_2.BMP"
Data "MEDIASPRITESREX_3.BMP"
` Add the image to memory.
For I = 1 to 4
Read FileName$
Load Image FileName$, I, 1
Next I
` Create sprites.
For I = 1 To 3
Sprite I, RexX, RexY, I+1
Set Sprite I, 0, 1
Next I
Return
` *** LEVEL ONE ***
Level01:
Do
` Paste the background.
Paste Image 1, 0, 0
` Check if the player is walking.
GoSub Walk
` Check collision.
` (EDGE OF SCREEN)
If RexX < 0 Then RexX = 0
If RexX > 580 Then RexX = 580
` (This is where i check to see if he's past that certain point
` so he can fall to the level below...he starts at the top left corner)
If RexX < 385 and RexY = 7 or RexX > 457 and RexY = 7 and Jumping = 0
RexY = 7
Else
If RexY < 230 and Jumping = 0Then RexY = RexY + 2
If RexY > 8 and RexY < 170 and RexX < 385 and Jumping = 0 Then RexX = 385
EndIf
Center Text 20, 20, "X: " + STR$(RexX)
Center Text 20, 40, "Y: " + STR$(RexY)
` Update the screen.
Sync
Loop
` *** ANIMATION AND WALKING CODE ***
Walk:
` Check keys being pressed.
If RightKey() = 1
` Position Rex.
MoveRight = 1
MoveLeft = 0
EndIf
If LeftKey() = 1
` Position Rex.
MoveRight = 0
MoveLeft = 1
EndIf
If RightKey() = 0 And LeftKey() = 0
` Rex is not moving.
MoveRight = 0
MoveLeft = 0
` Set correct animation.
Frame = 1
EndIf
` Paste the level sprite.
If MoveRight = 1
` Set animation.
Frame = Frame + 1
For I = 1 To 3
If Sprite Mirrored(I)=1 Then Mirror Sprite I
Next I
` Move rex.
RexX = RexX + 1
EndIf
If MoveLeft = 1
` Set animation.
Frame = Frame + 1
For I = 1 To 3
If Sprite Mirrored(I)=0 Then Mirror Sprite I
Next I
` Move rex.
RexX = RexX - 1
EndIf
` Animate rex.
If Frame < 16
Paste Sprite 1, RexX, RexY
Show Sprite 1
Hide Sprite 2
Hide Sprite 3
EndIf
If Frame > 16 and Frame < 31
Paste Sprite 2, RexX, RexY
Hide Sprite 1
Show Sprite 2
Hide Sprite 3
EndIf
If Frame > 31
Paste Sprite 3, RexX, RexY
Hide Sprite 1
Hide Sprite 2
Show Sprite 3
If Frame > 46 Then Frame = 1
EndIf
Return
I'm almost positive it's because of the way I did the collision, but argh, I just don't know of a more efficient way to do it! All I'm using for the level is a BMP. I have no clue how I would even begin to go about creating a map editor and load and read map files for collision (maybe i'm just not a creative enough programmer

). So I have no idea how to make him jump, except that I would make it that when you press control his Y coordinate is subtracted from until he reachs a certain point, in which case his Y coordinate would be added to until he reaches ground level.
So does anybody know how to solve my problem...no wait, better yet, does anybody know of any 2D DBPro tutorials???? Thank you