Movimiento de "Cuadrado" veloz en mapa blanco
This commit is contained in:
commit
b695b60153
55 files changed
+9391
No files matched your search
@@ -0,0 +1,36 @@
|
||||
# Disable raylib examples/games and include FetchContent
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
||||
include(FetchContent)
|
||||
|
||||
# Declare and make raylib available
|
||||
FetchContent_Declare(
|
||||
raylib
|
||||
GIT_REPOSITORY "https://github.com/raysan5/raylib.git"
|
||||
GIT_TAG "master"
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
|
||||
# 2. Descargar Pugixml (Lector de XML/SVG)
|
||||
FetchContent_Declare(
|
||||
pugixml
|
||||
GIT_REPOSITORY "https://github.com/zeux/pugixml.git"
|
||||
GIT_TAG "v1.14" # Versión estable
|
||||
GIT_PROGRESS TRUE
|
||||
)
|
||||
|
||||
# 1. Save the local PLATFORM variable
|
||||
set(ORIGINAL_PLATFORM "${PLATFORM}")
|
||||
|
||||
# 2. Override the local variable to "Desktop" (This shadows the cache and hides "linux" from raylib)
|
||||
set(PLATFORM "Desktop")
|
||||
|
||||
# 3. Configure raylib
|
||||
FetchContent_MakeAvailable(raylib pugixml)
|
||||
|
||||
# 4. Restore your project's local PLATFORM variable back to "linux"
|
||||
set(PLATFORM "${ORIGINAL_PLATFORM}")
|
||||
|
||||
|
||||
add_exe_module(pacman OUTPUT_NAME "Pacman")
|
||||
target_link_libraries(pacman PRIVATE raylib pugixml)
|
||||
@@ -0,0 +1,46 @@
|
||||
#include "raylib.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
InitWindow(800, 600, "Attacks for Bombs 1");
|
||||
|
||||
int x = 375;
|
||||
int y = 275;
|
||||
int tamaño = 50;
|
||||
int velocidad = 5;
|
||||
|
||||
while (!WindowShouldClose())
|
||||
{
|
||||
if (IsKeyDown(KEY_W))
|
||||
{
|
||||
y -= velocidad;
|
||||
}
|
||||
|
||||
if (IsKeyDown(KEY_S))
|
||||
{
|
||||
y += velocidad;
|
||||
}
|
||||
|
||||
if (IsKeyDown(KEY_A))
|
||||
{
|
||||
x -= velocidad;
|
||||
}
|
||||
|
||||
if (IsKeyDown(KEY_D))
|
||||
{
|
||||
x += velocidad;
|
||||
}
|
||||
|
||||
BeginDrawing();
|
||||
|
||||
ClearBackground(WHITE);
|
||||
|
||||
DrawRectangle(x, y, tamaño, tamaño, RED);
|
||||
|
||||
EndDrawing();
|
||||
}
|
||||
|
||||
CloseWindow();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user