The RPG Maker Resource Kit

Other Game Creation => Other Game Making Programs => Topic started by: Luna on March 10, 2008, 08:24:38 AM

Title: Some Game Maker Tutorials
Post by: Luna on March 10, 2008, 08:24:38 AM
I'm not sure if it's okay for me to post in a section that seems inactive, but then before I learned how to use RPG Maker, I used to use Game Maker (But I'm currently learning how to use C++ and C# right now, so I'm dropping Game Maker). I guess I can post tutorials of what I know and have used myself (I kinda made things that I really don't see common, so yeah.) However, these tutorials require GM6.1 registered or higher, sorry, I don't use GM7 Lite yet. I only used GM6.1 so far and I'm fine with what I have.


Tutorial 1: Simple Fading Effect
Spoiler for:
Are you one of those people who can't make those awesome explosion things that show up when enemies pop into the screen? Do you want them to simply make a smooth appearance? Well continue reading then!

1. In the create event, stick in a variable named "alpha" or something. Also make a variable named event or something. These two should be equal to 0.

Code: [Select]
alpha=0 //Set the alpha
event=0 //Event of Alpha

Example Shot (http://img329.imageshack.us/img329/9099/fade1wd9.png)

2. If you understood that, go into the step event. This code could help you out.

Code: [Select]
//Smooth Fading Transition
image_alpha=fade //This is the most important part! Don't remove it!
if event=0 {if alpha<1 {alpha+=0.05;} else {event=1}}
if event=1 {if alpha>0 {alpha-=0.05;} else {event=0}}

//Note: At the end of Event=1, you can change the "else {event=0}" to anything you want.
//You'll need to keep else in the code though, or else it messes up.

Example Shot (http://img262.imageshack.us/img262/5948/fade2ze5.png)

Yeah, I know it's nothing big, but I think it's better than popping in from nowhere and disappearing right away too. It works nice for some sparks.

Tutorial 2: Drawing a cursor to a mouse
Spoiler for:
Did you ever want to draw a spinning target to the mouse position? It's pretty much a simple code! However, I have found different methods for this.

Method 1: If you want the mouse x and y to meet at a location first, you can use the draw feature.
Code: [Select]
//Draw Event

draw_sprite(mouse_x,mouse_y,spr_MouseCursor)
You can do whatever. If you have registered or pro, you can expand that option to this one.
Code: [Select]
//Draw Event (For Pro or GM6.1 Registered)

draw_sprite_ext(spr_MouseCursor,image_index,mouse_x,mouse_y,1,1,0,c_white,image_alpha)
Now once you prepare your cursor, you'll need to setup the x and y collisions or something.
Code: [Select]
//Step Event!

if mouse_x=50 && mouse_y=25 {action=true}
Yeah, you'll have to edit that. Change the number, and the action=true part.


Method 2: I personally find this way to be easier. There's two options for the animated cursor then. One is to KEEP the image plain (for Pro/Registered) or the alternate way is to use Game Maker's sprite rotation feature in the sprite editor.

Alt 1: In the cursor object, setup the sprite. In the step event, add this code.
Code: [Select]
//Step Event (Pro/Registered Only!)
image_angle+=18 //You can change the number
Once you finish with that, you're set to go. Just make a collision event to indicate whatever.

Alt 2: In the sprite editor, make a copy of the sprite just incase you need the original. In your sprite, make a rotation by going to Animation>Rotation>whichever direction you desire. After that, you can just save that sprite and load it up into your object, no real code needed.

Umm .. if you use these tutorials, all I could really say is that there is no credit needed really since I figured that it's better for me to share than to keep to myself and so on. I'll be adding more tutorials when I get the chance. Maybe I'd do more complicated things too probably.
Title: Re: Some Game Maker Tutorials
Post by: Revo on March 11, 2008, 01:51:50 AM
Nice. I've worked with Game Maker a bit. Always tended to suck at it. :-\ These are nice though, good job. ;D
Title: Re: Some Game Maker Tutorials
Post by: Luna on March 11, 2008, 03:08:12 AM
I would've posted more tutorials too. Only it's that I don't want to spend so much time. I guess I can probably help out with the game maker section of this area anyways.