51 lines
837 B
C++
51 lines
837 B
C++
#include "raylib.h"
|
|
|
|
int main()
|
|
{
|
|
InitWindow(800, 600, "Attacks for Bombs 1");
|
|
SetTargetFPS(60);
|
|
|
|
float x = 375.0f;
|
|
float y = 275.0f;
|
|
float tamano = 50.0f;
|
|
float velocidad = 300.0f;
|
|
|
|
while (!WindowShouldClose())
|
|
{
|
|
float dt = GetFrameTime();
|
|
|
|
if (IsKeyDown(KEY_W))
|
|
{
|
|
y -= velocidad * dt;
|
|
}
|
|
|
|
if (IsKeyDown(KEY_S))
|
|
{
|
|
y += velocidad * dt;
|
|
}
|
|
|
|
if (IsKeyDown(KEY_A))
|
|
{
|
|
x -= velocidad * dt;
|
|
}
|
|
|
|
if (IsKeyDown(KEY_D))
|
|
{
|
|
x += velocidad * dt;
|
|
}
|
|
|
|
BeginDrawing();
|
|
|
|
ClearBackground(WHITE);
|
|
|
|
DrawRectangle((int)x, (int)y, (int)tamano, (int)tamano, RED);
|
|
|
|
DrawFPS(10, 10);
|
|
|
|
EndDrawing();
|
|
}
|
|
|
|
CloseWindow();
|
|
|
|
return 0;
|
|
} |