-
Notifications
You must be signed in to change notification settings - Fork 53
Feature 6 movement and collision #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Sourav328
wants to merge
22
commits into
outscal:main
Choose a base branch
from
Sourav328:Feature-6_Movement-And-Collision
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature 6 movement and collision #51
Sourav328
wants to merge
22
commits into
outscal:main
from
Sourav328:Feature-6_Movement-And-Collision
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Adding all the Setup File.
Introduced GameWindowManager class to encapsulate SFML window creation, rendering, and lifecycle management. Updated Main.cpp to use the new manager, and modified project files to include the new source and header. Removed placeholder SFML directory file.
Add GameWindowManager for window handling
Changed game window creation to use desktop fullscreen mode and updated the clear colour from black to red. Also performed minor code formatting improvements.
Update game window to fullscreen and change clear color
Introduced EventManager class to encapsulate event polling and key press detection using SFML. Updated Main.cpp to use EventManager for handling window events, and changed the game window title. Project files updated to include new source and header files.
Add EventManager for handling window events
Introduced isLeftMouseButtonClicked() to EventManager and updated event polling to detect and log left mouse button clicks with their positions. Also changed game window creation to use a fixed size and windowed mode instead of fullscreen.
Add left mouse button click handling to EventManager
Introduced a new GameLoop class to encapsulate the main game loop logic, including initialization, event polling, updating, and rendering. Refactored Main.cpp to use GameLoop, updated GameWindowManager with clearer window management methods, and adjusted project files to include the new class.
Add GameLoop class and refactor main loop structure
Introduced Ball, Paddle, and GameplayManager classes to handle core gameplay elements. Updated GameLoop to integrate GameplayManager and render gameplay objects. Project files updated to include new source and header files.
Add basic gameplay classes for Pong
Replaced Ball's CircleShape with a Sprite using a texture for improved visuals. Added texture loading and initialization methods, updated member variables, and adjusted render logic to draw the textured sprite instead of a simple shape.
Refactor Ball to use textured sprite
Refactored the game loop and window management to use stack-allocated objects instead of pointers, removed unnecessary global using statements, and improved encapsulation. Updated Ball and Paddle classes to use SFML shapes and textures directly, added movement logic for paddles, and centralized event handling. The GameplayManager now updates paddle positions based on keyboard input, and rendering is streamlined for better maintainability.
Introduced a Boundary class to handle game boundaries and center line rendering. Integrated boundary rendering into GameplayManager, updated project structure to move Paddle files into a subdirectory, and performed minor code style improvements and constructor additions for GameWindowManager.
Implemented ball movement and collision detection with paddles in Ball class. Added velocity handling, boundary checks, and ball reset on out-of-bounds. Paddle class now exposes paddle sprite for collision and includes reset functionality. Updated GameplayManager to call new ball update and collision methods.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.