Files
Attacks-for-Bombs-1/source/Pacman/main.cpp
T

46 lines
694 B
C++

#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;
}