Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
sync to main (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLime1 authored Feb 20, 2023
2 parents 03eeb32 + aaa8853 commit f7e4f2a
Show file tree
Hide file tree
Showing 45 changed files with 824 additions and 65 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#custom
test/
.vscode/
test.c
test2.c

# Prerequisites
*.d
Expand Down
Binary file added assets/font/Minecraft.ttf
Binary file not shown.
Binary file added assets/font/forward.ttf
Binary file not shown.
Binary file added assets/img/+.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/-.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/MenuClicked.png
Binary file not shown.
Binary file added assets/img/back.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/backh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/img/exit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/exitc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/exitclicked.png
Binary file not shown.
Binary file added assets/img/exith.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/full.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/gametitle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/lvl1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/lvlmenutitle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/menu.png
Binary file not shown.
Binary file added assets/img/mute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/nomute.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/options.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/optionsc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/optionsh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/img/playButtonClicked.png
Binary file not shown.
Binary file removed assets/img/playbutton.png
Binary file not shown.
Binary file added assets/img/star1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/star2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/star3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/star4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/img/start.png
Binary file added assets/img/startc.png
Binary file added assets/img/starth.png
3 changes: 1 addition & 2 deletions build/makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
CC = gcc
CFLAGS = -Wall -I../include
LDFLAGS = -lSDL -lSDL_image -lSDL_mixer -lSDL_ttf
OBJS = main.o menu.o music.o text.o

OBJS = main.o menu.o music.o text.o stars.o settings.o start.o
game: $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o game
%.o: ../src/%.c
Expand Down
Binary file added doc/button select keyboard.png
Binary file added doc/score.jpg
3 changes: 3 additions & 0 deletions how_To_RUN.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1) go inside build folder
2) run makefile by typing make
3) run the program by typing ./game
32 changes: 26 additions & 6 deletions include/menu.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#ifndef IMAGE_H
#define IMAGE_H

#ifndef MENU_H
#define MENU_H

#define SCREEN_W 1280
#define SCREEN_H 720 // screen height and width
Expand All @@ -12,8 +13,12 @@ typedef struct
SDL_Surface *img; // pointer to the image
} image;

// load buttons assets
//! LOAD AREA

void imageLoad_background(image *img);
void imageLoad_gametitle(image *img);

// load buttons assets
void imageLoad_playbutton(image *img);
void imageLoad_settingsbutton(image *img);
void imageLoad_quitbutton(image *img);
Expand All @@ -22,8 +27,16 @@ void imageLoadClicked_playbutton(image *img);
void imageLoadClicked_settingsbutton(image *img);
void imageLoadClicked_quitbutton(image *img);

// draw buttons
void imageLoadHovered_playbutton(image *img);
void imageLoadHovered_settingsbutton(image *img);
void imageLoadHovered_quitbutton(image *img);

//! DRAW AREA

void imageDraw_gametitle(SDL_Surface *screen, image img);
void imageDraw_background(SDL_Surface *screen, image img);

// draw buttons
void imageDraw_playbutton(SDL_Surface *screen, image img);
void imageDraw_settingsbutton(SDL_Surface *screen, image img);
void imageDraw_quitbutton(SDL_Surface *screen, image img);
Expand All @@ -33,7 +46,14 @@ void imageDrawClicked_playbutton(SDL_Surface *screen, image img);
void imageDrawClicked_settingsbutton(SDL_Surface *screen, image img);
void imageDrawClicked_quitbutton(SDL_Surface *screen, image img);

// free buttons
void imageFree(image img);

void imageDrawHovered_playbutton(SDL_Surface *screen, image img);
void imageDrawHovered_settingsbutton(SDL_Surface *screen, image img);
void imageDrawHovered_quitbutton(SDL_Surface *screen, image img);

// TODO make universal functions .h and .c files
//**UNIVERSAL FUNCTION**//
// free buttons


#endif
27 changes: 27 additions & 0 deletions include/settings.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#ifndef SETTINGS_H
#define SETTINGS_H

#define SCREEN_W 1280
#define SCREEN_H 720 // screen height and width

//! LOAD AREA
void imageLoad_sounddown(image *img);
void imageLoad_soundup(image *img);
void imageLoad_soundmute(image *img);
void imageLoad_fullscreen(image *img);
void imageLoad_backbutton(image *img);

void imageLoadHovered_soundmute(image *img);
void imageLoadHovered_backbutton(image *img);

//! DRAW AREA
void imageDraw_sounddown(SDL_Surface *screen, image img);
void imageDraw_soundup(SDL_Surface *screen, image img);
void imageDraw_soundmute(SDL_Surface *screen, image img);
void imageDraw_fullscreen(SDL_Surface *screen, image img);
void imageDraw_backbutton(SDL_Surface *screen, image img);

void imageDrawHovered_soundmute(SDL_Surface *screen, image img);
void imageDrawHovered_backbutton(SDL_Surface *screen, image img);

#endif // SETTINGS_H
15 changes: 15 additions & 0 deletions include/stars.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef STARS_H
#define STARS_H

typedef struct
{
SDL_Surface *image;
SDL_Rect rect;
int speed;
} Star;

void init_star(Star *star, SDL_Surface *image, int x, int y, int speed);
void move_star(Star *star, int delta_time);
void draw_star(SDL_Surface *surface, Star *star);

#endif /* STARS_H */
15 changes: 15 additions & 0 deletions include/start.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef START_H
#define START_H

#define SCREEN_W 1280
#define SCREEN_H 720 // screen height and width

//! LOAD AREA
void imageLoad_lvlmenutitle(image *img);
void imageLoad_lvl1(image *img);

//! DRAW AREA
void imageDraw_lvlmenutitle(SDL_Surface *screen, image img);
void imageDraw_lvl1(SDL_Surface *screen, image img);

#endif
Loading

0 comments on commit f7e4f2a

Please sign in to comment.