place items
very buggy
This commit is contained in:
+12
-1
@@ -45,6 +45,9 @@ int main() {
|
|||||||
camera.rotation = 0.0f;
|
camera.rotation = 0.0f;
|
||||||
camera.zoom = 1.0f;
|
camera.zoom = 1.0f;
|
||||||
|
|
||||||
|
Vector2 storedPosition = { 0, 0 };
|
||||||
|
bool shouldDrawPlaceholder = false;
|
||||||
|
|
||||||
|
|
||||||
while (!window.ShouldClose())
|
while (!window.ShouldClose())
|
||||||
{
|
{
|
||||||
@@ -82,7 +85,15 @@ int main() {
|
|||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//if (IsMouseButtonDown(MOUSE_BUTTON_LEFT)) placeholder.Draw(GetMousePosition().x, GetMousePosition().y, WHITE);
|
if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) {
|
||||||
|
storedPosition = GetMousePosition();
|
||||||
|
shouldDrawPlaceholder = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (shouldDrawPlaceholder) {
|
||||||
|
gamemap.layers[0].chunks[Vector2{(storedPosition.x / 512),(storedPosition.y / 512)}].tiles[(int)((((int)storedPosition.y % 512) / 64) * 8 + ((int)storedPosition.x % 512) / 64)].spriteid = 1;
|
||||||
|
placeholder.Draw(storedPosition.x, storedPosition.y, WHITE);
|
||||||
|
}
|
||||||
|
|
||||||
raylib::Rectangle fov{
|
raylib::Rectangle fov{
|
||||||
camera.target.x - screenWidth / 2 * camera.zoom,
|
camera.target.x - screenWidth / 2 * camera.zoom,
|
||||||
|
|||||||
Reference in New Issue
Block a user