NEED HELP PROGRAMMING A SIMPLE MINIGAME
Posts
Pages:
1
Hey there! I've been trying to make a minigame in RPGMaker VX Ace. It's a simple game: you play a bird flying down a mountain, and you have to avoid obstacles that come your way. You can only move the bird left and right; not up and down.
Now, here's the thing. I was very much used to programming the RM2K-way, so there might be tons of easier ways to accomplish this, but at the moment, here's what I've done.
To restrict the movement of the player, I set up a bunch of events at same level priority to block the player off, like so:
The first thing that happens is the event in the corner sets the health variable for the player, then has the player character go in stepping animation and direction fix (so it's a strafing bird who continuously flaps its wings) then it activates a self switch to the next phase of the game which is currently unwritten.
My current problem lies with the obstacle: the boulder. Here's the event page:
(The move route is simply a looping Move Up and Through should be checked)
So basically, I want the boulder to deduce HP when it gets in contact with the player.
However, it's just... not doing it? If it's moving, it won't interact with the player at all, and the only time I can get it to actually deduce HP, I have to position myself above the boulder after it has already stood still. Am I doing something wrong here?
Now, here's the thing. I was very much used to programming the RM2K-way, so there might be tons of easier ways to accomplish this, but at the moment, here's what I've done.
To restrict the movement of the player, I set up a bunch of events at same level priority to block the player off, like so:

The first thing that happens is the event in the corner sets the health variable for the player, then has the player character go in stepping animation and direction fix (so it's a strafing bird who continuously flaps its wings) then it activates a self switch to the next phase of the game which is currently unwritten.
My current problem lies with the obstacle: the boulder. Here's the event page:

(The move route is simply a looping Move Up and Through should be checked)
So basically, I want the boulder to deduce HP when it gets in contact with the player.
However, it's just... not doing it? If it's moving, it won't interact with the player at all, and the only time I can get it to actually deduce HP, I have to position myself above the boulder after it has already stood still. Am I doing something wrong here?
Trigger has to be Event Touch, or it will only activate when the player moves into it, not when the event moves into the player.
Yes, I realized that myself shortly after making this post, however, the results have been the same: still the boulder passes by with nothing going on, and the event only triggering if I hover one tile above it after it's stopped moving.
EDIT: I stand corrected, now it is working all of a sudden. Thank you for replying!
EDIT AGAIN: For some reason, it only seems to be working if the player is also in motion? If the player remains motionless, the boulder just phases through.
It's been ages since I last used RM so I feel really rusty ahahaha.
EDIT: I stand corrected, now it is working all of a sudden. Thank you for replying!
EDIT AGAIN: For some reason, it only seems to be working if the player is also in motion? If the player remains motionless, the boulder just phases through.
It's been ages since I last used RM so I feel really rusty ahahaha.
Here's a suggestion for a better way to do this:
- Create another invisible event and set it on Parallel Process
- Use the Control Variables command in this event to record the player's X and Y coordinates as well as those of the boulder event.
- Use a conditional branch that checks if the boulder's X coordinate (the variable) is the same as the player's X coordinate, and insert a second conditional branch inside the first one that checks if both Y coordinates are equal.
- If all the coordinates are equal, then have the player lose HP just like you wanted. Don't forget to also add a short Wait command if that happens, so that the player won't keep getting hit by the same boulder a thousand times in one second.
I hope this helps.
- Create another invisible event and set it on Parallel Process
- Use the Control Variables command in this event to record the player's X and Y coordinates as well as those of the boulder event.
- Use a conditional branch that checks if the boulder's X coordinate (the variable) is the same as the player's X coordinate, and insert a second conditional branch inside the first one that checks if both Y coordinates are equal.
- If all the coordinates are equal, then have the player lose HP just like you wanted. Don't forget to also add a short Wait command if that happens, so that the player won't keep getting hit by the same boulder a thousand times in one second.
I hope this helps.
Pages:
1















