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 / Quiz game like Duolingo

Author
Message
Shirokitsune
2
Years of Service
User Offline
Joined: 30th Apr 2021
Location: Japan
Posted: 30th Apr 2021 03:33
Hey everyone,

I am new to AppGameKit and I have some ideas for quiz gaming.
I am an English teacher in Japan and I would like to create a game similar to a part of duolingo.
I attached the part I would like to try and recreate.
I was thinking of having a tsv or csv file that contained the individual questions separated as English, Japanese, picture file location, sound file location but I started to have doubts if that would work.
My idea was to create a type (question) per line that was separated into 4 categories with the above information.
The English string would then be separated into an array via spaces and shuffled. What I am wondering is how to display this on the screen like Duolingo does.
Would it be better to create buttons that have the text from the array displayed or is there a better method to do this?

Any help or ideas for coding this would be appreciated.

Attachments

Login to view attachments
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Apr 2021 04:17 Edited at: 30th Apr 2021 04:19
Quote: "Would it be better to create buttons that have the text from the array displayed or is there a better method to do this?"

i can't think of a better way.

either AppGameKit (virtual) buttons or Text objects could help, along with an Edit Box should solve both input methods.

and, i think the way you want to break the solution up would work fine using " " as a delimeter for parsing and breaking the sentence up for individual words/buttons.
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
Shirokitsune
2
Years of Service
User Offline
Joined: 30th Apr 2021
Location: Japan
Posted: 30th Apr 2021 06:11
Thank you for the quick reply. I will attempt that when I am on a computer that has AppGameKit!
I was wondering if you had any advice for the organization of my data?
I was planning on using google sheets or excel to create the tsv. Would I have to use the ascii 9 value - Chr(9) - to evaluate my different lines?
Also is there a way to select a specific line or do I need to upload the entire tsv from the begging?
Example file:
I love AppGameKit (tab) AGKが大好きです。(tab) AGK.png (tab) AGK.wav
I like blue (tab) 青いが好きです。(tab) blue.png (tab) blue.wav
I like rabbits (tab) ウサギが好きです。(tab) rabbit.png (tab) rabbit.wav

If I want the question about rabbits do I need to read every question before it or is there a way to specify what line from the file I want to read?
For something this short I don't think I would notice a difference in speed but I actually have created a database of questions over the last 8 years that spans over 10,000.
If say I want to load question 9,342 do I need to read over all the previous questions?

Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 30th Apr 2021 09:07
i've got word lists with ~100k words, 1 word per line. AppGameKit handles it fine (on windows build - html, another story. same for android, IIRC).

i wouldn't be afraid to open your file of 10k lines and feed it into a typed array all at once but SetFilePos() should do what you want if you know the Qs line in the file (no personal experience with the command).

otherwise, i've never used TSV and i'm unsure if it would understand a TAB but i expect it would. i just tend to use a pipe | when i build a file like we're talking about so i can read it the same way

meanwhile, sounds like you might have reviewed some commands already but make sure to check ReadLine() and GetStringToken and related commands.

and, while i'm thinking about it, you'll need to find an font with the japanese characters, some info on utf fonts here
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 30th Apr 2021 14:52
I think you can use Chr(9) in StringToken for TAB, Chr(13) for CR, Chr(10) for LF, or run a S&R on the file and use CSV, personally speaking for 10k items I'd use SQLite, run a script on the raw file to generate a SQL injection statement and your good to go, instant access and no waisted memory.

I made something like this a few years ago using Dolch words, I think I used CSV for that but there were only a few hundred words and less that 100 questions (use cases for the words)
Shirokitsune
2
Years of Service
User Offline
Joined: 30th Apr 2021
Location: Japan
Posted: 6th May 2021 14:00
Thank you guys for your input. Do you have a link where I can find some information on SQL? I really am a beginner when it comes to reading and writing files. I used to use python to create bots for rpgs, did not like the grind, but there was no file reading with that.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 10th May 2021 04:46
Quote: "If say I want to load question 9,342 do I need to read over all the previous questions?"

Yes but shouldn't be a problem. I did a word game that uses a dictionary file, and that's, well, every english word! Had no issues with it.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-04-25 17:02:43
Your offset time is: 2024-04-25 17:02:43