Jump to content


Member Since 19 Jul 2006
Offline Last Active Sep 13 2015 01:09 PM

Posts I've Made

In Topic: beam weapon

05 April 2015 - 12:33 PM

I'd recommend against using the particle system to attain this effect.


Simply test the left mouse button and use draw_line to draw the beam in the Draw event:

if (mouse_check_button(mb_left)) {
    draw_line(x, y, mouse_x, mouse_y);
    // perform damage and collision check here

For testing collisions and damage, use collision_line starting from the tip of the weapon to find any of the instances affected by the beam weapon. You'll have to iterate them to find which is actually the closest:



Another way, which I'd recommend against, is to create an object at the mouse and use move_contact[_solid] to see which object was hit. This has a performance impact and is sloppy because it relies on only being able to distinguish between targetable elements using the solid property. collision_line is much more powerful because you can filter by parent object.

In Topic: Optimization tips?

14 October 2014 - 02:36 AM


Well.. I can't help you with that your game is glitchy.. especially not without seeing code


But, do you perform any kind of optimization as it is now?

The first basic thing to do is to deactivate everything outside your view:


Step event:

instance_activate_region(view_xview[0] - 64, view_yview - 64, view_wview[0] + 128, view_hview[0] + 128, true);

Not sure if these functions are exactly the same in GM8.1, so I suggest looking them up in the manual to make sure you use them properly.

It is better to only do this when the view moves, it can actually slow games down more to do this all of the time.

Just add a variable check to Panda's code up there, and only make that variable true when your view is moving(when your character moves for example).



Better probably put it in an alarm event too, set to say: 1 second.

In Topic: GameMaker for Mac

31 August 2014 - 04:56 AM

The interest about "GM:Mac" (GM4Mac) in this thread got me excited that they might have finally updated it... and nope.


As already mentioned, it's quite outdated so if you use support material/tutorials make sure it's targeted at GM6/7-era.

In Topic: Issue with YYC and relatively large scripts

08 July 2014 - 02:51 PM

Invoke the error, then copy and upload the file at the end of the error. It looks something like this: "C:/Users/Michael/Documents/GameMaker/Cache/VitalityGMS_78/Default/Scripts/gml_Script_init_blocks_old.gml.cpp". At first I thought it might be an issue with LLVM, but honestly it just looks like YYG generate too much code and blow their (not clangs) buffer, or something.


In any case, the intermediate cpp file will help a lot with diagnosing what is actually happening.

In Topic: Wracking my brain, enemy movement with animations

25 June 2014 - 10:22 AM

You should draw a State Diagram and then translate it into a finite state machine. What you're doing right now is absolutely unmaintainable and is only going to give you headaches.