Fighting with yourself (a "first person" spaceship battle)

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
87
Reaction score
25
First Language
English
Primarily Uses
RMMV
So, I've been developing a Star Trek fan game - and at some point I thought I should try to implement a space battle. My initial thought was that the easy way to do it, would be to have a top down view of your ship, and just shoot lasers at the enemy ship using Galv's Map Projectile's plugin - however I started wondering about how I'd do it in first person.


I'm sure to plenty of you, what I did here is pretty obvious. When you load the map, it loads a picture overlay of your ship's bridge with a reticle in the center. Space is a parallax. And it turns the player into the Klingon ship, so while it may look as if you are moving the reticle, you're actually moving the enemy you're fighting.

When you hit "ok" anywhere on the map, it flashes an image of your "laser" directed at the center of the screen. Now if you hit "ok" while the klingon ship is in the center, it plays a "hit" animation along with the laser, it also forces the klingon ship to jump somewhere else , so you'll have to find it again to shoot it again. Once you have shot it enough, it plays an explosion animation, and the klingon ship goes transparent.

Now, the hope would be that this would be on a time limit - so you have to find the klingon ship and fire upon it a certain amount of times (four in this case), before the timer runs out, as your ship will be sustaining damage every few seconds that go by.

Now here are the issues I am trying to trouble shoot.

1.) I think if I could get the parallax to move with the player character (the klingon ship) then it will give the illusion of moving the Enterprise's view better. I feel like there was a time I accidentally had a parallax move with a character in the past, and I can't figure out how to repeat that "mistake."

2.) To make it an actual challenge, I need the klingon ship to every now and then move randomly. I tried to set a timer to move the player randomly every 10 seconds, but I can't seem to get the timer to budge and so instead it moves the player character constantly, which makes it impossible to move the reticle onto the klingon ship, as the player suddenly has zero control.

3.) When the player gets close to the edge of the "screen" I was having it transfer the player to the opposite side of the screen, like Pac Man. Not sure if this is the best way to handle this.

I am open to any suggestions on how to make this work better.

Below are some screen captures.
 

Attachments

Jesse - PVGames

Game and Graphics Developer
Veteran
Joined
Jun 23, 2012
Messages
1,753
Reaction score
2,750
First Language
English
Primarily Uses
This is a very clever implementation of the mechanics, well done! It is pretty amazing the type of things you can come up with with a little imagination :)
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
87
Reaction score
25
First Language
English
Primarily Uses
RMMV
Still an incomplete idea at the moment but I am hoping I am on the right path. Thank you for the support :)
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
87
Reaction score
25
First Language
English
Primarily Uses
RMMV
This post didn't seem to capture the dev imaginations the way I had hoped it would, lol.
An update - I figured out how to get the parallax to change depending on which direction you move . I set up a conditional branch, and had the parallax switch from left to right, or up to down, depending on which way your "player" is facing. I would like to get it so that it only moves while you're moving it, instead of continuing to move even when you are no longer pressing left, right, down, or up.

My biggest issue right now - is getting the klingon ship (which is actually being controlled by the player) to occasionally move at random. I can set it so that the ship is constantly moving at random, but the player needs to get control of the ship every few seconds so that they can put it under the reticle.

My thinking was that I could set up a timer and then a conditional branch which would make the ship move in a random direction every few seconds, but for some reason I am having trouble getting that to work.

The map is covered with switches, that when one clicks "enter" will cause the Enterprise to fire its phasers at the reticle (with only the switch directly under the reticle being the one that causes an "explosion" along with the phaser beam).

I am thinking an alternative to relying on random movement with a timer, is to randomly have certain switches be activated through touch, and when activated they will make the Klingon ship abruptly turn, or perhaps cloak, and teleport the player to another part of the screen.
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
87
Reaction score
25
First Language
English
Primarily Uses
RMMV
Okay - my experiment with having the klingon ship jump to different parts of the map if it randomly touches certain switches seems like it'll work.

My next hurdle is one that I am not certain is possible to deal with - when the parallax shifts from going left or right, it is smooth, but when it shifts from going in a horizontal direction, to going in a vertical direction ( and vice versa), the transition is janky and jarring.
 

mlogan

Global Moderators
Global Mod
Joined
Mar 18, 2012
Messages
14,153
Reaction score
7,804
First Language
English
Primarily Uses
RMMV

@JayIsrael , please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.


Or triple post, in this case - posting after yourself with no replies in between. 72 hours after your last reply, you are allowed to do this to bump your post.

Also, please keep in mind that this section, MV Support, is for getting help getting things to work, not for fleshing our ideas.l or getting feedback on concepts and such. Since you do seem to have some semblance of support question, I’m leaving this here for now, but some of it seems better suited to Ideas & Prototypes.
 

mathmaster74

just...John
Veteran
Joined
Jun 12, 2016
Messages
285
Reaction score
192
First Language
English
Primarily Uses
RMMV
only moves while you're moving it
@JayIsrael If: Script: $gamePlayer.isDashing(); will return true if the player is moving with dash on.
If: Script: $gamePlayer.isMoving(); will return the same for moving without dash.

If you create an event that constantly checks these conditions (with an else branch to cover the "if not dashing and not moving" condition), then you can deactivate the move route page with the else code and activate it with the code that returns true. Hope it helps! :smile:

P.S. Yes. Your post caught my imagination. I'll let you know if I have any more answers for you. Keep at it! :biggrin:

Sincerely,
 

JayIsrael

Veteran
Veteran
Joined
May 16, 2019
Messages
87
Reaction score
25
First Language
English
Primarily Uses
RMMV
Ooh man, I'm sorry about that. :( That's embarrassing. I was aware of the double posting rule and forgot that what I was doing would constitute that. I was thinking "oh - I solved this issue, I should update to let anyone who might be following this know what's up."
But yeah - that was my mistake. I am so sorry about that. :-(
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

Seems like people have stopped looking both ways before crossing the road nowadays. Blindly walking out into a into a road only ends in disaster.
Just finished planning out the skeleton of the main quest line of my new game. I'm so excited for it!
Integrating Jason Perry's japan tile set while listening to Murray Atkinson's Heaven and Earth background music.
I forgot I had an account on rpgmakercentral lol
"What do you think the best place to visit on this cold days?" "Hell..."

Forum statistics

Threads
94,539
Messages
921,737
Members
124,406
Latest member
keyboardjockey
Top