Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1402075 Posts in 68031 Topics- by 61616 Members - Latest Member: MichaelCasady

August 13, 2022, 06:46:26 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)Game Maker For Beginners: Part II
Pages: 1 [2] 3 4 ... 6
Print
Author Topic: Game Maker For Beginners: Part II  (Read 133289 times)
Kairos
Level 0
**


Explode


View Profile WWW
« 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)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« 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
Level 0
***


View Profile
« 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
Bastich
Administrator
Level 10
******



View Profile WWW
« Reply #23 on: November 17, 2008, 11:58:12 PM »

Thanks, Freddie! Well, hello there!
Logged
M.D.K.
Level 0
**



View Profile
« 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  WTF. 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.  Gentleman
Logged
[email protected]
Level 1
*


Pffffffft


View Profile WWW
« Reply #25 on: November 20, 2008, 12:17:26 AM »

I hope the third part comes out soon. Smiley
Logged

ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« Reply #26 on: November 20, 2008, 12:19:12 AM »

In the mean time you can read this, which I wrote up yesterday: http://studioeres.com/games/content/7-game-maker-tips-experienced-users

Although it's geared for more experienced users (as the URL says).
Logged

Xion
Pixelhead
Level 10
******



View Profile WWW
« 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. Beer!
Logged

GregWS
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« 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!  Beer!
Logged
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« 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!  Beer!

The easiest example is:

Code:
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:

Code:
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
Level 10
*****


a module, repeatable in any direction and rotation


View Profile
« Reply #30 on: November 22, 2008, 11:49:20 AM »

Yeah, thanks, I can definitely see what you guys are talking about!  Gentleman
Logged
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW
« Reply #31 on: November 22, 2008, 12:35:42 PM »

Note that you can also use with with instance id's:

Code:
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:
Code:
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)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« 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:
Code:
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
Bastich
Administrator
Level 10
******



View Profile WWW
« 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? Huh?
Logged
ஒழுக்கின்மை (Paul Eres)
Level 10
*****


Also known as रिंकू.


View Profile WWW
« 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
Bastich
Administrator
Level 10
******



View Profile WWW
« Reply #36 on: November 22, 2008, 01:29:33 PM »

Gotcha... that's what I figured!  Thanks, Paul. Smiley
Logged
Alevice
Level 10
*****



View Profile WWW
« 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
Level 7
**

c'est la vie


View Profile WWW
« 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:

Code:
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
Pixelhead
Level 10
******



View Profile WWW
« 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

Pages: 1 [2] 3 4 ... 6
Print
Jump to:  

Theme orange-lt created by panic