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 / AGK Questions

Author
Message
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 16:49
Hey guys,

So I downloaded and opened the Example file in AppGameKit and ran it. It opened up the mole game. I noticed on the side that there were LOTS of things open. One seemed top be another game?
So, can you make 2 games with on file, because when I opened the example that is what it seemed to have done, but when I ran it, only the mole game.

One more question about the wifi sender (that lets you test the games on other platforms).

Does the other platform (phone) need a player? It said that it would use a free player...


Cheers.

God help me, Please.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 16:53
The main example file is a workspace that contains a collection of projects. By default the Games - Smack It project will be active and when you compile and run this will launch. To select another project right click on it and select activate project, now you can launch this.

To test across WiFi you will first need to launch the player app on the device / platform e.g. Mac AppGameKit Player on Mac OS X, then compile, run and broadcast your game on Windows.

We are currently waiting approval with iOS, Samsung Bada and Meego players.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 16:58
Quote: "To test across WiFi you will first need to launch the player app on the device"


Where do you find this player for the phone? Or is it not out yet?


Cheers.

God help me, Please.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 17:00
The iOS player is not yet available. Still waiting on approval from Apple.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 17:14
Ok, thank you. Now, if I were to broadcast to a laptop, do I just download AppGameKit on there as well?


Cheers.

God help me, Please.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 17:16
Check your installation folder and then go into Players/Windows. Copy the contents of this folder across to your laptop and run Windows.bat, which will launch the player app and put it into standby, now compile, run and broadcast from the IDE.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 17:20
Thank you very much.


Cheers.

God help me, Please.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 18:15 Edited at: 15th Aug 2011 18:16
I was trying out the command "for"

Here is what I did:



It prints "Hello World!" once.

I look in the index of commands and find out that "for" isn't a command but it is highlighted?

Also, "wait key" is now gone?


Cheers.

God help me, Please.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Aug 2011 18:24 Edited at: 15th Aug 2011 18:25
Quote: "It prints "Hello World!" once."


Were you doing this in the main loop? I tried



And it printed 10 times.

Quote: "Also, "wait key" is now gone?"


Wait key caused problems on mobile devices that don't like to be paused in user code for long periods of time. While paused they won't update input information, therefore wait key would be stuck in a catch 22 and never return. Sync() forces the device to update it's input information.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 19:10
Quote: "do
for a=1 to 10
print ("Hello World!")
next a
sync()
loop
"

Ok thanks it worked perfectly.

Quote: "Wait key caused problems on mobile devices that don't like to be paused in user code for long periods of time. While paused they won't update input information, therefore wait key would be stuck in a catch 22 and never return. Sync() forces the device to update it's input information."


So I can just use sync like wait key but without pausing the project.
Thanks.


Cheers.

God help me, Please.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Aug 2011 19:14
Quote: "So I can just use sync like wait key but without pausing the project."


Yes, you could do something like this

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 19:28
Sorry to bother you again but I saw this example code to play a sprite animation (from Sprite Animations 1):



It says 15 fps but isn't it really just 10 fps or did I miss something? I just wanted to be sure.


Cheers.

God help me, Please.
Mike Johnson
TGC Developer
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: United Kingdom
Posted: 15th Aug 2011 19:30
Was probably 15 fps at some point, but changed to 10 fps without updating the comment.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Aug 2011 19:35
Yeah, it's 10fps, looks like the code got changed but not the comment.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 19:38
Thanks, just wanted to be sure.


One more thing,

For a scrolling background sprite, does the image have to be very long or can I just have it scroll forever with a small image?


Cheers.

God help me, Please.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Aug 2011 19:44
You can scroll the UV coordinates. I would not recommend loading very long images (over 1024 pixels in size) on mobile devices.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 19:51
Thanks.


Cheers.

God help me, Please.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 20:04
Quote: "mode - The physics mode to use for this sprite, 1=static, 2=dynamic, 3=kinematic"


What is kinematic?


Also, for reading and writing a file,
When writing a file (hello), it seems to write:
a weird symbol then a p? followed by hello.
Is that suppose to be like this?

