• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

HTML5 to GMS 2 (organizing code)

D

Darth Binary 1010

Guest
Hey all, I've been working with HTML5 for over a year now, and now since I'm more interested in making mobile educational games, I wanted to try a game engine that will give me more flexibility and speed.

I've only went through ~4 GMS 2 tutorials so far, and I'm starting to think about how confusing things would get since each object has their own separate code page, with multiple tabs based on what you need it to do. I feel like I would get lost quickly once the project gets complicated and it would be very hard for someone to look at my code and understand what is happening quickly.

With HTML5, the game room can be read like a book and is very easy to understand. Every object has methods that just sit there and are only called in the game room, the game room just has one update loop for everything, and a simple click on the method brings me right into the object to inspect the code more.

So I'm wondering how you guys handle maneuvering around your project once things get complex, like forgetting where you actually put a method. Yes there's the search function, but I often can't remember the names of everything. Any advice here?
 

Coded Games

Member
Well first of all, methods don't exist in GML, yet. The closest thing we have is scripts.

I personally would suggest learning what all of the objects events are and when they are called. The events are basically the methods you can write and are called automatically by the engine.

The ways to organize your code is really up to you. Some people like breaking basically all of their code into scripts and only have object events call run scripts. Some people like leaving most of their code in object events. Some people like writing the vast majority of their code in the step event over using other equivalent events. It's really up to you and definitely has a learning curve when you come from prior programming experience.
 
Top