player struct and cool fucking button
This commit is contained in:
+13
-3
@@ -1,3 +1,4 @@
|
||||
#include "button.h"
|
||||
#include "cube.h"
|
||||
#include "player.h"
|
||||
#include "raylib.h"
|
||||
@@ -5,10 +6,18 @@
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
|
||||
Button button = {
|
||||
.position = (Vector3){0.0f, 0.0f, 0.0f},
|
||||
.length = 1.0f,
|
||||
.height = 0.1f,
|
||||
.color = BLUE,
|
||||
.pressed = false,
|
||||
};
|
||||
|
||||
Cube cube = {
|
||||
.initialized = false,
|
||||
.position = (Vector3){0.0f, 0.5f, 0.0f},
|
||||
.edge = 1.0f,
|
||||
.edge = 0.8f,
|
||||
.color = RED,
|
||||
.wiresColor = BLACK,
|
||||
.grabbed = false,
|
||||
@@ -18,7 +27,7 @@ void DrawLevel00(Player *player)
|
||||
{
|
||||
if (!cube.initialized)
|
||||
{
|
||||
cube.model = LoadModelFromMesh(GenMeshCube(1.0f, 1.0f, 1.0f));
|
||||
cube.model = LoadModelFromMesh(GenMeshCube(cube.edge, cube.edge, cube.edge));
|
||||
cube.initialized = true;
|
||||
}
|
||||
|
||||
@@ -43,5 +52,6 @@ void DrawLevel00(Player *player)
|
||||
|
||||
UpdateGrab(player, &cube); // Check if we grabbed a cube
|
||||
|
||||
MyDrawCube(&cube); // Draw a cube
|
||||
MyDrawCube(&cube); // Draw a cube
|
||||
DrawButton(&button, &cube); // Draw a button
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user