Stephen Seo
d7d1d4d7a0
All checks were successful
Build and Publish WASM version of demo / Build-And-Deploy (push) Successful in 21s
The "hack" is to press a button in a time limit after clicking on a Walker's head. If successful, the player can control the Walker. On failure, nothing happens.
28 lines
688 B
C++
28 lines
688 B
C++
#include "screen_test.h"
|
|
|
|
// standard library includes
|
|
#include <string>
|
|
|
|
// third party includes
|
|
#include <raylib.h>
|
|
|
|
TestScreen::TestScreen(ScreenStack::Weak weak_ptr)
|
|
: Screen(weak_ptr), TEMP_cached_dt(0.0F) {}
|
|
TestScreen::~TestScreen() {}
|
|
|
|
bool TestScreen::update(float dt, bool) {
|
|
TEMP_cached_dt = dt;
|
|
return false;
|
|
}
|
|
|
|
bool TestScreen::draw(RenderTexture *render_texture) {
|
|
std::string dt_string =
|
|
std::string("Delta-time: ") + std::to_string(TEMP_cached_dt);
|
|
|
|
BeginTextureMode(*render_texture);
|
|
ClearBackground(BLACK);
|
|
DrawText("Testing...", 100, 100, 30, RAYWHITE);
|
|
DrawText(dt_string.c_str(), 100, 140, 30, RAYWHITE);
|
|
EndTextureMode();
|
|
return false;
|
|
}
|