Studio scene pack contract for runtime SCENE binary payload
This commit is contained in:
@@ -10,7 +10,10 @@ declare global loading_handle: int = -1;
|
||||
declare global loading_status: int = -1;
|
||||
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;
|
||||
|
||||
[Init]
|
||||
fn init() -> void
|
||||
@@ -19,13 +22,14 @@ fn init() -> void
|
||||
loading_status = -1;
|
||||
frame_counter = 0;
|
||||
tile_id = 0;
|
||||
camera_x = 0;
|
||||
camera_mult = 1;
|
||||
Composer.bind_scene(0);
|
||||
}
|
||||
|
||||
[Frame]
|
||||
fn frame() -> void
|
||||
{
|
||||
Gfx.clear(new Color(6577));
|
||||
|
||||
if (loading_handle == -1) {
|
||||
let t : (status: int, loading_handle: int) = Assets.load(assets.ui.atlas2, 3);
|
||||
if (t.status != 0) {
|
||||
@@ -75,8 +79,15 @@ fn frame() -> void
|
||||
}
|
||||
}
|
||||
|
||||
Composer.emit_sprite(tile_id, 0, touch.x() - 16, touch.y() + 8, 0, 0, true, false, 0);
|
||||
Composer.emit_sprite(tile_id, 0, touch.x() + 16, touch.y() + 8, 0, 1, false, false, 0);
|
||||
camera_x = camera_x + (camera_mult * CAMERA_SPEED);
|
||||
if (camera_x >= 240 || camera_x <= 0)
|
||||
{
|
||||
camera_mult = -1 * camera_mult;
|
||||
}
|
||||
Log.info("camera_x:" + camera_x);
|
||||
|
||||
Composer.set_camera(camera_x, 0);
|
||||
Composer.emit_sprite(tile_id, 0, touch.x() - 16, touch.y() + 8, 2, 0, true, false, 0);
|
||||
|
||||
let a : int = 10;
|
||||
let b : int = 15;
|
||||
|
||||
Reference in New Issue
Block a user