AppGameKit Classic

AppGameKit Classic

AppGameKit Tutorial #02 - Load an image, create a sprite and move it!
8
   
Premio
Aggiungi ai preferiti
Preferito
Rimuovi dai preferiti
5 commenti
liquidmental 18 giu 2018, ore 9:55 
Okay I will see what I can do about the google drive file.. but basickly my project is the exact sameone the video is providing (minus the ship of corse) ...
Rick  [autore] 18 giu 2018, ore 4:54 
I could help better if you just send me a link to your full project in zip format via Google Drive (or similar).
liquidmental 16 giu 2018, ore 10:56 
// Create the player ship at the bottom of the screen
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
liquidmental 16 giu 2018, ore 10:56 
Rick... first off, Awsome video series, they are a great help to individuals such as myself.
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")