Files
EVEngine/example/main.nut
T
西风逍遥游 dd3541750f feat: enhance event handling and graphics functionality
- Added new methods for event polling and handling in the Event module, including `pollName` for retrieving message names.
- Introduced new graphics functions for clearing the screen and drawing solid rectangles with RGBA support.
- Updated the Window module to expose new settings and graphics functionalities.
- Refactored the main script to utilize the new graphics and event features, improving the example game structure.
2026-08-05 17:17:50 +08:00

19 lines
448 B
Plaintext

// example game callbacks — overrides defaults from load.nut
box <- { x = 100.0, y = 100.0, vx = 60.0 };
eve_init = function() {
gfx.setBackgroundColor(0.12, 0.14, 0.22, 1.0);
};
eve_update = function(dt) {
box.x = box.x + box.vx * dt;
if (box.x < 0.0 || box.x + 100.0 > config.width)
box.vx = -box.vx;
};
eve_render = function() {
gfx.clear();
gfx.drawSolidRect(box.x, box.y, 100.0, 60.0, 0.2, 0.8, 0.4, 1.0);
};