Well, just playing around again and encountered another problem. The sprite movement system seems to be different to Classic too. Or, I have just become sloppy (again) in the last few weeks.
My problem:
The sprite will not postition its self correctly. I thought this would work to place the sprite in the middle of the X axis. But no avail.
PlayerX=Screen Width()/2
A similar problem applies to the sprite control.
The sprite just WILL NOT MOVE FROM THE TOP LEFT CORNER!
Oh well... Here's my code, help would be greatly apprieciated!
Rem Project: SpriteJumping
Rem Created: 06-07-2007 07:37:57 PM
Rem ***** Main Source File *****
`Set the sync
Sync on : Sync Rate 60
PlayerX=Screen width()*.5 `X position of the player sprite
PlayerY=Screen Height()*.25 `Y position of the player sprite
PlayerVelocity=0
PlayerAcc=1
WalkingLeft=1
WalkingRight=2
IdleLeft=3
IdleRight=4
`Sprite names
Hero=1
Gosub _loadmedia
DO
PlayerControl()
Sync
Loop
_loadmedia:
Load image "hero_walkL.jpg",1
Load image "hero_walkR.jpg",2
Load image "hero_idleL.jpg",3
Load image "hero_idleR.jpg",4
Load music "Hidden Fury.mid",1
`Setup this media
Loop music 1
Return
`Create Function
Function PlayerControl()
If Rightkey()=1
PlayerX=PlayerX+PlayerAcc
Endif
If Leftkey()=1
PlayerX=PlayerX-PlayerAcc
Endif
`Update Position
If PlayerAcc>0
Sprite 1,PlayerX,PlayerY,2
Else
Sprite 1,PlayerX,PlayerY,1
Endif
EndFunction
Thank You!!
Also, if someone could please help with the jumping calculations.