Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Sprite not being drawn

Author
Message
United Calamity
8
Years of Service
User Offline
Joined: 22nd Jul 2015
Location: Canada
Posted: 24th Jul 2015 10:20
So I have a Spaceship game, or the early shell of one, and I am trying to get the player to draw. There are four parts to the player, it's type, start function, frame function, and draw function. With each function you just provide the type variable and it works with it. My problem, however, is that the sprite in the draw function is not being drawn. I tried to draw a rectangle to see if it was working, and it was. But the sprite refuses to be drawn.

Here is the code (Sorry for the amount):



One thing to note is that this is all included in the main file using #include.

I've got no idea what I did wrong, could you please tell me what I did wrong?. Any help is greatly appreciated.

Gamejolt: http://gamejolt.com/profile/united-calamity/575975
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Jul 2015 13:01
I don't know what your problem is exactly, but one thing I notice is that you are using drawSprite().

Are you aware that you don't need to drawSprite() to make a sprite appear? It is a persistent object that gets drawn simply by existing.

Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 24th Jul 2015 16:14
You may need to pass the variable reference to your functions rather than values, otherwise your function is only creating a local variable when loading the sprite image or something... maybe...

Trying using for example "function playerStart(playerObject ref as oPlayer)" for the function to use the original variable (rather than a copy).

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
United Calamity
8
Years of Service
User Offline
Joined: 22nd Jul 2015
Location: Canada
Posted: 24th Jul 2015 21:26
So I added ref to the thing, and I tried removing the draw sprite, and nothing. Just in case it something somewhere else, here is main.

I hate to give you all this code, I know it annoying to read through it, but I simply have no idea what I'm doing wrong.

Thanks

Gamejolt: http://gamejolt.com/profile/united-calamity/575975

Login to post a reply

Server time is: 2024-04-26 12:28:52
Your offset time is: 2024-04-26 12:28:52