Skip to content

How To Play

Caborus edited this page Dec 9, 2023 · 1 revision

Controls

Ai's Odyssey is a programming game! As such, you're going to need your mouse and trusty keyboard to wield into combat!

Menus

Main Menu

After installing the game, you'll be greeted with the options to "Continue" a previous run, start a "New Game", change settings in "Options", or "Quit" to exit the game.

Pause Menu

At any time during the game, you can press Esc to pause.
Here you can Save the game, change settings, return to menu, or quit to desktop. In the settings, you can adjust the volume and text cursor color/type.

Map

Navigate the map by clicking on a folder to move to that location, you will then encounter one of the following room types:

  • Combat Room - Fight an enemy
  • Rest Area - Heal up a bit
  • Item Room - Unlock new items and functions

Combat Guide!

Ai's Odyssey has a turn-based combat system, where the player writes scripts in the Chai language to fight.
Skills cost CPU Cycles to cast, some of which are regenerated at the start of each turn.
Make sure to keep an eye on your HP though, because death is permanent, and you'll need to start over from the beginning if it hits 0.

How to code in CHAI

Chai is a syntax sensitive language meant to teach good programming habits in a style similar to Java. It supports comments '//' if you need to make notes to yourself, or comment out parts of your code that you might not want to run during a specific turn.

All chai scripts are set up with a basic class and function to work in:

class Player {
function main() {
// your actions go here
}
}

Attacking

Players can execute a number of attacks, these can be found in your inventory, but will look like "attackName(targetName)", and will be entered in your script like so:

class Player {
function main() {
debug(bug_1);
}
}

All lines should end with a ';', like punctuating a sentence with a period.

Variables

Players can make variables to use in their code, like making a counter to keep track of the number of iterations in a loop, variables can be written like:

var variable_name = 1;

Loops

Chai supports for and while loops, these work similar to how they work in many other languages

While Loops:
These will repeat until the break condition is reached, their formatting is:

while(break_condition){
// code segment
}

An example of a while loop:

var i = 0; // Variable to keep track of iterations
while( i <= 1 ){ // While i's value is less than or equal to 2, this section repeats
i = i+1; // add 1 to i
}

Explanation:
This loop is set up so i starts at 0, enters the loop, since i is less than 1, it goes in, adds 1 to i, making i = 1.
We have reached the end of the loop, so we return to check the condition, is i <= 1? i equals 1, so we continue the loop, adding 1 more to i, so now i = 2.
We reach the end of the loop again, so we return to check the condition, is i <= 1? Since i = 2, i is not <= 1, and the loop breaks. Continuing on to code further down.

For Loops:
These will repeat the code section a set number of times, they have the format of:

for(initial_condition; break_condition; iterator){
// code segment
}

Example of a for loop:

for(var i = 0; i <= 1; i = i + 1){ // create i = 0, loop as long as i <= 1, add 1 to i after each loop
debug("bug_" + i); // attack a target with a name "bug_" + i
}

Explanation:
To start, we create variable i and set it equal to 0, i is less than 1, so we go into the loop.
We cast debug("bug_0"), this is because we add i to the end of the string "bug_", and i currently equals 0.
Once we reach the end of the looping code segment, i iterates, so i = 1 now and we check the break condition again, since i <= 1 is still true, we return to the looping code segment again.
We cast debug("bug_1"), since i = 1, the string is updated appropriately.
i iterates again, i = 2, and when checking the break condition, i <= 1 is no longer true, so we break out of the loop.

Clone this wiki locally