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.

Newcomers AppGameKit Corner / How To Access AGK Sprite From "main.agc" In "screens.agc" ?

Author
Message
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 2nd May 2017 01:29
Hi,

Pushing forward at a good pace...

Got a problem now that we can't seem to fix:
How can we access an AppGameKit Sprite from "main.agc" in "screens.agc" ?

Hope someone can help us now, dev is halted until this issue is fixed...

Full project source code below:
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd May 2017 02:09
All your include files basically get merged together into a single file during compile time. So globals and whatnot will span across all your files. If you need a variable that's not a global, treat it as you would any other variable. How would you access that sprite normally? It's the same way. Pass the sprite as a parameter to the needed function.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
JeZxLee
7
Years of Service
User Offline
Joined: 15th Mar 2017
Location: Long Island, New York, United States, Earth
Posted: 2nd May 2017 02:49
Hi...

Passing the Sprite's name as a parameter to the function in another file actually worked, thanks!
Moving forward...
JeZxLee
16BitSoft Inc.
Video Game Design Studio
http://www.16BitSoft.com

Login to post a reply

Server time is: 2024-04-26 11:17:14
Your offset time is: 2024-04-26 11:17:14