Gw Temp

Menu

Tutorial - 'Dodging minigame' by Awesome

An item about RPGMaker 2000 posted on

Blurb

How to create a minigame where the object is to dodge enemies or pellets

Body

Intro: Well, this is my 3rd tutorial now, Im think Im getting the hang of it :-P
This is an idea for creating a simple mini-game, this isnt anything complex yet - but I might make something later.

Anyway, what is it? Basically there are enemies or whatever wandering around OR objects are being throw/shot at you. You must get to the end without being
hit x number of times. Simple, I know, but hopefull some newbies will benefit.

Knowledge that might come in handy: Variables, forks, switches.

Here's where we learn:

Ok, first of all you want a charset of some sort of enemy/object. For example, a monster or ghost, or perhaps a fireball or something.

For this tutorial I will use a ghost. Create the terrain, Id suggest a fairly small path. Perhaps 8-10 boxes across and however long you want.
Plan it out, so that the player wont be able to stick to one side easily, and so that it will be challenging but not impossible.

Next come the events. Now, choose your charset, and give it a route. This route is important, as it will be what the player will
be trying to avoid, also make it on 'ignore if cant be moved, and repeat action'. Im sure this will require some testing to get the timing right. The frequency can be whatever you want, but I use 8.
The speed is also your choice - I used 3: x2 slower. And the starting condition must be 'On Touch (Event, Hero).
Also, for the event conditions make it if switch [0001:Ghost] is on.
In the events commands, we put this:

<>Play SE: Kill11
<>Flash Character....: Hero, 1s (W)
<>Variable Ch: [0002:HeroHealth] -,1

Ok, thats fairly simple. You can add whatever Sound Effect you want, you can even flash or shake the screen if you want to.
For mine, it plays a SE, the hero will flash and a vairable called Hero Health will have 1 number taken away from it.

Hero Health, will be how much health our hero has, for each time he is touched (hit) he loses 1 'health' which is decided by the variable. When
the variable = 0, the hero is dead or knocked out, whatever.

Now, we need to create a new event to keep track of the hero's health.
To make this look nice, lets create a picture for the heros health. This is very easy to do and it can be anything from a bunch of hearts, to a health bar.
I made a health bar, which can easily be made in paint. Just make a green square, with a black border. Now, depending on how much health your
hero has, this will change. But colour each section red. E.g. my hero has 4 health, so I coloured in 1/4 red 3/4 green. then 1/2 of each. Then 3/4 red, 1/4 green, and finally fully red.
Now, save your picture as .png or .bmp. Go into the export-import raw materials thing, this is in the toolbar and its the icon next to the musical note, with
2 arrows going opposite ways. Import in your picture (select the picture folder, click on import -> select your folder where your picture is, select the picture and open).
Now create a new event, doesnt matter where, but the best place is off to the side/corner so you can find it easily. Set the event conditions to Switch
0003:HealthBar is on, event start is parallel process, and its below hero with no graphic.

Now, we have to create some fork conditions for each state of health.
First make a fork, for full health.

<>FORK Optn: Varb[0002:HeroHealth]-#
<>Show picture: 1,FullHealthBar(225,50)
<>
:END Case

The # will be what your full health is for your hero. Mine is 4. Your X and Y position of the picture will also change, because of different sizes, so
just experiment. If you cant see your picture dont worry, it hasnt stuffed up, the picture is just off screen.
Now create these fork conditions for each of your states of health.
For your final state of health (HeroHealth = 0) show the final picture, then its your choice, if you want it to be game over, or just teleport the hero back
to the start. If you choose the latter, you'll want to restore his health so put another variable change saying:
Variable Ch:[0002:HeroHealth]Set,#
Where # is what you want his full health to be.

Here is what my event looks like (Max health = 4).

<>FORK Optn: Varb[0002:HeroHealth]-4
<>Show picture: 1,FullHealthBar(225,50)
<>
:END Case
<>FORK Optn: Varb[0002:HeroHealth]-3
<>Show picture: 1,3/4FullHealthBar(225,50)
<>
:END Case
<>FORK Optn: Varb[0002:HeroHealth]-2
<>Show picture: 1,1/2FullHealthBar(225,50)
<>
:END Case
<>FORK Optn: Varb[0002:HeroHealth]-1
<>Show picture: 1,1/4FullHealthBar(225,50)
<>
:END Case
<>FORK Optn: Varb[0002:HeroHealth]-0
<>Show picture: 1,EmptyHealthBar(225,50)
<>Messg: You have collapsed from taking too many hits,
: but after a rest your ready to go at it again.
<>Teleport:0003Forest(035,006)
<>Variable Ch:[0002:Health]Set,4
:END Case

Ok, now someone smart might be wondering, but how do we actually make the hero have the health in the first place?
Well you'll need something to start off the game, and thus your health.
This can be another parallel event.
In this, you can put the instructions or whatever. Just remember to turn it off (make a new page with a switch called 'MinigameIntroOver', and
when the first page is done, turn this switch on).
And remember to include the following in it:
Variable Ch:[0002:Health]Set,# (#=max health)
Change Switch: [0001:Ghost]-ON set
Change Switch: [0003:HealthBar]-ON set
Change Switch:[0004:Minigameintroover]-ON set

And also remember, after you reach the end/exit, turn off switches - 0001:Ghost and 0003:HealthBar and then erase picture 1. This will get rid of
the ghosts (or your enemies) and the health bar.

Thats it!

Possible Alterations: Have more then 1 area, you can turn off switch ghost, and then turn on switch ghost 2 and have a whole new wave of ghosts appear, and you have to make your way back.
Perhaps create some fireballs, being fired at you then returning to the summoner. How to make them return?
Goto the movement route you created, and after the fireball has reached its final destination, turn Trans. Up, a couple of times (8 or so), this will
make it fairly transparent, then turn the movement speed up, and make it return back to where it came from, then turn the transp. down and the movement speed down. If you find the right combination of transp + speed, it can look fairly effective.
You can also make health items to collect, to restore your full health, or just special items/secrets.
Its simple to make, but this 'obstacle course' of a minigame can be quite challenging and fun.