Update the new JavaFX UI's frame sizing and pointer cancellation while preserving zoom and scrolling. Adapt Pong, Fragments and the camera scene to the native viewport, and update exact visual references and IPC fixtures. Build and run all three examples against qualified installed runtimes. Observe an actual Pong paddle collision and verify native frame captures. Retain the qualification evidence generated for the tested native bundles. Validated by the complete verify and desktop integration gates, including the existing 30-second Play measurement and 20 Play/Stop cycles. Work: WRK-0016 / DEC-0001 / PLN-0001 Commit and push explicitly authorized by the user after completion.
98 lines
2.3 KiB
Plaintext
98 lines
2.3 KiB
Plaintext
import { Log } from @sdk:log;
|
|
import { Pad, Button, Touch } from @sdk:input;
|
|
import { Composer } from @sdk:composer;
|
|
|
|
// Preloaded by Packer: Zelda3 -> glyph slot 0, tileset -> glyph slot 1,
|
|
// tiled2 -> scene slot 0. No separate atlas load is needed.
|
|
declare global scene_bound: bool = false;
|
|
declare global frame_counter: int = 0;
|
|
declare global tile_id: int = 0;
|
|
declare global camera_x: int = 0;
|
|
declare global camera_mult: int = 1;
|
|
declare const MAX_FRAMES: int = 4;
|
|
declare const CAMERA_SPEED: int = 1;
|
|
// The base scene is 90 tiles of 8 pixels; viewport is the fixed native 640.
|
|
declare const CAMERA_MAX_X: int = 90 * 8 - 640;
|
|
|
|
[Init]
|
|
fn init() -> void
|
|
{
|
|
scene_bound = false;
|
|
frame_counter = 0;
|
|
tile_id = 0;
|
|
camera_x = 0;
|
|
camera_mult = 1;
|
|
}
|
|
|
|
[Frame]
|
|
fn frame() -> void
|
|
{
|
|
// Composer operations run during Frame, after preloads have completed.
|
|
if (!scene_bound) {
|
|
let status: int = Composer.bind_scene(0);
|
|
if (status != 0) {
|
|
Log.failure("Unable to bind the preloaded scene");
|
|
return;
|
|
}
|
|
scene_bound = true;
|
|
}
|
|
|
|
if (Touch.released())
|
|
{
|
|
frame_counter = 0;
|
|
tile_id = 0;
|
|
}
|
|
|
|
if (Touch.down())
|
|
{
|
|
frame_counter = frame_counter + 1;
|
|
if (frame_counter > MAX_FRAMES)
|
|
{
|
|
frame_counter = 0;
|
|
tile_id = tile_id + 1;
|
|
if (tile_id > 7)
|
|
{
|
|
tile_id = 0;
|
|
}
|
|
}
|
|
}
|
|
|
|
camera_x = camera_x + (camera_mult * CAMERA_SPEED);
|
|
if (camera_x >= CAMERA_MAX_X || camera_x <= 0)
|
|
{
|
|
camera_mult = -1 * camera_mult;
|
|
}
|
|
Composer.set_camera(camera_x, 0);
|
|
Composer.emit_sprite(tile_id, 0, (Touch.x() as int) - 16, (Touch.y() as int) + 8, 2, 0, true, false, 0);
|
|
|
|
let a : int = 10;
|
|
let b : int = 15;
|
|
let total : int = a + b;
|
|
|
|
if (Pad.pressed(Button.A))
|
|
{
|
|
total += 25;
|
|
}
|
|
else if (Pad.pressed(Button.B))
|
|
{
|
|
total += 5;
|
|
}
|
|
else if (Pad.pressed(Button.X))
|
|
{
|
|
total -= 10;
|
|
}
|
|
|
|
if (total == 30)
|
|
{
|
|
Log.info("30 is the magic number!");
|
|
}
|
|
else if (total == 50)
|
|
{
|
|
Log.failure("50 is the magic number!");
|
|
}
|
|
else if (total == 15)
|
|
{
|
|
Log.warn("The magic number is neither 30 nor 50!");
|
|
}
|
|
}
|