PDA

Click to See Complete Forum and Search --> : My Senior Project


MidgetsBro
Nov 25th, 2001, 03:24 AM
Here is what I have so far for my physical project. Comments are welcome, and suggestions are needed. I dunno what else to add...

peet
Nov 25th, 2001, 04:59 AM
I get some err.

Line 41: Property Picture in picFight had an invalid file reference.
Line 82: Property Picture in picCharacter had an invalid file reference.
Line 128: Property Picture in picTiles had an invalid file reference.
Line 168: Property Picture in picSign had an invalid file reference.
Line 41: Property Picture in picFight had an invalid file reference.
Line 82: Property Picture in picCharacter had an invalid file reference.
Line 128: Property Picture in picTiles had an invalid file reference.
Line 168: Property Picture in picSign had an invalid file reference.

frmMain.log file ....

Sastraxi
Nov 25th, 2001, 08:59 AM
Just pop the pictures in where they should be (bigSign in Sign, Tiles in Tiles, etc...)

Sastraxi
Nov 25th, 2001, 09:00 AM
Here's a fixed MoveCharacter routine. Before, the character would move about 5-6 spaces until he stopped. This will make him only move one:Private Sub MoveCharacter()
If SpeedCount Mod 3 = 0 Then
'move the character
If Key(vbKeyUp) = True Then
'move the character up on plain grass
Key(vbKeyUp) = False
If MapArray(uCharacter.x, uCharacter.y - 1) = "G" Then
uCharacter.y = uCharacter.y - 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
Exit Sub
End If
'move the character up and fight monster
If MapArray(uCharacter.x, uCharacter.y - 1) = "M" Then
uCharacter.y = uCharacter.y - 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
End If
End If
If Key(vbKeyDown) = True Then
'move the character down on plain grass
Key(vbKeyDown) = False
If MapArray(uCharacter.x, uCharacter.y + 1) = "G" Then
uCharacter.y = uCharacter.y + 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
Exit Sub
End If
'move the character down and fight monster
If MapArray(uCharacter.x, uCharacter.y + 1) = "M" Then
uCharacter.y = uCharacter.y + 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
Key(vbKeyDown) = False
picFight.ZOrder 0
picFight.Visible = True
picFight.SetFocus
FightInit
End If
End If
If Key(vbKeyLeft) = True Then
'move the character left on plain grass
Key(vbKeyLeft) = False
If MapArray(uCharacter.x - 1, uCharacter.y) = "G" Then
uCharacter.x = uCharacter.x - 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
Exit Sub
End If
'move the character left and fight monster
If MapArray(uCharacter.x - 1, uCharacter.y) = "M" Then
uCharacter.x = uCharacter.x - 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
End If
End If
If Key(vbKeyRight) = True Then
Key(vbKeyRight) = False
'move character right on plain grass
If MapArray(uCharacter.x + 1, uCharacter.y) = "G" Then
uCharacter.x = uCharacter.x + 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
Exit Sub
End If
'move the character right and fight monster
If MapArray(uCharacter.x + 1, uCharacter.y) = "M" Then
uCharacter.x = uCharacter.x + 1
BitBlt picGameArea.hDC, uCharacter.x * 32, uCharacter.y * 32, 32, 32, picCharacter.hDC, 0, 0, vbSrcCopy
picGameArea.Refresh
End If
End If

'show information sign
If Key(13) = True And MapArray(uCharacter.x, uCharacter.y - 1) = "S" Then
DoSign uCharacter.x, uCharacter.y - 1
picSign.ZOrder 0
picSign.Visible = True
picSign.SetFocus
Key(13) = False
End If
End If

End SubI made them false once they had been validated so they wouldn't be again.

MidgetsBro
Nov 25th, 2001, 02:03 PM
Thanks Sastraxi. I knew I had to fix that, but I didn't think of that. I had the If SpeedCount Mod 3 = 0 going up in numbers to try to slow him down, but the way you mentioned works a lot better, and peet, do what sastraxi mentioned, put all the pictures back in their pictureboxes. I guess it got corrupted, or it lost the pictures along it's way across the big internet :).

Sastraxi
Nov 25th, 2001, 02:58 PM
Your FRX was referring to pictures that weren't there, although I thought they were STORED in the FRXes. Go figure.

MidgetsBro
Nov 25th, 2001, 07:11 PM
Originally posted by Sastraxi
Your FRX was referring to pictures that weren't there, although I thought they were STORED in the FRXes. Go figure.

I thought that too. At least I read that somewhere. Oh well, that's why I included the images, just incase something like that happened.