Skip to content
Snippets Groups Projects
Commit 7ac03adb authored by Réthelyi Bálint's avatar Réthelyi Bálint :no_mouth:
Browse files

eszik baszod

parent 54737d16
No related branches found
No related tags found
1 merge request!5Blint
......@@ -14,30 +14,20 @@ move.h
time.h
-
/home/blint/projects/nhf/move.c
move.h
/home/blint/projects/nhf/move.h
view.h
/home/blint/projects/nhf/view.h
SDL.h
-
stdbool.h
-
math.h
-
/home/blint/projects/nhf/view.c
/home/blint/projects/nhf/move.h
view.h
/home/blint/projects/nhf/view.h
SDL2/SDL.h
-
SDL2/SDL_image.h
-
SDL2/SDL2_gfxPrimitives.h
-
SDL2/SDL_ttf.h
SDL.h
-
stdlib.h
stdbool.h
-
stdio.h
math.h
-
/home/blint/projects/nhf/view.h
......
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -100,7 +100,7 @@ int main(int argc, char *argv[]) {
keywatcher(ev, bagoly, elozo_x, elozo_y, &quit, &moving);
if (moving){
move_draw(ev, bagoly, &elozo_x, &elozo_y, platf, itemke);
move_draw(ev, bagoly, &elozo_x, &elozo_y, platf, &itemke);
sprintf(scoretitle.title, "Score: %6d", max_score);
draw_button(scoretitle, green, white);
......
......@@ -132,12 +132,25 @@ static void ontheplatform(SDL_Event ev, Palyaelem *platf, int *x, int *y)
}
}
static void eattheitems(SDL_Event ev, Palyaelem *itemke, int x, int y)
static void eattheitems(SDL_Event ev, Palyaelem **itemke, int x, int y)
{
Palyaelem *mozgo;
Palyaelem *lemarado = itemke;
Palyaelem *mozgo = *itemke;
Palyaelem *lemarado;
if ((x <= mozgo->x && (x + owl) > (mozgo->x) ) || (x >= mozgo->x && x <= (mozgo->x + mozgo->hossz)))
{
if ((y ) <= mozgo->y + mozgo->magassag && (y) >= mozgo->y && vy>=0)
{
max_score += 50;
lemarado = mozgo->kov;
free(mozgo);
*itemke = lemarado;
}
}
mozgo = itemke->kov;
lemarado = *itemke;
mozgo = (*itemke)->kov;
while (mozgo != NULL)
{
if ((x <= mozgo->x && (x + owl) > (mozgo->x) ) || (x >= mozgo->x && x <= (mozgo->x + mozgo->hossz)))
......@@ -203,7 +216,7 @@ static void movelogic(SDL_Event ev, int *x, int *y)
}
}
void move_draw(SDL_Event ev, SDL_Texture *kep, int *x, int *y, Palyaelem *platf, Palyaelem *itemke)
void move_draw(SDL_Event ev, SDL_Texture *kep, int *x, int *y, Palyaelem *platf, Palyaelem **itemke)
{
//call move logic
movelogic(ev, x, y);
......@@ -218,7 +231,7 @@ void move_draw(SDL_Event ev, SDL_Texture *kep, int *x, int *y, Palyaelem *platf,
ontheground(x, y);
//a szeleknel eltolja a koordinatakat
onthecorners(x, y, platf, itemke);
onthecorners(x, y, platf, *itemke);
kirajzol(kep, *x, *y);
}
......
......@@ -21,7 +21,7 @@ extern int endx;
void keywatcher(SDL_Event ev, SDL_Texture *kep, int x, int y, bool *quit, bool *moving);
void move_draw(SDL_Event ev, SDL_Texture *kep, int *x, int *y, Palyaelem *platf, Palyaelem *itemke);
void move_draw(SDL_Event ev, SDL_Texture *kep, int *x, int *y, Palyaelem *platf, Palyaelem **itemke);
Palyaelem *palyamozgat(Palyaelem *eleje, int x);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment