Array Tutorial

Learn how to make certain types of games and use gameEditor.

Array Tutorial

Postby MysticTrunks » Mon Oct 19, 2009 5:41 am

Side Note: I've never used arrays with Game Editor, I'm very familiar with them from C++ and C# and how they're used even familiarizes me more with Game Makers GML.
(I don't know the max "d" with Game Editor I'm just going to assume it's 3D)

Like any game you're going to need a global script that controls the variables that are attended in every level if not then use local scripts.
Let's begin!

Before I begin I'm going to assume you know what int, float, and var are. If not I'd suggest looking them up.

Code: Select all
int party;

party[0,0] = name; // Name of your character
party[0,1] = 100; // HP
party[0,2] = party[0,1]; // Max HP 
party[0,3] = 15; // SP
party[0,4] = party[0,3]; // Max SP



There's so many things you can do with arrays like for example a RPG Management system, I'll be posting my GML code in hoping someone can transfer it over but C isn't far off from GML and I'm already getting used to programming with Game Editor.

I use arrays for Menus, Data management, inventory, etc.

Basically to draw the values of the array just create a actor with a draw event and just use this.
int name;
name = party[0,0];

But for menu's you would be using the for command.

Hope you all enjoyed this beginner tutorial to arrays.
MysticTrunks
 
Posts: 8
Joined: Tue May 27, 2008 7:56 am
Score: 1 Give a positive score

Re: Array Tutorial

Postby makslane » Mon Oct 19, 2009 11:54 am

Thankyou for this post.
Only two notes:

Use party[x][y] instead party[x, y] to access an array member.
Game Editor is a 2D game creation tool, but if you are talking about the array dimensions, it can have many dimentions.
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest