Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> [Example]Shooter Mini Game, cool mini game
Decedent
post Jan 30 2010, 01:00 AM
Post #1


Level 6
Group Icon

Group: Member
Posts: 86
Type: Developer
RM Skill: Advanced




*After some testing around the demo is probably not the best example, I just made this up quickly to use in my game so I wouldn't forget later. Promise to update this with a fleshed out demo in future

Demo
http://filefactory.com/file/a2g188g/n/Tutorial.exe
(scroll down, click the DOWNLOAD NOW and wait a bit) I don't realy like this but it's the only site I found I could upload and download the demo...

Statement
I've made a neat little mini game for my game, thought I would share it. It is inspired from a very old game I once played, called something along the lines of "Winter Olympics"... I'm sure the concept has been done since many times, so here is my method of implementing it into RPG Maker XP (havn't touched VX, same principals could apply?)

If you use this, I would appreciate if you credit me and let me know via PM or posting in this topic.

Demo is available if I can find a place to upload it too. I tried the rpgrevolution upload thing but It doesn't work... so i'm afraid the true bueaty of this post wont be appreciated till people play the demo.

Mini-Game Concept
You have a cross hair that is darting around the screen randomly, and a target to hit. By using the arrow keys, try to get a bullseye! Possible uses include Hostage situations, Still targets (although not penned down, I could explaion how to do this for moving targets).

How it's done
1. Create a Cross Hair picture (call it "Cross Hair", and a Target picture called "Target") import these into the game as 'pictures'
2. Create 4 Variables;
~CrossHair X Position
~CrossHair X Neg or Pos
~CrossHair Y Position
~CrossHair Y Neg or Pos
3. Create a switch called "Assasination attempt"

Easy part done. Now here comes a harder part.

4. Have an event which starts the minigame (in the demo, it is a man who asks you to save jonny).
a) Turn on "Assasination Attempt"
cool.gif Immobilise the player. We DON'T want the player able to move (I did this by teleporting events around the character so it was blocked in.
c) Show Picture "Target"
~Origin should be Center
~X position should be 320
~Y position should be 240 *these values can be changed, more on that in the last section

5. Create the "Succesful hit event"
a)Parallel Process
b)Conditional Branch
~IF Crosshair X Position is equal to, or greater than ?, then
~IF Crosshair X Position is equal to, or less than ?, then
~IF Crosshair Y Position is equal to, or greater than ?, then
~IF Crosshair Y Position is equal to, or less than ?, then
~SUCCESS (here is where you put what happens if you hit the right spot)
~else FAIL (so if the Cross Hair position doesn't meet all of those, this is the part where you place the series of events that happens when you fail)


6. Create the "Cross Hair Event" *this makes the cross hair move around of it's own free will.
a) Condition for this event working should be if "Assasination Attempt" switch is on
cool.gif Parallel Process
c) create a 'Loop' event
d) Show Picture "Crosshair"
~Set the Origin of the picture to Center (yes in the spoiler picture it is set to upper left by accident)
~ The X position should be 320, and Y should be 240
d) Inside the 'Loop' event do the following
~Control Variable "CrossHair X Neg or Pos" = Random value between 0 and 1
~Conditional Branch, If "CrossHair X Neg or Pos" = 0 (what makes the cursor move up)
~Set "CrossHair X Position" ADD (random value between 1 and 10)
~ Else Set "CrossHair X Position" SUBTRACT (random value between 1 and 10)

~Control Variable "CrossHair Y Neg or Pos" = Random value between 0 and 1
~Conditional Branch, If "CrossHair Y Neg or Pos" = 0 (what makes the cursor move up)
~Set "CrossHair Y Position" ADD (random value between 1 and 10)
~ Else Set "CrossHair Y Position" SUBTRACT (random value between 1 and 10)
e) At the end of this, add a "Wait" command. I set mine to a value of "Wait 1 Frame". The more frames, the slower the Cross Hair will move around, though I found 1 to be a good value.


7. Create the "Adjust Cross Hair" event. *this allows the player to try and move the cross hair around.
a) Parallel Process
cool.gif Conditional Branch
~If UP button is pressed, then Control Variable "CrossHair Y Position" SUBTRACT 10
~If DOWN button is pressed, then Control Variable "CrossHair Y Position" ADD 10
~If LEFT button is pressed, then Control Variable "CrossHair X Position" SUBTRACT 10
~If RIGHT button is pressed, then Control Variable "CrossHair Y Position" ADD 10


Thats the second part done. But you need to find out where you want players to be shooting! (The Hardest Part)

Determine Where the Bullseye is

My system is working with a square/rectangle Bullseye. If you want the bullseye a circle, you are in for a world of difficulty.
Here is my target;

I want players to aim for the kidnappers head. Anything less will result in failed mission. So I made a Rectangle, that would represent where I want the player to be able to shoot. It will be called "Bulls Eye" from now on (this doese not need to be imported into your game);

Notice it has a white dot in the center.
Now, assuming you followed my directions right, you now have a "Target" that is 'show picture' in your game with its origin as Center, and its X/Y being 320/240, we have the absolute center worked out.
1. Open your "Target" Picture in your image program.
2. Paste the "Bullseye" picture here, and move it to the absoluyte center of the image.
3. Move the Bullseye untill it is in the right spot
~Important, remember how many pixels you had to move the bullseye. I had to move mine UP 22 pixels


4. Now we need to work out 4 values, using a little bit of math.


(A) = Number of pixels you moved the bullseye left or right. If you moved it right, (A) should be (+ number of pixels). If you moved it left, (A) should be (- number of pixels).
(B ) = Number of pixels you moved the bullseye Up or Down. If you moved it Down, (A) should be (+ number of pixels). If you moved it Up, (A) should be (- number of pixels).

~Upper Left
~X= 320 (A) - (Length of your Bulls Eye divided by 2) = X Minimum
~Y= 240 (B ) - (Height of your Bulls Eye divided by 2) = Y Minimum
~Upper Right
~X= 320 (A) + (Length of your Bulls Eye divided by 2) = X Maximum
~Y= 240 (B ) - (Height of your Bulls Eye divided by 2) = Y Minimum
~Bottom Left
~X= 320 (A) - (Length of your Bulls Eye divided by 2) = X Minimum
~Y= 240 (B ) + (Height of your Bulls Eye divided by 2) = Y Maximum
~Upper Right
~X= 320 (A) + (Length of your Bulls Eye divided by 2) = X Maximum
~Y= 240 (B ) + (Height of your Bulls Eye divided by 2) = Y Maximum

W.T.F. you say in your head as you glance at this and ignore the time it took to write down in my drunken state. No worries, there is a demo remember. These values determine the Bullseye. If you scroll up, you will see that in step 5. I left the values as ?. You can see that the "CrossHair X Position" has to be between X Minimum, and X Maximum, same goes for the Y.


Variations
As stated right up the top, you could do this with moving targets, it would mean the Bulls Eye has to move, and you should probably set up a variable for the 'Upper Left', 'Upper Right' etc, becuase it will be constantly changing, and have the Succes event refer to these variables

Why should the cursor be a little red circle? Perhaps it should be Iron sights of a gun, or a crossbow with a cross hair. This would mean the Cross Hair absolute center wouldn't count unless u made the picture to the right scale.

There could also be multiple "Bulls Eye" sections (like a Dart Board) so if your shot didnt qualify for a "bullseye", it might for the next ring, or ring after that etc. Also, a shot could leave an image of a bullet hole (if it hit the "Target")

Becuase my game is still in development stage, I point out these Variations becuase I may use them in my game or not, and I want to be able to take credit for them.

If this didn't make sense, I would be happy to answer questions.

This post has been edited by Decedent: Feb 4 2010, 02:21 AM


__________________________
Go to the top of the page
 
+Quote Post
   
woahfish
post Feb 13 2010, 05:48 PM
Post #2


Level 1
Group Icon

Group: Member
Posts: 9
Type: None
RM Skill: Intermediate




mediafire is a good place to host files.

this looks pretty cool, might use it for fun..


__________________________


who cut the cheese?
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 18th May 2013 - 05:23 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker