Kairos
|
|
« Reply #20 on: November 16, 2008, 11:11:52 AM » |
|
Excellent, thanks! Don't know how I missed that one too ;_;
I only learned about event_inherited() with my latest project, and so far it's been used throughout unit structures and whatnot. I could have one universal parent, another child parent that inherits the events but adds its own code, which continues down the chain with more child objects inheriting the events. I just wished I found out about this before - I thought you did this for ID too, it seemed like it would've been the case.
|
|
|
Logged
|
|
|
|
ஒழுக்கின்மை (Paul Eres)
|
|
« Reply #21 on: November 16, 2008, 12:17:31 PM » |
|
No, in ID I just had like 5 object types total, and distinguished everything in GML by type identifiers.
|
|
|
Logged
|
|
|
|
dbest
|
|
« Reply #22 on: November 17, 2008, 11:57:17 PM » |
|
Really nice tutorials. I have just refound GameMaker after couple of years and should be using more actively for a few small games.
|
|
|
Logged
|
|
|
|
Derek
|
|
« Reply #23 on: November 17, 2008, 11:58:12 PM » |
|
Thanks, Freddie!
|
|
|
Logged
|
|
|
|
M.D.K.
|
|
« Reply #24 on: November 18, 2008, 08:09:09 AM » |
|
Oh boy. I better get this transalated to Spanish ASAP. We are being FLOODED with stupid stupid questions . Questions that could have been answered with a little reading of the manual. Well, It won't stop them from going HOW DO I MAKES MAH OWN POKEMANZ! I WANNA MAKE A SMASH BRUTHAS! (and you see a charmander on the click the ball example) But I hope it will separate the good ones from the rest.
|
|
|
Logged
|
|
|
|
Mir@k
|
|
« Reply #25 on: November 20, 2008, 12:17:26 AM » |
|
I hope the third part comes out soon.
|
|
|
Logged
|
|
|
|
|
Xion
|
|
« Reply #27 on: November 20, 2008, 12:27:56 AM » |
|
Oh awesome, Rinku - that direction difference and nearest objects thing had been giving me much trouble. The debug thing may come in handy as well.
|
|
|
Logged
|
|
|
|
GregWS
|
|
« Reply #28 on: November 22, 2008, 01:26:56 AM » |
|
Great stuff rinku! That "with()" stuff sounded interesting/useful, but to be honest I'm not quite sure how I'd use it (and I'm sure that reflects my lack of proper understanding here). So I'd love to see that post about with(), as I'd hate to be missing out on something that could make my life easier!
|
|
|
Logged
|
|
|
|
Matt Thorson
|
|
« Reply #29 on: November 22, 2008, 11:19:03 AM » |
|
Great stuff rinku! That "with()" stuff sounded interesting/useful, but to be honest I'm not quite sure how I'd use it (and I'm sure that reflects my lack of proper understanding here). So I'd love to see that post about with(), as I'd hate to be missing out on something that could make my life easier! The easiest example is: with obj_A { instance_destroy(); } This will destroy all instances of obj_A. A useless example but one that shows the power of with better is: globalvar count; //Set count to be a global variable count = 0;
with obj_A { count += 1; } After this code, count will hold the amount of instances of obj_A currently active. Of course this is useless because you could just use instance_number( obj_A ); for the same result but much faster (and without creating a global variable), but you get the point.
|
|
|
Logged
|
|
|
|
GregWS
|
|
« Reply #30 on: November 22, 2008, 11:49:20 AM » |
|
Yeah, thanks, I can definitely see what you guys are talking about!
|
|
|
Logged
|
|
|
|
Matt Thorson
|
|
« Reply #31 on: November 22, 2008, 12:35:42 PM » |
|
Note that you can also use with with instance id's: var a; //Initialize a local variable to be discarded after this piece of code a = instance_place( x, y, obj_A ); with a { instance_destroy(); } This code will destroy just the instance of obj_A at position (x,y).
|
|
|
Logged
|
|
|
|
medieval
Guest
|
|
« Reply #32 on: November 22, 2008, 12:59:18 PM » |
|
you can use with for things like other as well, which is useful when one instance is interacting with another instance. Example: if (place_meeting(x+3,y,o_enemy)) { with (other) { instance_destroy(); } }
This will only destroy one instance, more specifically, the one you're interacting with.
|
|
|
Logged
|
|
|
|
ஒழுக்கின்மை (Paul Eres)
|
|
« Reply #33 on: November 22, 2008, 01:22:47 PM » |
|
you can use with for things like other as well, which is useful when one instance is interacting with another instance. Example: if (place_meeting(x+3,y,o_enemy)) { with (other) { instance_destroy(); } }
This will only destroy one instance, more specifically, the one you're interacting with. You don't need the brackets there. Brackets are only for multiple lines. It'd work just as well as: if (place_meeting(x+3,y,o_enemy)) with (other) instance_destroy();
|
|
|
Logged
|
|
|
|
Derek
|
|
« Reply #34 on: November 22, 2008, 01:25:33 PM » |
|
Is it possible to make a loading screen that doesn't use a fixed-width loading bar?
|
|
|
Logged
|
|
|
|
ஒழுக்கின்மை (Paul Eres)
|
|
« Reply #35 on: November 22, 2008, 01:27:37 PM » |
|
I'm not sure, I think it's best not to use that loading bar at all, and just use a static image, or nothing at all (and just have the game load all resources externally so the startup is quick enough that they don't need one). Seeing that loading bar screams "amateur game maker game!" to me, even when it's custom.
|
|
|
Logged
|
|
|
|
Derek
|
|
« Reply #36 on: November 22, 2008, 01:29:33 PM » |
|
Gotcha... that's what I figured! Thanks, Paul.
|
|
|
Logged
|
|
|
|
Alevice
|
|
« Reply #37 on: November 24, 2008, 08:13:59 AM » |
|
You don't need the brackets there. Brackets are only for multiple lines. It'd work just as well as:
if (place_meeting(x+3,y,o_enemy)) with (other) instance_destroy();
Don't tell that to Douglas Crockford.
|
|
|
Logged
|
|
|
|
Matt Thorson
|
|
« Reply #38 on: November 24, 2008, 02:22:54 PM » |
|
You don't need the brackets there. Brackets are only for multiple lines. It'd work just as well as:
if (place_meeting(x+3,y,o_enemy)) with (other) instance_destroy();
Don't tell that to Douglas Crockford. Whoa... does place_meeting() set other to the instance found? ie: is that code valid outside of collision events? If so, code_efficiency++; for me! In that situation, I usually use: if place_meeting(x,y,obj_A) { var a; a = instance_place(x,y,obj_A); with a instance_destroy(); } A small gain, but those place_meeting()/instance_place() calls adds up after a while...
|
|
|
Logged
|
|
|
|
Xion
|
|
« Reply #39 on: November 24, 2008, 07:39:40 PM » |
|
Whoa... does place_meeting() set other to the instance found? ie: is that code valid outside of collision events?
I've tried that before and it never seemed to work. Maybe I was just doing it wrong though, but I usually do something along the lines of how you said.
|
|
|
Logged
|
|
|
|
|