Added new assets

This commit is contained in:
2026-05-27 01:43:30 +03:00
parent 20309da2af
commit c606bd315e
22 changed files with 275 additions and 62 deletions
+8 -2
View File
@@ -42,7 +42,10 @@ struct GameConfig {
int maxScoreOption = 0; // 0 = 5, 1 = 11, 2 = 15, 3 = 21
int maxScore = 5;
bool sfxEnabled = true;
int selectedSettingLine = 0; // 0 = Resolution, 1 = Framerate, 2 = Screen Mode, 3 = Score Limit, 4 = Sound, 5 = Back
int spaceThemeOption = 0; // 0 = Default, 1 = Galaxy, 2 = Trap
int ballThemeOption = 0; // 0 = Default, 1 = Banana, 2 = Beach, 3 = Cloudy, 4 = Simple
int paddleThemeOption = 0; // 0 = Default, 1 = Cloudy, 2 = CPU, 3 = Human
int selectedSettingLine = 0; // 0 = Resolution, 1 = Framerate, 2 = Screen Mode, 3 = Score Limit, 4 = Sound, 5 = Space, 6 = Ball, 7 = Paddle, 8 = Back
};
struct GameContext {
@@ -69,12 +72,13 @@ struct GameContext {
Texture2D LoadTextureFromResource(int id);
Sound LoadSoundFromResource(int id);
void SetWindowIconFromResource(int id);
// Forward declarations
class Ball;
class Paddle;
class CpuPaddle;
void ApplyPaddleTextures(const GameContext& ctx, Paddle& player, CpuPaddle& cpu);
// Game state update and draw routines
void ResetBall(Ball& ball);
void DrawCourt(const GameContext& ctx, int screenWidth, int screenHeight);
@@ -121,6 +125,7 @@ public:
bool Update() override;
void Draw() override;
void ReloadTexture(int resourceId);
};
class Ball : public GameObject {
@@ -147,6 +152,7 @@ public:
bool Update() override;
void Draw() override;
void ReloadTexture(int resourceId);
};
class CpuPaddle : public Paddle {
+1
View File
@@ -1,4 +1,5 @@
#pragma once
#include <iostream>
#include <vector>
#include <string>
+2 -1
View File
@@ -1,4 +1,5 @@
#pragma once
#include "game.h"
#include <string>
#include <vector>
@@ -22,7 +23,7 @@ public:
// Settings and lobby routines
void ApplyResolution(int width, int height);
void ApplyFramerate(int option);
void UpdateSettingsState(GameContext& ctx);
void UpdateSettingsState(GameContext& ctx, Ball& ball, Paddle& player, CpuPaddle& cpu);
void DrawSettingsState(const GameContext& ctx, int screenWidth, int screenHeight);
void UpdateLobbyState(GameContext& ctx);
void DrawLobbyState(const GameContext& ctx, int screenWidth, int screenHeight);
+26 -11
View File
@@ -1,15 +1,30 @@
#pragma once
#define IDI_ICON1 100
#define IDI_ICON1 100
#define IDR_TEX_BASIC_SPACE 101
#define IDR_TEX_WALLS 102
#define IDR_TEX_LINE 103
#define IDR_TEX_BALL 104
#define IDR_TEX_PADDLE 105
#define IDR_TEX_PADDLE2 106
// Backgrounds
#define IDR_TEX_SPACE_DEFAULT 101
#define IDR_TEX_SPACE_GALAXY 107
#define IDR_TEX_SPACE_TRAP 108
#define IDR_TEX_WALLS 102
#define IDR_TEX_LINE 103
// Balls
#define IDR_TEX_BALL_DEFAULT 104
#define IDR_TEX_BALL_BANANA 109
#define IDR_TEX_BALL_BEACH 110
#define IDR_TEX_BALL_CLOUDY 111
#define IDR_TEX_BALL_SIMPLE 112
// Paddles
#define IDR_TEX_PADDLE_DEFAULT 105
#define IDR_TEX_PADDLE_CLOUDY 106
#define IDR_TEX_PADDLE_CPU 113
#define IDR_TEX_PADDLE_HUMAN 114
// Audio
#define IDR_SND_PADDLE_HIT 201
#define IDR_SND_WALL_HIT 202
#define IDR_SND_SCORE 203
#define IDR_SND_BANANA 204
#define IDR_SND_PADDLE_HIT 201
#define IDR_SND_WALL_HIT 202
#define IDR_SND_SCORE 203
#define IDR_SND_BANANA 204