Quote: "My problem is, no matter what i do, i can't seem to get my Redd sprite to move on the x-axis. If you look at my comments, you'll see i tried using some variables. Earlier, i also tried using the Inc and Dec commands to no avail. I've looked at other posts like this but could not seem to solve the problem. Can anybody help?"
If you want to use the MOVE SPRITE command it works best if you use the ROTATE SPRITE command also. The MOVE SPRITE command bases the direction it travels on the current rotation of the sprite.
Rem ***** Included Source File *****
Sync On:Sync Rate 60
`*****TYPES*****
Type HealthPool
health as integer
Endtype
Type Movement
x as float
y as float
xspeed as float
yspeed as float
EndType
`*****Various Variables (Alliteration! HA HA)*****
Global Redd as HealthPool:Global ReddMovement as Movement
Global Bludd as HealthPool:Global BluddMovement as Movement
Disable Escapekey
Backdrop On
Color Backdrop rgb(100,100,0)
`*****Image Loading*****
`Load Bludd Sprites
Load Image "EP/Blue Sprites/Blue(Left)_01.png", 1, 1
Load Image "EP/Blue Sprites/Blue(Left)_02.png", 2, 1
Load Image "EP/Blue Sprites/Blue(Left)_03.png", 3, 1
Load Image "EP/Blue Sprites/Blue(Left)_04.png", 4, 1
Load Image "EP/Blue Sprites/Blue_01.png", 5, 1
Load Image "EP/Blue Sprites/Blue_02.png", 6, 1
Load Image "EP/Blue Sprites/Blue_03.png", 7, 1
Load Image "EP/Blue Sprites/Blue_04.png", 8, 1
`Load Redd Sprites
Load Image "EP/Red Sprites/Red(Left)_01.png", 9, 1
Load Image "EP/Red Sprites/Red(Left)_02.png", 10, 1
Load Image "EP/Red Sprites/Red(Left)_03.png", 11, 1
Load Image "EP/Red Sprites/Red(Left)_04.png", 12, 1
Load Image "EP/Red Sprites/Red_01.png", 13, 1
Load Image "EP/Red Sprites/Red_02.png", 14, 1
Load Image "EP/Red Sprites/Red_03.png", 15, 1
Load Image "EP/Red Sprites/Red_04.png", 16, 1
`Load Power-Ups
Load Image "EP/Etc/Power_01.png", 17, 1
Load Image "EP/Etc/Power_07.png", 18, 1
`Load Bullets
Load Image "EP/Blue Sprites/Ice Ball.png", 19, 1
Load Image "EP/Red Sprites/Fire Ball.png", 20, 1
`Create Redd *****Sprite*****
`Initial X + Y
ReddMovement.x = 200
`ReddMovement.y = 600
`ReddMovement.xspeed = 1
`ReddMovement.yspeed = 1
Sprite 1, 200, 600, 13
Set Sprite Priority 1, 1
Offset Sprite 1, Sprite Width(1)/2, Sprite Height(1)/2
Y# = 0
`Create Bludd *****Sprite*****
BluddMovement.x = 1400
`BluddMovement.y = 600
`ReddMovement.xspeed = 1
`ReddMovement.yspeed = 1
Sprite 2, 1400, 600, 1
Set Sprite Priority 2, 2
`Offset Sprite 2, Sprite Width(2)/2, Sprite Height(2)/2
`*****Start Do Loop*****
Do
`*****Redd Movement*****
`Move Forward
If keystate(17) = 1 then Move Sprite 1, 5
`Move Backward
If keystate(31) = 1 then Move Sprite 1, -5
`Rotate Right
If keystate(32) = 1
` Increase the angle
inc Angle,5
` Rotate the sprite to the angle
rotate sprite 1,wrapvalue(Angle)
endif
`Rotate Left
If keystate(30) = 1
` Decrease the angle
dec Angle,5
` Rotate the sprite to the angle
rotate sprite 1,wrapvalue(Angle)
endif
Sync
Loop
I unremed your OFFSET SPRITE command so rotates in the center of the sprite instead of the upper left corner.