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 / Can someone post a working example?

Author
Message
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 19th Oct 2012 07:32
Hey folks, I'm having a heck of a time getting anything Tier 2 to compile in Visual Studio 2010 Pro. Can someone post a full working solution of something, I don't really care what it is. At the moment I can't get any example to work after much messing with the linker, etc properties. Thanks!

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 19th Oct 2012 07:38
I forgot about your other thread, sorry Doz. Here's a video for setting up templates in VS2010 Express (I hope it works with VS 2010 pro as well).



Wacky Acky
12
Years of Service
User Offline
Joined: 3rd Nov 2011
Location: New Zealand
Posted: 19th Oct 2012 10:37 Edited at: 20th Oct 2012 02:02
Hi Doz,

I've been in the same position as you today and have spent the day fighting to get the example projects to work properly.

I've just created a separate post which has a new set of .csproj files in it, which should hopefully solve all your problems. However, being a newbie to these forums I'm waiting for the moderators to approve that post.

Please tell me if it works for you when you find it, as I've only tested it on my local setup, so it might not work for other people.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Oct 2012 16:53
In this post, I uploaded a set of working v1076 templates (or file replacements for iOS).

I image Visual Studio 2010 Pro should be able to accept the Express version and then you can massage it.

At this point, none of the v1082 is compilable in Windows. There are missing libraries.

Cheers,
Ancient Lady
AGK Community Tester
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 20th Oct 2012 07:31
Hi there, thanks for the replies. Hodgey, I followed those instructions and it wasn't enough, I eventually found this thread http://forum.thegamecreators.com/?m=forum_view&t=197031&b=41 which mentioned adding Comdlg32.lib to the dependencies. I seem to be past the template issues, but I'm getting memory access violations, it appears to be on LoadImage.

How exactly are you supposed to handle media? Is is like Tier 1 where you just have a folder called 'Media' in the directory with the .cpp files?

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 20th Oct 2012 08:11 Edited at: 20th Oct 2012 08:14
Quote: "I followed those instructions and it wasn't enough, I eventually found this thread http://forum.thegamecreators.com/?m=forum_view&t=197031&b=41 which mentioned adding Comdlg32.lib to the dependencies. "

Might be a VS2010 Pro thing. My projects don't need it in the additional dependencies.

Quote: " I'm getting memory access violations, it appears to be on LoadImage."

Would you be able to post code (or make a small example)?
Edit- With AppGameKit, it's probably best to make sure that all AppGameKit functions end up being called in either app::Begin(), app::Loop and app::End().

Quote: "Is is like Tier 1 where you just have a folder called 'Media' in the directory with the .cpp files?"

It's similar. When loading files AppGameKit will search a folder in Documents\AGK\ProjectName. If the file is not there, then it checks in your Project\Final folder. I typically just create a new folder called "media" in Project\Final and then place all of my media in there.

Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 20th Oct 2012 09:33
Ah ha, I seem to be making progress, it no longer crashes on Image Load, but the sprites never seem to appear on the screen, all I get is blank. The AppGameKit calls I'm making are in other classes but all get called through the begin and loop sections. The code is a bit large to post here, I'll see if I can make a mini version tomorrow.

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 20th Oct 2012 10:30
Quote: "but the sprites never seem to appear on the screen, all I get is blank. "

When I tried loading an image outside of begin, loop or end, the result was a blank sprite. E.g


The above caused a blank sprite but if I move the loadimage bit to inside app:::Begin, it works perfectly.

Maybe you have some LoadImage calls in class constructors which might get called outside of the begin,loop,end functions?

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 20th Oct 2012 18:10
Move your LoadImage command into the app::Begin() method.

The app::Begin() method only happens once.

Cheers,
Ancient Lady
AGK Community Tester
Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 20th Oct 2012 23:19
Wow, that is really wierd, so yeah I missed a bit of code that was trying to load the image before. Thank you both so much for the help, things are behaving as I'd expect now, hopefully no more silly roadblocks.

"The trouble with quotes on the Internet is that you can never know if they are genuine." -Abraham Lincoln
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 21st Oct 2012 00:24
Quote: "hopefully no more silly roadblocks."

Who wants to break the news to him about while loops and sync()?

In short, your app may crash if you do something like this:

There are work-arounds however. More info here should you run into this hurdle.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 21st Oct 2012 17:21
The using sync() in a while loop won't work if the while is contingent upon any sort of user input (touches and such).

But you can do things like:


and (moving_things updates objects that move or wiggle, this bit of code is in a method in a file that isn't template.cpp):


Cheers,
Ancient Lady
AGK Community Tester

Login to post a reply

Server time is: 2024-05-04 11:04:07
Your offset time is: 2024-05-04 11:04:07