First Person Shooter Mechanics
Terror on The Turnpike » Devlog
Terror on the Turnpike features a first person shooter scene, and I wanted to share how I did this. I was initially inspired by Opossum Country by Ben Jelter. I began thinking about how to do this. I also joined a game jam for first person and I thought this was a good thing to try. This DevLog Will document how I completed it, and what I may change for next time.
- Set Up
- Scene: You will need a 160x144 Scene for you back drop
- Target: This is a sprite, whatever you are aiming at.
- Crosshairs: This is your player, in this case I set it up as a crosshair. Note: You can narrow the collision area in the SPRITE MENU to make it more precise to the dot of the sites.
- Type of Scene: Select Point and Click, so the cross hairs can cross over the target.
- Moving the Target Around
- Recommend adding 2 extra sprites for your "On update" Script to move the target around, count rounds and hits.
- MATH FUNCTION Random Number Generator will be used on a sprite (A BUTTON). In a LOOP I put MATH FUNCTION RANDOM NUMBER GENERATOR and then if then statements to say if NUMBER =1,2,3,4... move to this position and so on. I put a 1 second WAIT right after the generation to set that as the interval. This will have the target hopping around every 1 second, in theory. (the same number could hit twice in a row). So in my case, the A BUTTON Sprite is generating random numbers that cause the target to hop around.
- Shooting and Reloading
- Set up a variable for HITS.
- Set up a variable for ROUNDS.
- ON INIT of the scene, Set up a script for the A Button to subtract 1 round using MATH FUNCTION (clamp at 0 especially if using the tile switching). For me when pressing A, I shows an overlay for 0.2 seconds to give the appearance of a flash.
- ON INIT of the scene, set up a script for the B Button to set ROUNDS back to 15. This gives the player a sense of reloading.
- The player can see the numbers on the top center.
- Hitting the Target
- Effects on Interact: ON INTERACT of the TARGET SPRITE, I had it add 1 to HITS and the A SCRIPT subtracted 1 from ROUNDS. The sprite also flashes (HIDE, WAIT 0.2s, SHOW) and shows DIALOGUE
- Keeping track of rounds used: The B BUTTON Sprite is keeping track of rounds using an IF STATEMENT in ON UPDATE - prompts the player to reload when ROUNDS = 0. This sprite is also conducting the tile switching for ROUNDS with GBVM script.
- Keeping track of reloading. B BUTTON flashes the dialogue to reload, also in ON UPDATE.
- Defeating the target: B BUTTON is also keeping track of HITS. When that variable = 5, the target falls to the ground. This sprite is also conducting the tile switching for HITS with GBVM script, also in ON UPDATE.
Items that could make it harder or easier are the wait time for the random number generator, cursor speed, and collision area for the sites.
The .gbsproj is attached for your use. Enjoy!
Files
FPS_DEMO_WEB.gbsproj 138 bytes
23 hours ago
Get Terror on The Turnpike
Download NowName your own price
Terror on The Turnpike
Not your average shift as a toll collector.
Status | Released |
Author | Ant Caruso |
Genre | Shooter |
Tags | First-Person, Game Boy, Game Boy ROM, Homebrew, Horror, My First Game Jam |
Leave a comment
Log in with itch.io to leave a comment.