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

Login with username, password and session length

 
Advanced search

1301752 Posts in 58009 Topics- by 49079 Members - Latest Member: westclif

June 24, 2017, 06:01:54 am

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTutorialsGame Maker Tuts
Pages: 1 [2] 3 4 ... 24
Print
Author Topic: Game Maker Tuts  (Read 281506 times)
ChevyRay
Guest
« Reply #20 on: October 09, 2008, 05:42:20 am »

[This has been removed as it is no longer supported by me]
« Last Edit: December 14, 2009, 04:59:05 am by ChevyRay » Logged
Soulliard
Level 10
*****


The artist formerly known as Nightshade


View Profile WWW Email
« Reply #21 on: October 09, 2008, 11:11:38 am »

Make a tutorial that doesn't make the lower left pixel of every sprite the transparent color.  Sad
There isn't a short or easy way to do it; you're going to have to use alpha masks for that.

sprite_set_alpha_from_sprite(sprite,mask)
You can always just increase the height by 1 and make the bottom row of pixels whatever color you want to be transparent.
Logged

necromian
Level 2
**

ʘ_ʘ


View Profile WWW Email
« Reply #22 on: October 09, 2008, 11:12:54 am »

Thanks for the scaling tut! Exactly what I was looking for!

I was thinking of a method that saved the screen to a sprite every step and drew that sprite scaled on the screen. If that's possible, I think it might be another solution to the scaling problem that doesn't utilize surfaces.
Logged
godsavant
Guest
« Reply #23 on: October 09, 2008, 12:04:00 pm »

This helped me out. So much.

Logged
ChevyRay
Guest
« Reply #24 on: October 09, 2008, 12:17:17 pm »

[This has been removed as it is no longer supported by me]
« Last Edit: December 14, 2009, 05:06:09 am by ChevyRay » Logged
Hedenius
Level 0
**



View Profile
« Reply #25 on: October 09, 2008, 12:52:48 pm »

That scaling tutorial helped alot, thanks!

I would love to see how you did the platform engine aswell. I've done a few basic platform engines myself, but i wan't to take my GML to the next level.
Logged
policedanceclub
Level 10
*****


POLICEDANCECLUB


View Profile Email
« Reply #26 on: October 09, 2008, 01:02:56 pm »

i would love to see that engine you created!
Logged
ChevyRay
Guest
« Reply #27 on: October 09, 2008, 01:19:48 pm »

[This has been removed as it is no longer supported by me]
« Last Edit: December 14, 2009, 05:06:18 am by ChevyRay » Logged
Hedenius
Level 0
**



View Profile
« Reply #28 on: October 09, 2008, 01:41:39 pm »

Thanks!

Im sure i will learn alot from your engine, very clean code and alot of useful comments!

The collision with slopes above you is a bit weird though. If you walk to the right and jump to hit a slope like this "\" from below, you will start to move backwards (left) and up the slope. Hard to explain  :D
Logged
ChevyRay
Guest
« Reply #29 on: October 09, 2008, 02:00:43 pm »

Yeah, I just made him move *up* the slopes. The horizontal and vertical collisions and movement are handled completely independent of each other. I could easily change that to make it so you'll only slide in the direction you were moving. It just didn't occur to me.

Quote
Im sure i will learn alot from your engine, very clean code and alot of useful comments!
Yeah, I always comment my code heavily, even for myself. But I cleaned that up for others' sake, after Hideous mentioned that my code was practically un-readable to other people, being so tightly packed. :D

I can't work with diluted code, it's gotta be tight and uniform.








...

Tight uniform. Sounds hawt.
Logged
Rory
Level 4
****



View Profile Email
« Reply #30 on: October 09, 2008, 07:07:33 pm »

How do you make it scroll? Do you just use Follow Object in the Views tab of a room?
Logged
ChevyRay
Guest
« Reply #31 on: October 09, 2008, 07:38:09 pm »

No, I never use that. I always write my own, because then it doesn't have that static, lame movement that the automatic one does. I usually write a couple scripts something like this:

Quote from: view_step_towards_point( x, y )

var v_xmiddle, v_ymiddle, dist, dir;

// find the distance and direction to the destination point