Is there a way to choose where it writes the file or is it just where the .exe is?

For reading a file, what use does it give?

I'm sorry for all of these questions but I'm learning a lot from this.


Cheers.

God help me, Please.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Aug 2011 20:18
From the Documentation.
Kinematic is a special case which can be thought of as a moving static body, it will not respond to collisions or forces and will continue at its specified velocity forever, but dynamic items will respond to it and effectively be pushed out of the way.

Writing to a file.
If you are using WriteString those extra characters are probably information about what's being stored and how long it is.

You don't get to choose where you save files from within the app. Because the apps have to protect the security of the end user's other data it's required by most stores to only allow your app to write to a special directory made especially for it, and nowhere else.

Quote: "For reading a file, what use does it give?"


Not sure I understand the question.

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 15th Aug 2011 20:50
Quote: "Not sure I understand the question."


I mean is there a way to use what it reads?

Quote: "If you are using WriteString those extra characters are probably information about what's being stored and how long it is."


Is there another to write in a file?


Cheers.

God help me, Please.
Paul Johnston
TGC Developer
21
Years of Service
User Offline
Joined: 16th Nov 2002
Location: United Kingdom
Posted: 15th Aug 2011 21:03
Quote: "Is there another to write in a file?"


WriteLine() and ReadLine() will output and read in plain text with new line characters, WriteString() is only meant to be read back by ReadString().
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Aug 2011 21:41 Edited at: 15th Aug 2011 21:42
WriteString is also available to be used along with something like WriteInteger. A high score file for example might store the top 10 scores like this.



2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 16th Aug 2011 02:43 Edited at: 16th Aug 2011 03:12
Well I made a simple sprite animation program and I don't know how to put it up for download for PC (publish for PC).
Any ideas?


Cheers.

God help me, Please.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 16th Aug 2011 04:16
It's mentioned in the documentation under Publishing.

Basically, in your project folder should be an EXE that has your project's name.

You need that, and you need everything in the Media folder that's in your app project folder, except for the "SourceCode.byc" file. That's your plain text source code, so you might not want to distribute that.

Zip the exe and the media folder up and you can post it for use by anyone running Windows.

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 17th Aug 2011 21:47 Edited at: 17th Aug 2011 21:49
Thanks KISTech, but it won't work without the .byc file.


Cheers.

God help me, Please.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 17th Aug 2011 22:59
Right, there's one in there after you compile called (yourappname).byc. That's the one you distribute. You don't want to leave the other one in there. That contains an interim step between your BASIC code, and the compiled bytecode file. It's not exactly like distributing your source code, but it's close.

2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 18th Aug 2011 02:02
Can you tell me if this is right. [attached]


Cheers.

God help me, Please.

Attachments

Login to view attachments
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 19th Aug 2011 02:52
You don't need the ErrorReport.txt in there, but perfect

I drink tea, and in my spare time I write software.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 19th Aug 2011 02:53
Thank you Lee.


Cheers.

God help me, Please.
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 20th Aug 2011 01:20
When setting a glogal dim, does it need the brackets for something like:

speed = 5

Or does it have to be:

speed [] = 5


Cheers.

God help me, Please.
Hubdule
21
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 20th Aug 2011 01:38
Brackets are for arrays only.

It depends on what you want to do:

Global (could be used everywhere in your program) declaration of one value:
Global speed as Integer

Declaration of an array:
Dim speed[10]
-> Here you can save up to 10 (in this example) values
speed[1] = 5
speed[2] = 10

and so on ...

Life is good!
2Beastmode4u
13
Years of Service
User Offline
Joined: 14th Feb 2011
Location: Loading...
Posted: 20th Aug 2011 01:54
Here is an example of what I did:




Cheers.

God help me, Please.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 20th Aug 2011 14:27
You don't need to 'global dim' variables.

Either global for variables or dim for arrays.

My signature is NOT a moderator plaything! Stop changing it!

Login to post a reply

Server time is: 2024-04-19 03:16:29
Your offset time is: 2024-04-19 03:16:29