| Mirage Source http://miragesource.net/forums/ |
|
| could use some help on my sprites http://miragesource.net/forums/viewtopic.php?f=201&t=823 |
Page 1 of 1 |
| Author: | Forte [ Mon Dec 11, 2006 12:39 am ] |
| Post subject: | could use some help on my sprites |
Recently i added 64x64 sprites. They work fine but for some reason when I'm on the Min X of the map. and i move right once, the character dosnt blit until on the next tile. So like, while passing between tiles he dosnt blit until on the next tile completely. This only happens while on the min x. if anybody can help me solve this please post. thanks |
|
| Author: | Robin [ Mon Dec 11, 2006 4:41 pm ] |
| Post subject: | |
show us you 'bltplayer' sub. |
|
| Author: | Forte [ Mon Dec 11, 2006 10:20 pm ] |
| Post subject: | |
Code: Private Sub BltPlayer(ByVal Index As Long) there it is.
Dim Anim As Byte Dim X As Long, Y As Long ' Only used if ever want to switch to blt rather then bltfast With rec_pos .top = GetPlayerY(Index) * PIC_Y + Player(Index).YOffset .Bottom = .top + PIC_Y .Left = GetPlayerX(Index) * PIC_X + Player(Index).XOffset .Right = .Left + PIC_X End With ' Check for animation Anim = 0 If Player(Index).Attacking = 0 Then Select Case GetPlayerDir(Index) Case DIR_UP Anim = 0 If (Player(Index).YOffset < PIC_Y / 3) Then Anim = 1 ElseIf (Player(Index).YOffset > PIC_Y / 3) And ((Player(Index).YOffset > PIC_Y / 3 * 2)) Then Anim = 2 End If Case DIR_DOWN Anim = 1 If (Player(Index).YOffset < PIC_X / 4 * -1) Then Anim = 0 If (Player(Index).YOffset < PIC_X / 2 * -1) Then Anim = 2 Case DIR_LEFT Anim = 0 If (Player(Index).XOffset < PIC_Y / 3) Then Anim = 1 ElseIf (Player(Index).XOffset > PIC_Y / 3) And ((Player(Index).XOffset > PIC_Y / 3 * 2)) Then Anim = 2 End If Case DIR_RIGHT Anim = 0 If (Player(Index).XOffset < PIC_Y / 4 * -1) Then Anim = 1 If (Player(Index).XOffset < PIC_Y / 2 * -1) Then Anim = 2 End Select Else If Player(Index).AttackTimer + 500 > GetTickCount Then Anim = 2 End If End If ' Check to see if we want to stop making him attack With Player(Index) If .AttackTimer + 1000 < GetTickCount Then .Attacking = 0 .AttackTimer = 0 End If End With rec.top = (Player(Index).Sprite) * 64 + 32 rec.Bottom = rec.top + 32 rec.Left = (Player(Index).Dir * 3 + Anim) * 64 rec.Right = rec.Left + 64 X = Player(Index).X * 32 + sx - 16 + Player(Index).XOffset Y = Player(Index).Y * 32 + sx + Player(Index).YOffset If Y < 0 Then rec.top = (Player(Index).Sprite) * 64 + 32 rec.Bottom = rec.top + 32 Y = Player(Index).YOffset + sx End If If X < 0 Then rec.Left = (Player(Index).Dir * 3 + Anim) * 64 + 16 rec.Right = rec.Left + 48 X = Player(Index).XOffset End If If X > MAX_MAPX * 32 Then rec.Left = (Player(Index).Dir * 3 + Anim) * 64 rec.Right = rec.Left + 48 X = MAX_MAPX * 32 + sx - 16 + Player(Index).XOffset End If Call DD_BackBuffer.BltFast(X - (NewPlayerX * PIC_X) - NewXOffset, Y - (NewPlayerY * PIC_Y) - NewYOffset, DD_SpriteSurf, rec, DDBLTFAST_WAIT Or DDBLTFAST_SRCCOLORKEY) End Sub |
|
| Author: | Lea [ Sat Dec 16, 2006 6:21 pm ] |
| Post subject: | |
Cleaned and reopened by request. Play nice. |
|
| Page 1 of 1 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|