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
|
 |
« 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.  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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
 |
« 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. 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
|
 |
« 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: 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... /* 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
|
 |
« 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
|
 |
« 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
|
 |
« 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
|
|
|
|
___
Vice President of Marketing, Romeo Pie Software
Level 10
|
 |
« 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
|
|
|
|
___
Vice President of Marketing, Romeo Pie Software
Level 10
|
 |
« 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
|
|
|
|
|