Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
CreateSprite(1,1)
playerX=GetVirtualWidth()/2 - GetSpriteWidth(1)/2
playerY=GetVirtualHeight()-GetSpriteHeight(1)
SetSpritePosition(1,playerX,playerY)
Return
PlayerMove:
// Move the Logo in the X direction
playerX=playerX+GetDirectionX()*100
//playerx=getpointerx()
// Dont let logo fall off left side of screen
if playerX<0
playerX=0
endif
// Dont let logo fall off right side of screen
if playerx>GetVirtualWidth()-GetSpriteWidth(1)
playerx=GetVirtualWidth()-GetSpriteWidth(1)
endif
// Set the Logo Position
SetSpritePosition(1,playerX,playerY)
Return
I need your help with getting your turorial #04 to work correctly. I follow all your instructions and coding provided within the video. But, when I begin the game my ship just moves right till it hits the wall. I have zero control of the ship unless I use the playerx=getpointerx option, then I can use the mouse to move the ship flawlessly.
If possible could you look over my code and tell me what I'm doing wrong?
//Create game window
SetVirtualResolution( 4028, 2768 )
playerX as float
playerY as float
#include "Loader.agc"
#include "PlayerMove.agc"
Gosub Loader
do
Gosub PlayerMove
Sync()
Loop
Loader:
// Find and Load image files
Loadimage(1,"Blackfireship1.png")