An open API service indexing awesome lists of open source software.

https://github.com/iamstrix/winforms-2d-shooter-sandbox

A 2D shooter made in WinForms with self-programmed bullet trajectory calculation. Features sandbox tools and live statistics. Discontinued due to discovery of WinForms' strict integer-based component coordinate system.
https://github.com/iamstrix/winforms-2d-shooter-sandbox

csharp visual-studio winforms

Last synced: 2 months ago
JSON representation

A 2D shooter made in WinForms with self-programmed bullet trajectory calculation. Features sandbox tools and live statistics. Discontinued due to discovery of WinForms' strict integer-based component coordinate system.

Awesome Lists containing this project

README

          

# Discontinued 2D shooter with sandbox tools to apply OOP concepts.

C#, .NET, WinForms, Visual Studio

Throughout development, I realized that WinForms only uses integers for component coordinates, leading to floor division when calculating bullet trajectory, which ultimately ruined the whole thing. Programming the bullet trajectory calculation by myself was the aspect I had the most fun with during this project. The caveat for the trajectory calculation, though is that bullet velocity scales depending on how far the target is from the player, as I could not perform vector normalization given the limitation of WinForms' strict integer data type usage.

Screenshot 2025-12-18 033639

*player shooting bullets, with enemies on screen*

Screenshot 2025-12-18 033900

*player alongside all enemies displayed*

Player features:
- Shoot bullets, click anywhere

Enemy features:
- Three enemy types
- Normal
- Boss
- Superboss

Sandbox tools:
- Player x, y relocation
- Adjust bullet speed - random x, y changes to initial velocity
- Adjust bullet spread variance - scale of x, y variance for each builet
- Adjust bullet shoot count - how many bullets are shot per click
- Spawn enemy button
- Remove all bullets on screen
- Remove all enemies on screen

Statistics display (upper left and right-most side):
- Mouse coordinates
- Player coordinates
- Last-clicked coordinates
- Object count
- Velocity (old testing statistic, can't bother to fix/remove)
- Bullet bounce limit
- Enemy count
- Bullet count
- Player to current mouse distance for trajectory calculation
- Calculated trajectory (displays different x, y quotients as the formula for this label uses a different divisor value than the actual bullet trajectories displayed at the right-most portion of the program
- Bullet trajectory history at the right-most side - shows actual bullet trajectory values

Feature I did not bother fixing:

image

- Old manual bullet trajectory adjuster, before I programmed my own click-to-shoot trajectory calculation

# Run Without Visual Studio
1. Open Terminal
2. Clone repository to a specified file path
3. cd into file path with the solution file *.\shooter\winforms-2d-shooter\RogueLike1*
4. run dotnet restore
5. run dotnet run