Skip to content

Commit

Permalink
🐳 adding first ball
Browse files Browse the repository at this point in the history
  • Loading branch information
FelipeFTN committed Apr 21, 2023
1 parent 838f760 commit 1fdd4ad
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Game.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
make && ./bin/Game
make clean
make
./bin/Game
Binary file removed bin/Game
Binary file not shown.
2 changes: 1 addition & 1 deletion src/ball/ball.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ Ball::Ball(int sWidth, int sHeight) {
}

void Ball::Draw() {
DrawTexturePro(ball, sourceRec, destRec, origin, 0.f, WHITE);
DrawTextureRec(ball, ballRec, ballPos, WHITE);
}
9 changes: 4 additions & 5 deletions src/ball/ball.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ class Ball {

private:
Texture2D ball = LoadTexture("assets/ball.png");
int screenWidth = 0;
int screenHeight = 0;
int screenWidth = 512;
int screenHeight = 512;
int ballWidth = ball.width;
int ballHeight = ball.height;
Rectangle sourceRec = { 0.0f, 0.0f, (float)ballWidth, (float)ballHeight };
Rectangle destRec = { screenWidth/2.0f, screenHeight/2.0f, ballWidth*2.0f, ballHeight*2.0f };
Vector2 origin = { (float)ballWidth, (float)ballHeight };
Vector2 ballPos { 50, 50 };
Rectangle ballRec { 0, 0, (float)ballWidth, (float)ballHeight };
};
Binary file removed src/ball/ball.o
Binary file not shown.
1 change: 0 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "map/map.h"

int main() {

const int screenWidth = 512;
const int screenHeight = 512;

Expand Down
Binary file removed src/main.o
Binary file not shown.
Binary file removed src/map/map.o
Binary file not shown.

0 comments on commit 1fdd4ad

Please sign in to comment.