Sergant Brown - LaserTag Training - In-Game

Sergant Brown - LaserTag Training

Sergant Brown - LaserTag Training
PyWeek #31 entry for the theme "Cops"

Requirements
Python 3.7.4
PyGame 1.9.6

How to play
Starting the gameDouble-click on main.py, or open up a command prompt / terminal, and navigate to the directiory, and type python main.py

Movement
- Movement: WASD-keys
- Shooting: Left Mouse Button
- Aiming, Direction, Turning: Mouse
- Infrared Camera: Spacebar

Aim, Instructions
Finish all five laser tag arenas as quickly and with the fewest shots as possible.
You play the role of a sergant, namely Sergant Brown.
He has to shoot at most five criminals per arena (in each arena, there will be one more criminal).

You control the green policeman, the criminals have the colour red.  All are equipped with a laser tagging device.  You shoot where the green dot is.
The red dot shows where the criminals are aiming.  Beware about this.
Once you've been hit, you have to start all over again.
Eliminating all criminals advances you to the next arena.

Each arena is completely dark.  You won't see any walls, unless you use the infrared camera.  This makes everything, including criminals, visible for a short amount of time, until everyting goes black again, and you only see your and the enemies' aiming point.

You can use the infrared camera every five seconds, as shown by the indicator at the top "Infrared Camera: Yes/No".
Also, the current arena is displayed at the top.

Licenses
- Code: GNU General Public License 3
- Images, Sounds, Music: CC BY-NC
- Font: SIL Open Font License

Author
Jannik (Master47)

github.com/jannikisakoolprogrammer/SergantBrown

Awards

Give this entry an award

Scores

Ratings (show detail)

Overall: 3.3
Fun: 3.1
Production: 3.1
Innovation: 3.7

21% respondents marked the game as not working.
Respondents: 11

Files

File Uploader Date
SergantBrown-LaserTagTraining.jpg
Sergant Brown - LaserTag Training - In-Game
Master47 2021/04/03 21:55
Master47-SergantBrown-LaserTag-Training.zipfinal
Sergant Brown - LaserTag Training
Master47 2021/04/03 21:52

Diary Entries

Day 1 - Lazy sunday, still got things done

Got a few things done today, even though I have to admit, that it's been difficult for me personally to sit in front of the computer, and code stuff. So my game will be about Sergant "Peeler" Brown, who has to practice his shooting skills in a LaserTag arena.

There will be 1-6 criminals in an arena with walls.  The arena itself is completely dark.  The only thing that will be seen without any help is the collided shot fired by a laser pistol (red for criminals, green for our sergant).
The only additional help is an infrared camera, which can detect enemies (enemies can detect the player, too).  The longer the player uses the camera (button held down), the more energy it drains, and the bigger the detection area gets (max. 300px, but still kinda undecided).
Recharching is done when the button is not pressed.  The camera is always centered on the player.

Once the player is hit, the game is over. Likewise, if all of the criminals are hit, the game is over and the sergant has won.  Eliminating a criminal removes the criminal from the game.

I am too tired and will be too busy to implement a path-finding algorithm to be honest.  Criminals can move already randomly.  They will try to shoot the player if there are no walls in the way.  Shooting can be done at most every 2 seconds.  Criminals will shoot randomly every 2-4 seconds I think.

Here is a screenshot:
EDIT: The criminals (red circles here) WONT be seen in the final game, unless the infrared camera is used :) )

1 comment

Day 4 is it?

So, I managed to read up on path finding.
Well, so I read up on that famous A-Star one, and a couple of others.
I settled for the BFS one, https://en.wikipedia.org/wiki/Breadth-first_search, well, i tried to implement it somehow.
I am really happy, that it works.  Made some tests, here is one:
Path finding 1
Apart from that, I got nothing really done over the last 2 days (rather two evening sessions).

I programmed that while sitting on the sofa/couch haha.  It really did my head in lol.

But on a more serious note:  I don't know whether I will be able to finish?  it's not looking good.  Lots needs to be done still, it's not even a game yet.  Maybe I can do a long session on Friday?  Since it's a public holiday here in DE.
And maybe on Saturday.
Maybe I will take a step back from PyWeek after this one.

Alright, thanks for reading and good night all :D.

3 comments

Day 6 - I have a very basic game now

So yeah, the game can be played.  Either you shoot the two criminals or they shoot you.  Once one of the two things happen, the game is over.

There is no title screen, no menus, no stats etc.  I will add this tomorrow and try to polish everything.
No sound / music yet, gonna try to make something and add it.
Maybe i will add more maps.  I have a small script I use to make random maps.  Maybe 5 or so, and 1-5 criminals per map.

Usually, you only see yourself (green) and the lasers of both you and the crimnals, and their shooting effects.
But using space, you can use the radar, and for a short while, you will see everything, including walls.  Slowly everything goes black again, and you have to wait 5 seconds.

Movement is done via WASD, and aim is done with the mouse, while the radar can be used using SPACE.

Here are two screenshots.  Once you click the left mouse button, you shoot.  The hit where the shot went is shown with a small particle effect for both player and criminals.  The smaller red and green dots/circles denote where the shot would go if fired.

EDIT: Just come to think of it.  Unless the radar is used, you can't see the criminals.  Maybe I will remove the criminal aiming line (red).

Using the radar

On a personal note, I am happy that I still got a basic-game done, which is very very basic right now, but it can be called a game.  The CPU is quite "clever".  The CPU is NOT cheating btw.  It only uses the pathfinding algorithm once it has used the radar, and the CPU radar has the same cooldown of 5 seconds.  Otherwise it moves, aims and shoots randomly.

I will explain everything in detail tomorrow.

One last thing though: I have decided that this will be my last PyWeek for a while.  Being 31 years old and working full-time as a softdev is enough for me already, and during corona, I had to work even more, which has done me no good last year.  No burn-out yet, but my lead dev once told me to be careful.  So I gotta take care of myself more ;).  And I suggest everybody to do the same.

Add a comment

Day 7: I did it!

I am done.  Yeah, mentally and physically, too, hahaha.
It's been very exhausting.

The final version can now be downloaded, and played.

So I wanted to add the possibility for adding highscores to a highscore table, display the highscores, but did not have more time.
But hey, your score is still displayed once you've beaten all five arenas.

The game has sounds and music, too, so that's cool.

Alright, all that remains to say is thanks, köszönöm, danke.

3 comments