Commit graph

15 commits

Author SHA1 Message Date
3e61187065 add an .editorconfig.
and i also added some events for when i want the ball and enemy paddle to move.
2023-05-23 10:38:40 -07:00
604d79e654 the paddle can now scale to the resolution
i added a GameArea class which makes it easier to operate on in coordinates bounds with the GameCoordinate struct wrapper which does calculations for me. the GameArea class also has a normalization system which is how the ScalingManager can teleport items in bounds to relatively the same place when resized.

it took quite a while to get the paddle to teleport. looks like im supposed to modify the position inside IntegrateForces instead of PhysicsProcess which is my mistake.
2023-05-23 00:21:54 -07:00
e1b0fa338f add support for scaling the score ui.
the score ui seems to use the top left corner to start drawing the ui so i have to calculate things differently but this works!
2023-05-22 11:23:44 -07:00
7bae1587d2 add a scene wide scaling manager.
this is so i can scale all the objects to the proper positions and scales when the resolution changes.
2023-05-22 10:41:56 -07:00
41f7e7b1a0 the walls can now scale to the resolution
but the paddles and score text stay where they are. i plan on adding the paddles and score text moving later.
2023-05-21 19:41:48 -07:00
8ab2f09e62 optimize memory allocations
i made the allocations of objects go down a lot. which is cool :3!
2023-05-21 18:19:05 -07:00
425bf2ad27 make a settings menu and general refactoring
i added more to the main menu, as it has a settings menu now, that stores its files with json. i also changed the font to atkinson hyperlegible and made a BaseMenu class that takes care of the screen scaling for menus.

i also refactored the project folder structure to make it more organized.
2023-05-20 21:42:38 -07:00
f84479e03a make a main menu and score system
i added a main menu scene and a score system that is written in GDScript instead of C# for a change. the WallManager, the thing that detects collisions, calls the score method on the ScoreManager.
2023-05-19 19:42:56 -07:00
b27a44a9b3 build a proper working arm git plugin 2023-05-19 10:41:09 -07:00
9b0ebcefba walls can reset the ball to its starting position
WallManager binds to the BodyEntered signal on the Area2D class and
detects if the body that entered the area is the ball class, and if it
is, it will reset the ball to its starting position. right now, theres
no scoring system. this will be added later.
2023-05-19 00:18:38 -07:00
2805cd0e95 give each wall a seperate collider
this means i can detect if the ball hits the right or left wall, and it makes it easier to maintain.
2023-05-18 10:38:22 -07:00
4200a3e7df add enemy ai to the game
the enemy can now track the player with a cast that uses a shape generated in code. the enemy moves using some fancy math that gets the sign of the distance between the ball and the enemy paddles y position to get a normalised number for velocity and the velocity is lerped to smooth out any janky movement.
2023-05-17 23:41:40 -07:00
133e0fb734 move the maxRandomAngle double to an exported var.
this means you can set the maxRandomAngle in the inspector, without having to modify the code.
2023-05-17 10:52:55 -07:00
4681c2e620 add randomness to the ball and make the paddle smaller. 2023-05-16 23:47:24 -07:00
02c5b90415 make a basic prototype for a scene.
right now theres just a moving ball, inside a box, with a working paddle. i had to make the ball kinematic and tell the ball to bounce when it hits the other direction.
2023-05-16 23:15:31 -07:00