Skip to content

Commit 2fbc110

Browse files
committed
Beta phase.
1 parent fc14d16 commit 2fbc110

File tree

5 files changed

+37
-15
lines changed

5 files changed

+37
-15
lines changed

BreakoutRedux/include/Ball.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ class Ball {
99
double speed;
1010

1111
void Draw() {
12-
//DrawTexture(GetImage(spriteSheet, sprites_ball00_idx), x - radius, y - radius);
12+
DrawTexture(GetImage(spriteSheet, sprites_ball00_idx), x - radius, y - radius);
13+
return;
1314
C2D_DrawEllipse(x - radius, y - radius, 0.0, radius * 2.0, radius * 2.0, C2D_Color32(0xFF, 0x00, 0x00, 0xFF), C2D_Color32(0xFF, 0x00, 0x00, 0xFF), C2D_Color32(0xFF, 0x00, 0x00, 0xFF), C2D_Color32(0xFF, 0x00, 0x00, 0xFF));
1415
C2D_DrawEllipse(x - radius + 1.0, y - radius + 1.0, 0.0, radius * 2.0 - 2.0, radius * 2.0 - 2.0, C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF));
1516
}
@@ -156,9 +157,10 @@ class Ball {
156157
x = sX;
157158
y = sY;
158159
radius = sRadius;
159-
degree = 3150;
160+
do
161+
degree = (rand() % 1400) + 2000;
162+
while (degree > 2650 && degree < 2750);
160163
speed = 0;
161-
//Update(sBricks, sPaddle); //why would I need this? would do literally nothing since the ball isn't moving lol
162164
}
163165
void SetDegree(int deg) {
164166
degree = deg;

BreakoutRedux/include/Brick.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ class Brick {
1010
return new double[4]{ x, y, width, height };
1111
}
1212
void Draw() {
13-
C2D_DrawRectangle(x, y, 0, width, height, C2D_Color32(0x00, 0x00, 0xFF, 0xFF), C2D_Color32(0x00, 0x00, 0xFF, 0xFF), C2D_Color32(0x00, 0x00, 0xFF, 0xFF), C2D_Color32(0x00, 0x00, 0xFF, 0xFF));
14-
C2D_DrawRectangle(x + 1, y + 1, 0, width - 2, height - 2, C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF));
15-
return;
13+
//C2D_DrawRectangle(x, y, 0, width, height, C2D_Color32(0x00, 0x00, 0xFF, 0xFF), C2D_Color32(0x00, 0x00, 0xFF, 0xFF), C2D_Color32(0x00, 0x00, 0xFF, 0xFF), C2D_Color32(0x00, 0x00, 0xFF, 0xFF));
14+
//C2D_DrawRectangle(x + 1, y + 1, 0, width - 2, height - 2, C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF));
15+
//return;
1616
//above is temp
1717
switch (type) {
1818
case 1:

BreakoutRedux/include/Game.hpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,27 @@ class Game {
3636
//[original code] pp2d_draw_texture_scale(extraBallID[i], (tBall.trail_new_frame_circle[i].x - tBall.trail_new_frame_circle[i].rad) + 1.0, (tBall.trail_new_frame_circle[i].y - tBall.trail_new_frame_circle[i].rad) + 2.0, (7 - i) / 8.0, (7 - i) / 8.0); //RGBA8(0xFF, 0xFF, 0xFF, 32 * (7 - i))
3737
for (Ball* ball : balls)
3838
ball->Draw();
39-
for (Powerup* powerup : powerups)
40-
C2D_DrawRectangle(powerup->x, powerup->y, 0, powerup->width, powerup->height, C2D_Color32(0x00, 0xFF, 0x00, 0xFF), C2D_Color32(0x00, 0xFF, 0x00, 0xFF), C2D_Color32(0x00, 0xFF, 0x00, 0xFF), C2D_Color32(0x00, 0xFF, 0x00, 0xFF));
39+
for (Powerup* powerup : powerups) {
40+
//C2D_DrawRectangle(powerup->x, powerup->y, 0, powerup->width, powerup->height, C2D_Color32(0x00, 0xFF, 0x00, 0xFF), C2D_Color32(0x00, 0xFF, 0x00, 0xFF), C2D_Color32(0x00, 0xFF, 0x00, 0xFF), C2D_Color32(0x00, 0xFF, 0x00, 0xFF));
41+
//continue;
42+
switch (powerup->type) {
43+
case 0:
44+
DrawTexture(GetImage(powerupSheet, powerups_laser00_idx + (int)(powerup->y / 8) % 6), powerup->x, powerup->y);
45+
break;
46+
case 1:
47+
DrawTexture(GetImage(powerupSheet, powerups_paddle_big00_idx + (int)(powerup->y / 8) % 6), powerup->x, powerup->y);
48+
break;
49+
case 2:
50+
DrawTexture(GetImage(powerupSheet, powerups_paddle_small00_idx + (int)(powerup->y / 8) % 6), powerup->x, powerup->y);
51+
break;
52+
case 3:
53+
DrawTexture(GetImage(powerupSheet, powerups_life00_idx + (int)(powerup->y / 8) % 6), powerup->x, powerup->y);
54+
break;
55+
case 4:
56+
DrawTexture(GetImage(powerupSheet, powerups_multi_ball00_idx + (int)(powerup->y / 8) % 6), powerup->x, powerup->y);
57+
break;
58+
}
59+
}
4160
}
4261
int Lives() {
4362
if (balls.size() == 0) {

BreakoutRedux/include/Paddle.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ class Paddle {
1414
return new double[4]{ x, y, width, height };
1515
}
1616
void Draw() {
17-
C2D_DrawRectangle(x, y, 0, width, height, C2D_Color32(0xFF, 0xFF, 0x00, 0xFF), C2D_Color32(0xFF, 0xFF, 0x00, 0xFF), C2D_Color32(0xFF, 0xFF, 0x00, 0xFF), C2D_Color32(0xFF, 0xFF, 0x00, 0xFF));
18-
C2D_DrawRectangle(x + 1, y + 1, 0, width - 2, height - 2, C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF));
19-
return;
17+
//C2D_DrawRectangle(x, y, 0, width, height, C2D_Color32(0xFF, 0xFF, 0x00, 0xFF), C2D_Color32(0xFF, 0xFF, 0x00, 0xFF), C2D_Color32(0xFF, 0xFF, 0x00, 0xFF), C2D_Color32(0xFF, 0xFF, 0x00, 0xFF));
18+
//C2D_DrawRectangle(x + 1, y + 1, 0, width - 2, height - 2, C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF), C2D_Color32(0x95, 0x95, 0x95, 0xFF));
19+
//return;
2020
switch (size) {
2121
case 0:
2222
DrawTexture(GetImage(spriteSheet, sprites_paddle_small_idx), x, y);

BreakoutRedux/source/BreakoutRedux.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ C2D_SpriteSheet powerupSheet;
1212

1313
PrintConsole bottomScreen, infoKillWindow;
1414

15-
std::string VersionText = " Alpha ", VersionNumber = "02.01.00";
16-
std::string BuildNumber = "20.04.10.2100", EngineVersion = "01.00.00";
15+
std::string VersionText = " Beta ", VersionNumber = "01.00";
16+
std::string BuildNumber = "20.04.13.0145";// , EngineVersion = "01.00.00";
1717

1818
std::string ConsoleMove(int x, int y);
1919
std::string ConsoleColor(std::string foreground, bool bright);
@@ -322,9 +322,10 @@ int main(int argc, char **argv) {
322322
consoleClear();
323323
std::cout << ConsoleColor("0", false);
324324
std::cout << " Tap red area any time to exit";
325-
std::cout << " Breakout Version: " << ConsoleColor(RedF, false) << VersionText << " " << ConsoleColor(YellowF, false) << VersionNumber;
325+
std::cout << " Breakout Version: " << ConsoleColor(RedF, false) << VersionText << " " << ConsoleColor(YellowF, false) << VersionNumber;
326326
std::cout << ConsoleColor(GreenF, RedB, false) << " Build: " << BuildNumber;
327-
std::cout << ConsoleColor(GreenF, RedB, false) << " ISHUPE Engine Version: " << EngineVersion;
327+
std::cout << " "; // maybe add a randomized message
328+
//std::cout << ConsoleColor(GreenF, RedB, false) << " ISHUPE Engine Version: " << EngineVersion;
328329
UpdateText = false;
329330
}
330331

0 commit comments

Comments
 (0)