v_xmiddle = view_xview[0] + view_wview[0]/2;
v_ymiddle = view_yview[0] + view_hview[0]/2;
dist      = point_distance(  v_xmiddle, v_ymiddle, argument0, argument1 );
dir       = point_direction( v_xmiddle, v_ymiddle, argument0, argument1 );

/* This is a tricky little piece that basically moves the view
faster the further it is away from the point it has to get to.
This way, the view keeps up, but slows to a nice stop */


for(i=1; i<=8; i+=1){
    if dist > i*i*2
    {
        x += lengthdir_x( i, dir );
        y += lengthdir_y( i, dir );
    }
}


// Call the code to keep the view in the room boundaries

view_inroom();


And view_inroom() would look something like this...

Quote from: view_inroom()

/* Make sure the view is inside the room, and
snap it to the room edges if it is not */


view_xview[0] = max( view_xview[0], 0 );
view_xview[0] = min( view_xview[0], room_width - view_wview[0] );
view_yview[0] = max( view_yview[0], 0 );
view_yview[0] = min( view_yview[0], room_height - view_hview[0] );


Of course, you'd have to tweak the numbers and view-position a bit to get it centering where you want. But then basically, for every step that you want the view to move, you can just call the script with the point you want it to center on as the x and y arguments.


I'm not sure if that'll all work either, I just wrote it off the top of my head. Should be either that or something close to that, though.
Logged
Rory
Level 4
****



View Profile Email
« Reply #32 on: October 09, 2008, 08:31:04 pm »

Um, does that work with your scaling method?
Logged
ChevyRay
Guest
« Reply #33 on: October 09, 2008, 08:43:04 pm »

Yes. Like I said, you can just create that object in my tutorial, and place it in your game and it should work over top of everything else. The only thing that really can interfere is if you're using surfaces for something else, in which case there's still an easy fix.
Logged
Elmernite
Level 0
**



View Profile WWW
« Reply #34 on: October 15, 2008, 08:43:56 am »

Nice job! I look forward to this getting even more tuts. I need to use the JoyKey one for sure.
-Elmernite
Logged
Matt Thorson
Level 7
**

c'est la vie


View Profile WWW Email
« Reply #35 on: October 15, 2008, 01:55:13 pm »

How'd you code the guts of your JoyKey extension, Chev?

I have some code I cut-and-paste between projects, then optimize.  Might just use yours instead.
Logged

ChevyRay
Guest
« Reply #36 on: October 15, 2008, 01:59:47 pm »

I'll send you the guts on MSN, dude. It's still in need of a few improvements, like being able to create multiple keys/buttons under a single name, etc.

Basically I just use the "name" you define to define a joykey variable with several attributes, like whether the key is enabled, what the ord/button-number is, etc.

I still gotta make it save and load the information to a file, though, so it can be loaded at game start.
Logged
xerus
Vice President of Marketing, Romeo Pie Software
Level 10
*

kpulv


View Profile WWW
« Reply #37 on: October 16, 2008, 07:52:23 pm »

What is the best way to do tiles in this blasted contraption?  Objects?
Logged

ChevyRay
Guest
« Reply #38 on: October 16, 2008, 08:22:08 pm »

Using tilesets is the fastest, for sure. But only for static content. If you have, say, a wall that breaks, best to set up an object for it.

If the game was simple, and only had one or two "block" objects, like Mighty Jill Off or something, I'd say just use objects. But for something with different depths, edges, corners, grasses, and terrains or whatever, I'd suggest creating it as a background, hitting the tileset check box, and doing it that way. You can change the depth that you place tiles in the room editor.
Logged
xerus
Vice President of Marketing, Romeo Pie Software
Level 10
*

kpulv


View Profile WWW
« Reply #39 on: October 16, 2008, 08:32:49 pm »

Using tilesets is the fastest, for sure. But only for static content. If you have, say, a wall that breaks, best to set up an object for it.

If the game was simple, and only had one or two "block" objects, like Mighty Jill Off or something, I'd say just use objects. But for something with different depths, edges, corners, grasses, and terrains or whatever, I'd suggest creating it as a background, hitting the tileset check box, and doing it that way. You can change the depth that you place tiles in the room editor.

Ah yes, I just discovered this tileset thing.  INTERESTING.  Game Maker seems nifty... but this bottom left pixel thing will drive me to drink. 
Logged

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

Theme orange-lt created by panic