//Call functions for player movement animations
function walkDown()
CreateSprite(1,1)
AddSpriteAnimationFrame ( 1, LoadImage ( "Down(1).png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Down(2).png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Down(3).png" ) )
AddSpriteAnimationFrame ( 1, LoadImage ( "Down(4).png" ) )
PlaySprite ( 1, 10, 1, 1, 4 )
DeleteSprite(7)
DeleteSprite(11)
DeleteSprite(15)
DeleteSprite(28)
endfunction
function walkUp()
CreateSprite(15,15)
AddSpriteAnimationFrame (15, LoadImage("Up(0).png"))
AddSpriteAnimationFrame (15, LoadImage("Up(1).png"))
AddSpriteAnimationFrame (15, LoadImage("Up(2).png"))
AddSpriteAnimationFrame (15, LoadImage("Up(3).png"))
PlaySprite(15,10,1,1,4)
DeleteSprite(1)
DeleteSprite(7)
DeleteSprite(11)
DeleteSprite(28)
endfunction
function walkLeft()
CreateSprite(7,7)
AddSpriteAnimationFrame ( 7, LoadImage ( "Left(1).png" ) )
AddSpriteAnimationFrame ( 7, LoadImage ( "Left(2).png" ) )
AddSpriteAnimationFrame ( 7, LoadImage ( "Left(3).png" ) )
AddSpriteAnimationFrame ( 7, LoadImage ( "Left(4).png" ) )
PlaySprite(7, 10, 1, 1, 4)
DeleteSprite(1)
DeleteSprite(11)
DeleteSprite(15)
DeleteSprite(28)
endfunction
function walkRight()
CreateSprite(11,11)
AddSpriteAnimationFrame (11, LoadImage("Right(0).png"))
AddSpriteAnimationFrame (11, LoadImage("Right(1).png"))
AddSpriteAnimationFrame (11, LoadImage("Right(2).png"))
AddSpriteAnimationFrame (11, LoadImage("Right(3).png"))
PlaySprite(11,10,1,1,4)
DeleteSprite(1)
DeleteSprite(7)
DeleteSprite(15)
DeleteSprite(28)
endfunction
//---------------------------------------------
//Down
if px > 215 and px < 265 and py > 745 and py < 795 and GetPointerState()
SetViewOffset(spritex , spritey+y#)
sy = sy + 3
SetSpritePosition(1,sx,sy)
//Up
elseif px > 215 and px < 265 and py > 680 and py < 735 and GetPointerState()
SetViewOffset(spritex , spritey-y#)
sy = sy - 3
SetSpritePosition(15,sx,sy)
//Left
elseif px > 151 and px < 205 and py > 745 and py < 795 and GetPointerState()
SetViewOffset ( spritex-x#, spritey )
sx = sx - 3
SetSpritePosition(7,sx,sy)
//Right
elseif px > 275 and px < 327 and py > 745 and py < 795 and GetPointerState()
SetViewOffset ( spritex+x#, spritey )
sx = sx + 3
SetSpritePosition(11,sx,sy)
endif
if px > 215 and px < 265 and py > 745 and py < 795 and GetPointerPressed()
walkDown()
elseif GetPointerReleased()
StopSprite(1)
endif
if px > 215 and px < 265 and py > 680 and py < 735 and GetPointerPressed()
walkUp()
elseif GetPointerReleased()
StopSprite(15)
endif
if px > 151 and px < 205 and py > 745 and py < 795 and GetPointerPressed()
walkLeft()
elseif GetPointerReleased()
StopSprite(7)
endif
if px > 275 and px < 327 and py > 745 and py < 795 and GetPointerPressed()
walkRight()
elseif GetPointerReleased()
StopSprite(11)
endif
So, this is probably the most absurd way to get player movement to function, "Poorly albeit", but it's what I was able to make heads and tails of. On the user interface there are up, down, left, and right arrows. When the program detects that the players mouse, or finger is in that area and is positively clicking, or tapping and holding, it moves said sprite in that direction. To create individual sprites for collisions would be an insurmountable task, and would likely take months of very fine tuning to get working correctly. It works fine for the borders, Top, Bottom, Left, and Right, but for the intricate details on the actual map. Trees, plants, house walls, chairs, tables, etc. If it's the only option, by golly I'll do it, but if there are other options, then I'm all for it.