This week I wanted to contribute to an actual game project repo, with or without the #hacktoberfest tag as that was getting hard to sift through. I had identified wesnoth early on as something I'd like to contribute to when starting this course, so decided to see if they had any good first issues. I found this issue about fixing the sorting of terrain to sort by their translated name and not by the terrain id, which would have been something I could get my feet wet with. I noticed the maintainers didn't typically assign people to issues and usually just replied to people asking to work on an issue by telling them to go ahead and do it, so.. I didn't ask right away. Or at all. The issue had been opened since August, and I needed to figure out how to compile and run the source code to test changes first, so I spent some hours doing that. Once I figured out installing all the dependencies and compiling the game from source, I was ready to make the fix.. tomorrow, I thought. I was on break, there was no rush.
I woke up the next day and saw a PR fixing the issue, filed only a few hours after I had even found the issue. Not gonna lie, that sucked to see. There wasn't anything else that I felt I could contribute to at this time and I had already put in time trying to learn the codebase and compiling the game, so it was a colossal waste of time, at least until something else comes up. This put me down hard, and I put off doing any work until after reading week.
So, I needed to find something else, and it didn't take me long to find Shooter Carnival, which was a fresh community-driven project looking to create a feature-rich 2D shoot-em-up game like Galaga or Gradius. So fresh that I might be the first person outside of the maintainers to contribute some code.
Shooter Carnival is using the open source game engine Godot, which has a lot of similarity to python, so this is a two-pronged opportunity to learn Godot and contribute to a game project. And would you know it, the Godot github has tons and tons of open issues too.. So this doubles? triples? the number of things I'm interested in contributing to. I might have stumbled on something here.
As for the feature I contributed.. it was just setting up the player movement to work in 8 directions using WASD/Arrow keys, while keeping the player movement 'clamped' within the viewport.
extends CharacterBody2D
@export var speed: float = 200.0 # Movement setting
func _physics_process(delta: float) -> void:
    # Get input
    var input_vector := Input.get_vector("move_left", "move_right", "move_up", "move_down")
    # Set velocity based on input
    velocity = input_vector * speed
    # Move player
    move_and_slide()
    # Clamp position
    var screen_rect = get_viewport_rect()
    position.x = clamp(position.x, 0.0, screen_rect.size.x)
    position.y = clamp(position.y, 0.0, screen_rect.size.y)
Yeah I wasn't kidding, the project is fresh!
 

 
    
Top comments (0)