GML (Game Maker Language)?

2018-02-08 12:22 pm
I know GML is similar to java and I've heard a few C languages thrown out, but I want to know whay language it's most similar to. Is it based off a language? I ask because i want yp learn some more versitile languages and I'm fairly familiar with GML.

回答 (3)

2018-02-08 4:04 pm
✔ 最佳答案
It looks to be generally similar to C / C++

You should not have any great problems using that, if you are familiar with GML.

C, like many languages, needs all variables declaring before use, so the compiler knows what type of information is being stored and how much memory to allocate.
From a quick glance GML does not need that.

You also need to include the appropriate header files when using any common functions that are not directly built-in to the compiler, like
#include <stdio.h>
or
#include <stdlib>

The stdxxx header has the definitions for the basic input / output functions, others are needed for more complex functions.

Any general "hello world" program will include those requirements, just copy that to start with.


C++ is really a set of extensions to C rather than a different language. Any normal C++ compiler can work with either "style" and you can freely mix the two, either procedural or object-oriented. The compiler produces the same code for equivalent operations in either style source, it does not care.

Use whichever you get on with best, or whichever fits what you are doing at the time.
(And "objects" are really just C "structs" - structures of variables - under a different name).
2018-02-08 7:29 pm
GML looks to be a lot closer to C than to Java.

To get a random number, all you do is call the random() function. In Java, you'd have to do this:

Random r = new Random();
int a = r.nextInt(...);

This is pure Java-style object-oriented programming, were something as simple as that requires instantiating the Random class first.


I'd actually argue that GML is pretty close to JavaScript, at least non-OO JavaScript. JavaScript is also an awesome language you can use to create website clients, website servers (node.js), games (phaser & co) and even desktop / mobile apps (electron, react native, cordova).
2018-02-08 1:20 pm
An interactive educational game for teaching kids the principles of programming and algorithmic thinking in fun way.


收錄日期: 2021-05-01 22:02:25
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20180208042255AAGB6b9

檢視 Wayback Machine 備份