parent
ce2abb9ccd
commit
2b1fda8e86
@ -1,8 +1,11 @@
|
|||||||
spiel: main.o
|
spiel: main.o sprite.o
|
||||||
gcc -o spiel main.o -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
gcc -o spiel main.o sprite.o -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
||||||
|
|
||||||
main.o: main.c
|
main.o: main.c
|
||||||
gcc -c main.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
gcc -c main.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
||||||
|
|
||||||
|
sprite.o: sprite.c
|
||||||
|
gcc -c sprite.c -lraylib -lGL -lm -lpthread -ldl -lrt -lX11
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm *.o
|
rm *.o spiel
|
||||||
|
|||||||
@ -0,0 +1,14 @@
|
|||||||
|
#include "sprite.h"
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
void SpriteAdd(struct Sprite *cursors, int *j, Texture2D *texture, int x, int y){
|
||||||
|
if(*j < 100){
|
||||||
|
(cursors + *j) -> texture = texture;
|
||||||
|
(cursors + *j) -> x = x;
|
||||||
|
(cursors + *j) -> y = y;
|
||||||
|
(*j)++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
printf("Voll\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,17 +1,13 @@
|
|||||||
struct Sprite{
|
#ifndef SPRITE_H_
|
||||||
|
#define SPRITE_H_
|
||||||
|
#include "raylib.h"
|
||||||
|
|
||||||
|
typedef struct Sprite {
|
||||||
Texture2D *texture;
|
Texture2D *texture;
|
||||||
float x;
|
float x;
|
||||||
float y;
|
float y;
|
||||||
} Sprite;
|
} Sprite;
|
||||||
|
|
||||||
void addSprite(struct Sprite *cursors, int *j, Texture2D *texture, int x, int y){
|
void SpriteAdd(struct Sprite *cursors, int *j, Texture2D *texture, int x, int y);
|
||||||
if(*j < 100){
|
|
||||||
(cursors + *j) -> texture = texture;
|
#endif
|
||||||
(cursors + *j) -> x = x;
|
|
||||||
(cursors + *j) -> y = y;
|
|
||||||
(*j)++;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
printf("Voll\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in new issue