Game Maker's Garage Forum

Game Maker's Garage => Trash Talk => Topic started by: Gnome on May 16, 2009, 02:58:01 PM

Title: a request
Post by: Gnome on May 16, 2009, 02:58:01 PM
Not a game or anything, but I thought of a good way for people who know both GM and higher level language to post tutorials. You compare the syntax and how to execute certain things of the higher one to GM's.

Like

GM:
x = 5
But on Java its
int x = 0;

I think it would help the rest us very well.
Title: Re: a request
Post by: Gan on May 16, 2009, 03:41:20 PM
Oooh. That's brilliant. :) I'll shift this into the Java tutorials.


-Gandolf
Title: Re: a request
Post by: Tireas Dragon on May 16, 2009, 04:22:19 PM
Quote
GM:
x = 5
But on Java its
int x = 0;
Do both of those code lines change x's value to 5? Because java is more strange than I thought possible if they do
Title: Re: a request
Post by: Gan on May 16, 2009, 07:31:06 PM
Haha, no. Sorry for the confusion.

In Java, you need to declare the variable before you can use it.
Hence:
Code: [Select]
int x;

Here is how it would compare, Gm to Java:
Gm
Code: [Select]
x = 5 
Java
Code: [Select]
int x;
x = 5;
//Or you could simplify it and go as:
int x = 5;


-Gandolf
Title: Re: a request
Post by: Tireas Dragon on May 16, 2009, 07:58:45 PM
That makes a whole lot more sense.