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 / What is the Best Way to Learn AGK2?

Author
Message
JasonB76
9
Years of Service
User Offline
Joined: 1st Dec 2014
Location:
Posted: 1st Dec 2014 02:43
I have AGK2 and I also bought the book "Hands On AppGameKit BASIC."

However the book I feel is bunk and frustrating. It has resources to load and then you load the resources and they won't compile or work. Like the Buttons example on Page 87. The "Mod" function how it is written just won't work no matter what I try.

So I am having a hard time with the book and was wondering if anyone has any good advise on how I can learn to program in AGK2?

Thank you for any help you can give.
Jason
Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 1st Dec 2014 13:09
Quote: "However the book I feel is bunk and frustrating. It has resources to load and then you load the resources and they won't compile or work. Like the Buttons example on Page 87. The "Mod" function how it is written just won't work no matter what I try."


I'm sorry I don't have the time to make a suggestion for an alternative solution, but I will just say that the reason the book makes no sense is because it was written for AGK1. AGK2 is slightly different in some areas.

This is definitely a valid and important point, so if someone else doesn't help you I'll find the time soon to help you myself

paulrobson
10
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 1st Dec 2014 13:41
Hi. I am a programmer of some experience but I am using Hands On AGK2 because well, it's well written and readable, and with any new system there is learning the API as well.

To be fair, as the Mod. has pointed out, it is for AppGameKit 1. It's not that different though, all the stuff on algorithms and so on is much of a muchness, and you will learn a lot by just fixing the examples for AppGameKit 2.

Mod ; I think this is a mistake by the devs, personally. In AGK1 mod (remainder) is an operator like + or - so :

x = 7 mod 3

will set x to 1 (remainder of 7/3). In AGK2 this has been changed to a function which is somewhat more unwieldy.

x = mod(7,3)

Other things I have noticed ; the setup is slightly different. To get the button examples to work you have to set the display aspect to 0.75 (which is width/height) otherwise it compresses the button positions. Function calls and definitions now require brackets even if there are no parameters, as well.

Please feel free to ask. I can't remember what I did exactly but it was quite enlightening making things work (e.g. the aspect ration helped me figure out exactly how the resolution system works !)

If you don't fancy HandsOn or the other one (Teach yourself ?) which is good as well but has the same issues, then use them as guidelines / manuals, and start with the basic ( ) examples. Then start drawing things and so on, using the examples on the AppGameKit website. Once you've got the hang of chunks of it, have a go at something dead simple - Pong/Squash is usually a good starter ; your code will probably be terrible but you will learn a lot and subsequent code will be much better.
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 1st Dec 2014 13:48
I agree with that. Look at the examples!

-- Jim - When is there going to be a release?
paulrobson
10
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 2nd Dec 2014 08:54
Another alternative would be to buy AGK1 (is there a trial ?) and then the examples will work (mostly, hopefully). I note it is on offer for $30 with three other game development packages which is not bad really. Many cross platform dev kits cost more than that a *month*.
Clonkex
Forum Vice President
14
Years of Service
User Offline
Joined: 20th May 2010
Location: Northern Tablelands, NSW, Australia
Posted: 2nd Dec 2014 09:39
Quote: "In AGK2 this has been changed to a function which is somewhat more unwieldy.

x = mod(7,3)"


I agree. They should have changed it to the standard % in place of a word and kept it as a real operator.

Quote: "Function calls and definitions now require brackets even if there are no parameters, as well."


What?? They didn't before? About every other programming language there is needs brackets for functions without parameters!

Quote: "I agree with that. Look at the examples!"


+1 good suggestion, except for a brand-new programmer. This will be confusing to a new programmer, where Hands on AppGameKit would actually be more help, even with the differences.

I'm sorry, I honestly don't know what to suggest for someone that's completely new to AGK2.

JasonB76
9
Years of Service
User Offline
Joined: 1st Dec 2014
Location:
Posted: 9th Dec 2014 21:59
I am going to try the command changes you guys told me for the using "Mod".

Thank you for that!

I actually did the early bird to get AGK2, so they also gave me AGK1. But I really want to learn on version 2 as it seems to have many improvements.

I also noticed that by default in AGK2 your sprite placement is pixel based not percentage based. Wierd? I like the percentage better. But I did find you just have to add some code to go to the percentage placement so you can enter x & y as 50,50 and not 640,360.

I have found some good stuff on you tube, and made a PDF of the Documentation the TGC's website. those actually helps a bit.

Any other suggestions would be great.

Is the programming language actual "Basic" or a modified version of "Basic"? I noticed you can also program in C++. Which do you think is better?

Thank you,
Jason
paulrobson
10
Years of Service
User Offline
Joined: 22nd Nov 2014
Location: Norfolk, England
Posted: 9th Dec 2014 22:47
Yep. There are a few tweaks but the main thing is that all of HOAGK is designed for a 100x100 resolution. If you change the window size so it is square and set the virtual resolution to 100x100 then this fixes most problems.

It's a modified version of BASIC - proper variable names, user definable types, named functions. Which is better ? Well, if you are a new programmer C++ will do your head in
JimHawkins
15
Years of Service
User Offline
Joined: 26th Jul 2009
Location: Hull - UK
Posted: 9th Dec 2014 23:13
The default is percentage. If you use Virtual Resolution it switches.

-- Jim - When is there going to be a release?

Login to post a reply

Server time is: 2024-11-25 13:24:38
Your offset time is: 2024-11-25 13:24:38