GML: The only limit is your imagination.
Well that and file size.
Anyways seeing as there are multiple GM projects going on I thought I'd start writing up info on anything anyone asks me about so I don't have to explain the same thing to multiple people. --------- Start with the basics :
And yes. You should learn how to program yourself. Do not bother with Drag n Drop. It's best to go directly into coding. The only features you should use for objects are the Create and Step Events. And the only Action in either of those Events should be the Execute Code Action. The best way to learn how to program is by trying to code random things yourself. The best project for learning is a simple platform game. Though if you don't know how to program that can be problematic. Say you want your character to move left when you hold down the left arrow here is what you would do: In the Step Event of your character in the Execute Code Action you would write: :
Now let me explain if. if tells the program to compute something only if all its conditions are met. Our condition in the above code is keyboard_check(vk_left). If all we put was x-=2; then our character would move to the left forever. But by putting the condition that the left key must be held down we now have more control over our player. Now I will explain x-=2; x is a variable already defined by Game Maker. If you've ever taken Algebra you'll know that anything can be a variable. MoomooActionCow could be our variable, but we'd have to define it. x on the other hand is already defined and is a lot easier to use. x in Game Maker refers to the x axis. If you've ever done graphs in math then you know what the x and y axises are. x is the horizontal path of left and right while y is the vertical path of up and down. By default in Game Maker every object's x starts to the very left and its y starts at the very top. So adding to x moves to the right. While adding to y moves downwards. x-axis -2 -1 0 1 2 y-axis -2 -1 0 1 2 The last part you see in our code is x-=2; What we're doing here is taking our object's x and subtracting 2 from it. That way we can move it to the left. Though be careful to write it as -=2 instead of =-2 If you mistakenly wrote it as =-2 then you would be setting your object's x to -2 instead of subtracting it by two. That would make your object teleport to the left side of the screen and just stay there. --- I hope this has helped you. If you have any questions feel free to ask. |
I don't use GM, but it seems useful +rep. I was thinking of doing an AS version of this but it seems I'm the only one using it.
|
I've seen a lot of people in the fan section ask about Game Maker. This should help them out unless they don't know squat about scripting language...
+rep |
What's a scripting language..?
Tut tut BV, you should know I'm joking. |
:
|
PHP is by far the best language, forget that ASP crap.
|
I'm quite a fan of the concept of ActionScript 3.0, but in actuality its really a bother sometimes.
|
:
|
I am already quite familiar with HTML. Which would be the easiest programming language to use for GM?
|
I still think Flash is totally awesome. I'm sure GM has some advantages to it though.
|
:
|
I know that. Then why would I be asking?
|
Sorry, I thought you were asking. well, The only scripting language that I know working for GM is C++...
|
If you know C++ then why use GM when you can use Microsoft Visual Basic? Isn't that better?
|
:
|
Game Maker uses its own language GML which is very similar to C++. In the end no matter what the language all you're really doing is manipulating data to display certain things.
|
I just thought I'd add a couple of things;
Yes, as Venks said, Game Maker uses its own language, which is similar to C and C++, as well as Paschal, but C++ won't always work in Game Maker. Mostly it's close enough that you could theoretically use the same code, but I just thought it's worth mentioning that GML isn't quite the same. Also, while I agree you should try to use GML as soon as possible, I don't see why you can't use Drag & Drop at least to get the hang of how things work. Especially since in the latest Game Maker versions all the D&D actions just translate to GML anyway. But I guess it depends, I personally have always used the code, but for some people it makes more sense after using D&D first. If you do use code, there are a few other events from Create and Step you can use, though, for instance in a project I'm working on the Draw event is used for many objects. Of course, that's for more advanced projects though. The main thing to watch out for in using the Step event is that you aren't doing too much calculations in every step, or it will slow things down. Simple checks like what Venks showed with his example aren't a problem, but if you start putting complex calculations in the Step event it'll make a big difference to speed. And while I'm at my ranting, I might as well mention code structure :D It is important to make sure when you're coding that your code stays tidy, and comments are your friends! Although you may think you don't need to worry about any of that because you know what your code does, if you ask someone else for help they'll find it a lot easier to help you if your code makes sense. And remember, if you're working on a big project you may have to go back to your old code months after you wrote it, and it might not make as much sense now as it did back then. For example, compare these two snippets of random code: :
:
The main differences are just comments (anything on the right of a // is considered a comment and Game Maker highlights it green just to make that clear - you can also use /* as the start of a comment block and */ to end it) to explain what everything does, each expression or statement is on a new line, and blocks are indented so you can clearly see what is under each block. |
Yerh the comments are a bit like AS, I try my best to add them in. Good thing Flash has a Auto Format feature :D
|
Hi, Venks, do you know how to make a "online chat room" inside GM7, that was going to be one of the features inside of my fan game, also do you know how to make it so that you can save your progress, is this possible?
|