├── .github └── workflows │ ├── cd.yml │ └── ci.yml ├── .gitignore ├── .prettierrc ├── .vscode ├── launch.json ├── settings.json └── tasks.json ├── Animate ├── blueprints │ ├── blu_camera.ts │ ├── blu_character_rigged.ts │ └── blu_character_voxel.ts ├── components │ ├── com_animate.ts │ ├── com_audio_listener.ts │ ├── com_audio_source.ts │ ├── com_bone.ts │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_control.ts │ ├── com_light.ts │ ├── com_render_ext.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── materials │ ├── layout_skinning.ts │ ├── mat_forward_colored_gouraud_skinned.ts │ └── mat_forward_colored_phong_skinned.ts ├── scenes │ └── sce_stage.ts ├── sounds │ ├── snd_jump.ts │ └── snd_walk.ts ├── systems │ ├── sys_animate.ts │ ├── sys_audio_listener.ts │ ├── sys_audio_source.ts │ ├── sys_camera.ts │ ├── sys_control.ts │ ├── sys_light.ts │ ├── sys_render_ext.ts │ ├── sys_resize.ts │ ├── sys_rig.ts │ └── sys_transform.ts └── world.ts ├── CHANGELOG.md ├── DeferredShading ├── blueprints │ ├── blu_bulb.ts │ ├── blu_camera_main.ts │ └── blu_sun.ts ├── components │ ├── com_animate.ts │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_control_always.ts │ ├── com_light.ts │ ├── com_move.ts │ ├── com_render.ts │ ├── com_shake.ts │ ├── com_spawn.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_control_always.ts │ ├── sys_move.ts │ ├── sys_render_deferred.ts │ ├── sys_render_depth.ts │ ├── sys_render_postprocess.ts │ ├── sys_render_shading.ts │ ├── sys_resize.ts │ ├── sys_shake.ts │ ├── sys_spawn.ts │ ├── sys_transform.ts │ └── sys_ui.ts ├── ui │ └── App.ts └── world.ts ├── FirstPerson ├── actions.ts ├── blueprints │ └── blu_camera_fly.ts ├── components │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_control_player.ts │ ├── com_draw.ts │ ├── com_emit_particles.ts │ ├── com_light.ts │ ├── com_move.ts │ ├── com_render.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_control_keyboard.ts │ ├── sys_control_mouse_move.ts │ ├── sys_control_touch_move.ts │ ├── sys_control_xbox.ts │ ├── sys_draw.ts │ ├── sys_light.ts │ ├── sys_move.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ ├── sys_transform.ts │ └── sys_ui.ts ├── ui │ ├── App.ts │ └── Fullscreen.ts └── world.ts ├── FollowCamera ├── blueprints │ ├── blu_camera_follow.ts │ ├── blu_ground.ts │ ├── blu_obstacle.ts │ └── blu_player.ts ├── components │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_collide.ts │ ├── com_control_player.ts │ ├── com_emit_particles.ts │ ├── com_follow.ts │ ├── com_light.ts │ ├── com_look_at.ts │ ├── com_move.ts │ ├── com_named.ts │ ├── com_render.ts │ ├── com_rigid_body.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_collide.ts │ ├── sys_control_keyboard.ts │ ├── sys_debug.ts │ ├── sys_follow.ts │ ├── sys_light.ts │ ├── sys_look_at.ts │ ├── sys_move.ts │ ├── sys_physics_integrate.ts │ ├── sys_physics_resolve.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ └── sys_transform.ts └── world.ts ├── ForwardShading ├── blueprints │ ├── blu_camera.ts │ ├── blu_camera_minimap.ts │ └── blu_sun.ts ├── components │ ├── com_animate.ts │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_control_always.ts │ ├── com_emit_particles.ts │ ├── com_light.ts │ ├── com_move.ts │ ├── com_render.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_control_always.ts │ ├── sys_light.ts │ ├── sys_move.ts │ ├── sys_render_depth.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ └── sys_transform.ts └── world.ts ├── Instancing ├── blueprints │ └── blu_camera.ts ├── components │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_light.ts │ ├── com_render_instanced.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── materials │ ├── layout_instancing.ts │ └── mat_forward_instanced_colored_unlit.ts ├── model.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_light.ts │ ├── sys_render_instanced.ts │ ├── sys_resize.ts │ └── sys_transform.ts └── world.ts ├── LICENSE ├── Monkey ├── blueprints │ └── blu_camera.ts ├── components │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_emit_particles.ts │ ├── com_light.ts │ ├── com_render.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_light.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ └── sys_transform.ts └── world.ts ├── NewProject3D ├── actions.ts ├── blueprints │ ├── blu_camera_follow.ts │ ├── blu_ground.ts │ ├── blu_item.ts │ ├── blu_obstacle.ts │ └── blu_player.ts ├── components │ ├── com_animate.ts │ ├── com_audio_listener.ts │ ├── com_audio_source.ts │ ├── com_callback.ts │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_collide.ts │ ├── com_control_always.ts │ ├── com_control_player.ts │ ├── com_disable.ts │ ├── com_draw.ts │ ├── com_emit_particles.ts │ ├── com_lifespan.ts │ ├── com_light.ts │ ├── com_mimic.ts │ ├── com_move.ts │ ├── com_named.ts │ ├── com_render.ts │ ├── com_rigid_body.ts │ ├── com_shake.ts │ ├── com_spawn.ts │ ├── com_task.ts │ ├── com_toggle.ts │ ├── com_transform.ts │ └── com_trigger.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_animate.ts │ ├── sys_audio_listener.ts │ ├── sys_audio_source.ts │ ├── sys_camera.ts │ ├── sys_collide.ts │ ├── sys_control_always.ts │ ├── sys_control_jump.ts │ ├── sys_control_keyboard.ts │ ├── sys_control_mouse_move.ts │ ├── sys_control_touch_move.ts │ ├── sys_control_xbox.ts │ ├── sys_debug.ts │ ├── sys_draw.ts │ ├── sys_lifespan.ts │ ├── sys_light.ts │ ├── sys_mimic.ts │ ├── sys_move.ts │ ├── sys_particles.ts │ ├── sys_physics_integrate.ts │ ├── sys_physics_kinematic.ts │ ├── sys_physics_resolve.ts │ ├── sys_poll.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ ├── sys_shake.ts │ ├── sys_spawn.ts │ ├── sys_toggle.ts │ ├── sys_transform.ts │ ├── sys_trigger.ts │ └── sys_ui.ts ├── ui │ ├── App.ts │ ├── Fullscreen.ts │ └── Score.ts └── world.ts ├── PathFinding ├── blueprints │ └── blu_camera.ts ├── components │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_collide.ts │ ├── com_control_dolly.ts │ ├── com_control_player.ts │ ├── com_disable.ts │ ├── com_draw.ts │ ├── com_emit_particles.ts │ ├── com_light.ts │ ├── com_move.ts │ ├── com_nav_agent.ts │ ├── com_pickable.ts │ ├── com_render.ts │ ├── com_selectable.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_collide.ts │ ├── sys_control_dolly.ts │ ├── sys_control_keyboard.ts │ ├── sys_control_mouse_drag.ts │ ├── sys_control_player.ts │ ├── sys_control_touch_drag.ts │ ├── sys_draw.ts │ ├── sys_highlight.ts │ ├── sys_light.ts │ ├── sys_move.ts │ ├── sys_nav.ts │ ├── sys_pick.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ ├── sys_select.ts │ └── sys_transform.ts └── world.ts ├── Platformer2D ├── actions.ts ├── components │ ├── com_animate_sprite.ts │ ├── com_callback.ts │ ├── com_camera2d.ts │ ├── com_children.ts │ ├── com_collide2d.ts │ ├── com_control_always2d.ts │ ├── com_control_player.ts │ ├── com_disable.ts │ ├── com_draw.ts │ ├── com_lifespan.ts │ ├── com_local_transform2d.ts │ ├── com_move2d.ts │ ├── com_named.ts │ ├── com_render2d.ts │ ├── com_rigid_body2d.ts │ ├── com_shake.ts │ ├── com_spatial_node2d.ts │ ├── com_spawn.ts │ ├── com_task.ts │ ├── com_toggle.ts │ └── com_trigger.ts ├── game.ts ├── index.html ├── index.ts ├── maps │ ├── Makefile │ ├── map_platforms.tmj │ └── map_platforms.ts ├── scenes │ ├── blu_camera.ts │ ├── blu_player.ts │ ├── blu_square.ts │ ├── sce_platforms.ts │ └── sce_stage.ts ├── sprites │ ├── License.txt │ ├── Makefile │ ├── atlas.png │ ├── atlas.png.webp │ ├── atlas.ts │ ├── atlas.tsj │ ├── character_0000.png │ ├── character_0001.png │ ├── character_0002.png │ ├── character_0003.png │ ├── character_0004.png │ ├── character_0005.png │ ├── character_0006.png │ ├── character_0007.png │ ├── character_0009.png │ ├── character_0010.png │ ├── character_0011.png │ ├── character_0012.png │ ├── character_0013.png │ ├── character_0014.png │ ├── character_0015.png │ ├── character_0016.png │ ├── character_0017.png │ ├── character_0018.png │ ├── character_0019.png │ ├── character_0020.png │ ├── character_0021.png │ ├── character_0022.png │ ├── character_0023.png │ ├── character_0024.png │ ├── character_0025.png │ ├── character_0026.png │ ├── tile_0000.png │ ├── tile_0001.png │ ├── tile_0002.png │ ├── tile_0003.png │ ├── tile_0004.png │ ├── tile_0005.png │ ├── tile_0006.png │ ├── tile_0007.png │ ├── tile_0008.png │ ├── tile_0009.png │ ├── tile_0010.png │ ├── tile_0011.png │ ├── tile_0016.png │ ├── tile_0017.png │ ├── tile_0018.png │ ├── tile_0019.png │ ├── tile_0020.png │ ├── tile_0021.png │ ├── tile_0022.png │ ├── tile_0023.png │ ├── tile_0024.png │ ├── tile_0025.png │ ├── tile_0026.png │ ├── tile_0027.png │ ├── tile_0028.png │ ├── tile_0029.png │ ├── tile_0030.png │ ├── tile_0031.png │ ├── tile_0033.png │ ├── tile_0034.png │ ├── tile_0035.png │ ├── tile_0036.png │ ├── tile_0037.png │ ├── tile_0038.png │ ├── tile_0039.png │ ├── tile_0040.png │ ├── tile_0041.png │ ├── tile_0042.png │ ├── tile_0043.png │ ├── tile_0044.png │ ├── tile_0045.png │ ├── tile_0046.png │ ├── tile_0047.png │ ├── tile_0048.png │ ├── tile_0049.png │ ├── tile_0050.png │ ├── tile_0051.png │ ├── tile_0053.png │ ├── tile_0054.png │ ├── tile_0055.png │ ├── tile_0056.png │ ├── tile_0057.png │ ├── tile_0058.png │ ├── tile_0059.png │ ├── tile_0060.png │ ├── tile_0061.png │ ├── tile_0062.png │ ├── tile_0063.png │ ├── tile_0064.png │ ├── tile_0065.png │ ├── tile_0066.png │ ├── tile_0067.png │ ├── tile_0068.png │ ├── tile_0069.png │ ├── tile_0070.png │ ├── tile_0071.png │ ├── tile_0073.png │ ├── tile_0074.png │ ├── tile_0075.png │ ├── tile_0076.png │ ├── tile_0077.png │ ├── tile_0078.png │ ├── tile_0079.png │ ├── tile_0086.png │ ├── tile_0087.png │ ├── tile_0088.png │ ├── tile_0089.png │ ├── tile_0090.png │ ├── tile_0091.png │ ├── tile_0092.png │ ├── tile_0093.png │ ├── tile_0094.png │ ├── tile_0095.png │ ├── tile_0096.png │ ├── tile_0097.png │ ├── tile_0098.png │ ├── tile_0099.png │ ├── tile_0104.png │ ├── tile_0105.png │ ├── tile_0106.png │ ├── tile_0107.png │ ├── tile_0108.png │ ├── tile_0109.png │ ├── tile_0110.png │ ├── tile_0111.png │ ├── tile_0112.png │ ├── tile_0113.png │ ├── tile_0114.png │ ├── tile_0115.png │ ├── tile_0116.png │ ├── tile_0117.png │ ├── tile_0118.png │ ├── tile_0119.png │ ├── tile_0120.png │ ├── tile_0121.png │ ├── tile_0122.png │ ├── tile_0123.png │ ├── tile_0124.png │ ├── tile_0125.png │ ├── tile_0126.png │ ├── tile_0127.png │ ├── tile_0128.png │ ├── tile_0129.png │ ├── tile_0130.png │ ├── tile_0131.png │ ├── tile_0132.png │ ├── tile_0133.png │ ├── tile_0134.png │ ├── tile_0135.png │ ├── tile_0136.png │ ├── tile_0137.png │ ├── tile_0138.png │ ├── tile_0139.png │ ├── tile_0140.png │ ├── tile_0141.png │ ├── tile_0142.png │ ├── tile_0143.png │ ├── tile_0146.png │ ├── tile_0147.png │ ├── tile_0148.png │ ├── tile_0149.png │ ├── tile_0150.png │ ├── tile_0151.png │ ├── tile_0152.png │ ├── tile_0153.png │ ├── tile_0154.png │ ├── tile_0155.png │ └── tile_0156.png ├── systems │ ├── sys_camera2d.ts │ ├── sys_collide2d.ts │ ├── sys_control_always2d.ts │ ├── sys_control_camera.ts │ ├── sys_control_keyboard.ts │ ├── sys_control_mouse.ts │ ├── sys_draw2d.ts │ ├── sys_lifespan.ts │ ├── sys_move2d.ts │ ├── sys_physics2d_bounds.ts │ ├── sys_physics2d_integrate.ts │ ├── sys_physics2d_resolve.ts │ ├── sys_poll.ts │ ├── sys_render2d.ts │ ├── sys_render2d_animate.ts │ ├── sys_resize2d.ts │ ├── sys_shake2d.ts │ ├── sys_spawn2d.ts │ ├── sys_toggle.ts │ ├── sys_transform2d.ts │ ├── sys_trigger2d.ts │ └── sys_ui.ts ├── tiled.ts ├── ui │ └── App.ts └── world.ts ├── README.md ├── RigidBody ├── actions.ts ├── blueprints │ ├── blu_box.ts │ ├── blu_camera.ts │ └── blu_hand.ts ├── components │ ├── com_animate.ts │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_collide.ts │ ├── com_control_always.ts │ ├── com_emit_particles.ts │ ├── com_lifespan.ts │ ├── com_light.ts │ ├── com_move.ts │ ├── com_render.ts │ ├── com_rigid_body.ts │ ├── com_shake.ts │ ├── com_spawn.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_collide.ts │ ├── sys_control_always.ts │ ├── sys_debug.ts │ ├── sys_lifespan.ts │ ├── sys_light.ts │ ├── sys_move.ts │ ├── sys_physics_integrate.ts │ ├── sys_physics_kinematic.ts │ ├── sys_physics_resolve.ts │ ├── sys_render_forward.ts │ ├── sys_resize.ts │ ├── sys_shake.ts │ ├── sys_spawn.ts │ └── sys_transform.ts └── world.ts ├── TodoApp ├── actions.ts ├── game.ts ├── index.html ├── index.ts ├── systems │ └── sys_ui.ts └── ui │ ├── AddForm.ts │ ├── App.ts │ ├── CompletedItem.ts │ └── TodoItem.ts ├── WebXR ├── actions.ts ├── blueprints │ ├── blu_camera.ts │ └── blu_viewer.ts ├── components │ ├── com_camera.ts │ ├── com_children.ts │ ├── com_control_xr.ts │ ├── com_emit_particles.ts │ ├── com_light.ts │ ├── com_render.ts │ └── com_transform.ts ├── game.ts ├── index.html ├── index.ts ├── scenes │ └── sce_stage.ts ├── systems │ ├── sys_camera.ts │ ├── sys_camera_xr.ts │ ├── sys_control_xr.ts │ ├── sys_light.ts │ ├── sys_render_forward.ts │ ├── sys_render_xr.ts │ ├── sys_resize.ts │ ├── sys_transform.ts │ └── sys_ui.ts ├── ui │ ├── App.ts │ └── EnterVr.ts └── world.ts ├── assets ├── README.md ├── cube.blend ├── cube.gltf ├── fire.pyxel ├── hand.blend ├── hand.gltf ├── icosphere_flat.blend ├── icosphere_flat.gltf ├── icosphere_smooth.blend ├── icosphere_smooth.gltf ├── ludek.blend ├── ludek.gltf ├── monkey_flat.blend ├── monkey_flat.gltf ├── monkey_smooth.blend ├── monkey_smooth.gltf ├── plane.blend ├── plane.gltf ├── quad.blend ├── quad.gltf ├── terrain.blend └── terrain.gltf ├── bootstrap.sh ├── core ├── actions.ts ├── components │ ├── com_animate.ts │ ├── com_animate_sprite.ts │ ├── com_audio_listener.ts │ ├── com_audio_source.ts │ ├── com_callback.ts │ ├── com_camera.ts │ ├── com_camera2d.ts │ ├── com_children.ts │ ├── com_collide.ts │ ├── com_collide2d.ts │ ├── com_control_always.ts │ ├── com_control_always2d.ts │ ├── com_control_player.ts │ ├── com_disable.ts │ ├── com_draw.ts │ ├── com_emit_particles.ts │ ├── com_follow.ts │ ├── com_lifespan.ts │ ├── com_light.ts │ ├── com_local_transform2d.ts │ ├── com_look_at.ts │ ├── com_mimic.ts │ ├── com_move.ts │ ├── com_move2d.ts │ ├── com_named.ts │ ├── com_render.ts │ ├── com_render2d.ts │ ├── com_rigid_body.ts │ ├── com_rigid_body2d.ts │ ├── com_shake.ts │ ├── com_spatial_node2d.ts │ ├── com_spawn.ts │ ├── com_task.ts │ ├── com_toggle.ts │ ├── com_transform.ts │ └── com_trigger.ts ├── game.ts ├── sprites │ └── atlas.ts ├── systems │ ├── sys_animate.ts │ ├── sys_audio_listener.ts │ ├── sys_audio_source.ts │ ├── sys_camera.ts │ ├── sys_camera2d.ts │ ├── sys_camera_xr.ts │ ├── sys_collide.ts │ ├── sys_collide2d.ts │ ├── sys_control_always.ts │ ├── sys_control_always2d.ts │ ├── sys_control_keyboard.ts │ ├── sys_control_mouse_drag.ts │ ├── sys_control_mouse_move.ts │ ├── sys_control_touch_drag.ts │ ├── sys_control_touch_move.ts │ ├── sys_control_xbox.ts │ ├── sys_debug.ts │ ├── sys_draw.ts │ ├── sys_draw2d.ts │ ├── sys_follow.ts │ ├── sys_lifespan.ts │ ├── sys_light.ts │ ├── sys_look_at.ts │ ├── sys_mimic.ts │ ├── sys_move.ts │ ├── sys_move2d.ts │ ├── sys_particles.ts │ ├── sys_physics2d_integrate.ts │ ├── sys_physics2d_resolve.ts │ ├── sys_physics_integrate.ts │ ├── sys_physics_kinematic.ts │ ├── sys_physics_resolve.ts │ ├── sys_poll.ts │ ├── sys_render2d.ts │ ├── sys_render2d_animate.ts │ ├── sys_render_deferred.ts │ ├── sys_render_depth.ts │ ├── sys_render_forward.ts │ ├── sys_render_shading.ts │ ├── sys_render_xr.ts │ ├── sys_resize.ts │ ├── sys_resize2d.ts │ ├── sys_shake.ts │ ├── sys_shake2d.ts │ ├── sys_spawn.ts │ ├── sys_spawn2d.ts │ ├── sys_toggle.ts │ ├── sys_transform.ts │ ├── sys_transform2d.ts │ ├── sys_trigger.ts │ ├── sys_trigger2d.ts │ └── sys_ui.ts ├── ui │ └── App.ts └── world.ts ├── favicon.ico ├── lib ├── aabb.ts ├── aabb2d.ts ├── audio.ts ├── color.ts ├── easing.ts ├── framebuffer.ts ├── game.ts ├── html.ts ├── input.ts ├── load.ts ├── mat2d.ts ├── mat4.ts ├── material.ts ├── math.ts ├── mesh.ts ├── navmesh.ts ├── number.ts ├── pathfind.ts ├── projection.ts ├── projection2d.ts ├── quat.ts ├── random.ts ├── raycast.ts ├── texture.ts ├── vec2.ts ├── vec3.ts ├── vec4.ts ├── webgl.ts ├── webxr.d.ts ├── window.d.ts └── world.ts ├── materials ├── layout.ts ├── layout2d.ts ├── light.ts ├── mat_deferred_colored.ts ├── mat_deferred_shading.ts ├── mat_forward_colored_flat.ts ├── mat_forward_colored_gouraud.ts ├── mat_forward_colored_phong.ts ├── mat_forward_colored_points.ts ├── mat_forward_colored_shadows.ts ├── mat_forward_colored_unlit.ts ├── mat_forward_depth.ts ├── mat_forward_mapped_shaded.ts ├── mat_forward_particles_colored.ts ├── mat_forward_particles_textured.ts ├── mat_forward_textured_gouraud.ts ├── mat_forward_textured_phong.ts ├── mat_forward_textured_unlit.ts ├── mat_postprocess_blur.ts ├── mat_postprocess_brightness.ts ├── mat_postprocess_fxaa.ts ├── mat_postprocess_tone.ts └── mat_render2d.ts ├── meshes ├── Makefile ├── cube.ts ├── gltf2mesh.cjs ├── hand.ts ├── icosphere_flat.ts ├── icosphere_smooth.ts ├── ludek.ts ├── monkey_flat.ts ├── monkey_smooth.ts ├── plane.ts ├── quad.ts └── terrain.ts ├── package-lock.json ├── package.json ├── play ├── Makefile ├── debug.css ├── game.css ├── game.html ├── package-lock.json ├── package.json ├── posthtml.cjs ├── sed.txt └── terser_compress.txt ├── reference ├── Makefile ├── generate_index.mjs ├── generate_reference.mjs └── package.json ├── textures ├── Bricks059_1K_AmbientOcclusion.jpg ├── Bricks059_1K_AmbientOcclusion.jpg.webp ├── Bricks059_1K_Color.jpg ├── Bricks059_1K_Color.jpg.webp ├── Bricks059_1K_Displacement.jpg ├── Bricks059_1K_Displacement.jpg.webp ├── Bricks059_1K_Normal.jpg ├── Bricks059_1K_Normal.jpg.webp ├── Bricks059_1K_Roughness.jpg ├── Bricks059_1K_Roughness.jpg.webp ├── Concrete018_1K_Color.jpg ├── Concrete018_1K_Color.jpg.webp ├── Concrete018_1K_Displacement.jpg ├── Concrete018_1K_Displacement.jpg.webp ├── Concrete018_1K_Normal.jpg ├── Concrete018_1K_Normal.jpg.webp ├── Concrete018_1K_Roughness.jpg ├── Concrete018_1K_Roughness.jpg.webp ├── Makefile ├── README.md ├── Wood063_1K_AmbientOcclusion.jpg ├── Wood063_1K_AmbientOcclusion.jpg.webp ├── Wood063_1K_Color.jpg ├── Wood063_1K_Color.jpg.webp ├── Wood063_1K_Displacement.jpg ├── Wood063_1K_Displacement.jpg.webp ├── Wood063_1K_Normal.jpg ├── Wood063_1K_Normal.jpg.webp ├── Wood063_1K_Roughness.jpg ├── Wood063_1K_Roughness.jpg.webp ├── checker1.png ├── checker1.png.webp ├── fire.png └── fire.png.webp ├── tsconfig.json └── util ├── tiled_tile_names.cjs ├── tiled_tmj2map.cjs └── tiled_tsj2atlas.cjs /.github/workflows/cd.yml: -------------------------------------------------------------------------------- 1 | name: CD 2 | on: 3 | push: 4 | # Add "main" after bootstrapping src/ 5 | branches: 6 | - "!**" 7 | jobs: 8 | build-and-deploy: 9 | runs-on: ubuntu-latest 10 | steps: 11 | - name: 🛎️ Check out 12 | uses: actions/checkout@v2 13 | - name: 🧮 Use Node.js 14 | uses: actions/setup-node@v1 15 | with: 16 | node-version: 16.x 17 | - name: 📦 Install dependencies 18 | run: npm ci 19 | - name: 🧽 Lint 20 | run: npm run lint 21 | - name: 🛠️ Build 22 | run: make -C play 23 | - name: 🚀 Deploy 24 | uses: JamesIves/github-pages-deploy-action@4.1.1 25 | with: 26 | branch: gh-pages 27 | folder: play 28 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | on: pull_request 3 | jobs: 4 | build: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: 🛎️ Check out 8 | uses: actions/checkout@v2 9 | - name: 🧮 Use Node.js 10 | uses: actions/setup-node@v1 11 | with: 12 | node-version: 16.x 13 | - name: 📦 Install dependencies 14 | run: npm ci 15 | - name: 🧽 Lint 16 | run: npm run lint 17 | - name: 🛠️ Type-check 18 | run: npm run ts:check 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .vscode/*.log 3 | 4 | node_modules 5 | *.js 6 | *.js.map 7 | *.pad.png 8 | play/index.* 9 | reference/*.html 10 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "bracketSpacing": false, 3 | "printWidth": 100, 4 | "tabWidth": 4 5 | } 6 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "type": "chrome", 9 | "request": "launch", 10 | "name": "Chrome", 11 | "url": "http://localhost:1234", 12 | "webRoot": "${workspaceFolder}" 13 | }, 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "{core,lib,materials,meshes,[A-Z]*}/*.js": true, 4 | "**/*.js.map": true, 5 | "package-lock.json": true, 6 | }, 7 | "editor.formatOnSave": true, 8 | "editor.codeActionsOnSave": { 9 | "source.organizeImports": true, 10 | }, 11 | "npm.autoDetect": "off", 12 | "typescript.tsc.autoDetect": "off", 13 | "typescript.tsdk": "node_modules/typescript/lib", 14 | "typescript.preferences.importModuleSpecifierEnding": "js", 15 | } 16 | -------------------------------------------------------------------------------- /Animate/blueprints/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera(game: Game) { 8 | return [ 9 | transform(), 10 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 0.1, 1000))]), 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /Animate/components/com_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_animate.ts -------------------------------------------------------------------------------- /Animate/components/com_audio_listener.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_audio_listener.ts -------------------------------------------------------------------------------- /Animate/components/com_audio_source.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_audio_source.ts -------------------------------------------------------------------------------- /Animate/components/com_bone.ts: -------------------------------------------------------------------------------- 1 | import {mat4_create} from "../../lib/mat4.js"; 2 | import {Mat4} from "../../lib/math.js"; 3 | import {Entity} from "../../lib/world.js"; 4 | import {Game} from "../game.js"; 5 | import {Has} from "../world.js"; 6 | 7 | export interface Bone { 8 | Index: number; 9 | Dirty: boolean; 10 | InverseBindPose: Mat4; 11 | } 12 | 13 | export function bone(index: number, inverse_bind_pose?: Mat4) { 14 | return (game: Game, entity: Entity) => { 15 | game.World.Signature[entity] |= Has.Bone; 16 | game.World.Bone[entity] = { 17 | Index: index, 18 | Dirty: inverse_bind_pose === undefined, 19 | InverseBindPose: inverse_bind_pose || mat4_create(), 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /Animate/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /Animate/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /Animate/components/com_control.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../lib/world.js"; 2 | import {Game} from "../game.js"; 3 | import {Has} from "../world.js"; 4 | 5 | export function control() { 6 | return (game: Game, entity: Entity) => { 7 | game.World.Signature[entity] |= Has.Control; 8 | }; 9 | } 10 | -------------------------------------------------------------------------------- /Animate/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /Animate/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /Animate/index.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | import {scene_stage} from "./scenes/sce_stage.js"; 3 | 4 | let game = new Game(); 5 | scene_stage(game); 6 | game.Start(); 7 | 8 | // @ts-ignore 9 | window.game = game; 10 | -------------------------------------------------------------------------------- /Animate/materials/layout_skinning.ts: -------------------------------------------------------------------------------- 1 | export interface SkinningLayout { 2 | Bones: WebGLUniformLocation; 3 | } 4 | -------------------------------------------------------------------------------- /Animate/sounds/snd_jump.ts: -------------------------------------------------------------------------------- 1 | import {AudioClipKind, AudioSynthClip} from "../../lib/audio.js"; 2 | 3 | export let snd_jump: AudioSynthClip = { 4 | Kind: AudioClipKind.Synth, 5 | Tracks: [ 6 | { 7 | Instrument: [ 8 | 8, 9 | false, 10 | 7, 11 | 8, 12 | false, 13 | false, 14 | 8, 15 | 8, 16 | [ 17 | ["triangle", 8, 8, 8, 6, 8, false, true, 2, 3, 7], 18 | ["square", 3, 1, 2, 2, 8, false, false, 0, 0, 0], 19 | ], 20 | ], 21 | Notes: [72], 22 | }, 23 | ], 24 | Exit: 0.4, 25 | }; 26 | -------------------------------------------------------------------------------- /Animate/sounds/snd_walk.ts: -------------------------------------------------------------------------------- 1 | import {AudioClipKind, AudioSynthClip} from "../../lib/audio.js"; 2 | 3 | export let snd_walk: AudioSynthClip = { 4 | Kind: AudioClipKind.Synth, 5 | Tracks: [ 6 | { 7 | Instrument: [8, "lowpass", 11, 0, false, false, 8, 8, [[false, 8, 2, 1, 1]]], 8 | Notes: [72], 9 | }, 10 | ], 11 | Exit: 0.2, 12 | }; 13 | -------------------------------------------------------------------------------- /Animate/systems/sys_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_animate.ts -------------------------------------------------------------------------------- /Animate/systems/sys_audio_listener.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_audio_listener.ts -------------------------------------------------------------------------------- /Animate/systems/sys_audio_source.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_audio_source.ts -------------------------------------------------------------------------------- /Animate/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /Animate/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /Animate/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /Animate/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /DeferredShading/blueprints/blu_camera_main.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_target} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera_main(game: Game) { 8 | return [ 9 | transform(), 10 | children([ 11 | transform(undefined, [0, 1, 0, 0]), 12 | // Clear color must be black to not leak into the g-buffer. 13 | camera_target(game.Targets.Gbuffer, perspective(1, 0.1, 1000), [0, 0, 0, 0]), 14 | ]), 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /DeferredShading/components/com_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_animate.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_always.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_shake.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_spawn.ts -------------------------------------------------------------------------------- /DeferredShading/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /DeferredShading/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | DeferredShading 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /DeferredShading/index.ts: -------------------------------------------------------------------------------- 1 | import {create_texture_from, fetch_image} from "../lib/texture.js"; 2 | import {Game} from "./game.js"; 3 | import {scene_stage} from "./scenes/sce_stage.js"; 4 | 5 | let game = new Game(); 6 | 7 | // @ts-ignore 8 | window.game = game; 9 | 10 | Promise.all([load_texture(game, "checker1.png")]).then(() => { 11 | scene_stage(game); 12 | game.Start(); 13 | }); 14 | 15 | async function load_texture(game: Game, name: string) { 16 | let image = await fetch_image("../textures/" + name); 17 | game.Textures[name] = create_texture_from(game.Gl, image); 18 | } 19 | -------------------------------------------------------------------------------- /DeferredShading/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_always.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_render_deferred.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_deferred.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_render_depth.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_depth.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_render_shading.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_shading.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_shake.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_spawn.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /DeferredShading/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_ui.ts -------------------------------------------------------------------------------- /DeferredShading/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | 4 | export function App(game: Game) { 5 | return html`
6 | Point lights: ${game.LightCount} 7 |
`; 8 | } 9 | -------------------------------------------------------------------------------- /FirstPerson/actions.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | 3 | export const enum Action { 4 | ToggleFullscreen, 5 | } 6 | 7 | export function dispatch(game: Game, action: Action, args: unknown) { 8 | switch (action) { 9 | case Action.ToggleFullscreen: { 10 | if (document.fullscreenElement) { 11 | document.exitFullscreen(); 12 | } else { 13 | document.body.requestFullscreen(); 14 | } 15 | break; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /FirstPerson/blueprints/blu_camera_fly.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {control_player} from "../components/com_control_player.js"; 5 | import {move} from "../components/com_move.js"; 6 | import {transform} from "../components/com_transform.js"; 7 | import {Game} from "../game.js"; 8 | 9 | export function blueprint_camera_fly(game: Game) { 10 | return [ 11 | transform(), 12 | control_player(true, 0.1, 0.1, -89, 89), 13 | move(10, 2), 14 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 0.1, 1000))]), 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /FirstPerson/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_control_player.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_player.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_draw.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /FirstPerson/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /FirstPerson/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FirstPerson 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /FirstPerson/index.ts: -------------------------------------------------------------------------------- 1 | import {input_pointer_lock} from "../lib/input.js"; 2 | import {dispatch} from "./actions.js"; 3 | import {Game} from "./game.js"; 4 | import {scene_stage} from "./scenes/sce_stage.js"; 5 | 6 | let game = new Game(); 7 | input_pointer_lock(game); 8 | scene_stage(game); 9 | game.Start(); 10 | 11 | // @ts-ignore 12 | window.$ = dispatch.bind(null, game); 13 | 14 | // @ts-ignore 15 | window.game = game; 16 | -------------------------------------------------------------------------------- /FirstPerson/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_control_keyboard.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_keyboard.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_control_mouse_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_mouse_move.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_control_touch_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_touch_move.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_control_xbox.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_xbox.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_draw.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /FirstPerson/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_ui.ts -------------------------------------------------------------------------------- /FirstPerson/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | import {Fullscreen} from "./Fullscreen.js"; 4 | 5 | export function App(game: Game) { 6 | return html`
${Fullscreen()}
`; 7 | } 8 | -------------------------------------------------------------------------------- /FirstPerson/ui/Fullscreen.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Action} from "../actions.js"; 3 | 4 | export function Fullscreen() { 5 | return html` 6 |
16 | 27 |
28 | `; 29 | } 30 | -------------------------------------------------------------------------------- /FollowCamera/blueprints/blu_camera_follow.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {follow} from "../components/com_follow.js"; 5 | import {look_at} from "../components/com_look_at.js"; 6 | import {first_named} from "../components/com_named.js"; 7 | import {transform} from "../components/com_transform.js"; 8 | import {Game} from "../game.js"; 9 | 10 | export function blueprint_camera_follow(game: Game) { 11 | return [ 12 | transform(), 13 | follow(first_named(game.World, "camera anchor"), 0.01), 14 | look_at(first_named(game.World, "player"), 0.01), 15 | children([ 16 | transform(undefined, [0, 1, 0, 0]), 17 | camera_canvas(perspective(1, 0.1, 1000), [0.1, 0.5, 0.8, 1]), 18 | ]), 19 | ]; 20 | } 21 | -------------------------------------------------------------------------------- /FollowCamera/blueprints/blu_ground.ts: -------------------------------------------------------------------------------- 1 | import {float} from "../../lib/random.js"; 2 | import {children} from "../components/com_children.js"; 3 | import {collide} from "../components/com_collide.js"; 4 | import {render_colored_shaded} from "../components/com_render.js"; 5 | import {RigidKind, rigid_body} from "../components/com_rigid_body.js"; 6 | import {transform} from "../components/com_transform.js"; 7 | import {Game, Layer} from "../game.js"; 8 | 9 | export function blueprint_ground(game: Game) { 10 | return [ 11 | transform(), 12 | collide(false, Layer.Terrain, Layer.None), 13 | rigid_body(RigidKind.Static), 14 | children([ 15 | transform([0, float(-0.2, 0.2), 0]), 16 | render_colored_shaded(game.MaterialColoredShaded, game.MeshCube, [0, 1, 0.1, 1]), 17 | ]), 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /FollowCamera/blueprints/blu_obstacle.ts: -------------------------------------------------------------------------------- 1 | import {children} from "../components/com_children.js"; 2 | import {collide} from "../components/com_collide.js"; 3 | import {render_colored_shaded} from "../components/com_render.js"; 4 | import {RigidKind, rigid_body} from "../components/com_rigid_body.js"; 5 | import {transform} from "../components/com_transform.js"; 6 | import {Game, Layer} from "../game.js"; 7 | 8 | export function blueprint_obstacle(game: Game) { 9 | return [ 10 | transform(), 11 | collide(true, Layer.Obstacle, Layer.Terrain | Layer.Player), 12 | rigid_body(RigidKind.Dynamic, 0.3), 13 | children([ 14 | transform(), 15 | render_colored_shaded(game.MaterialColoredShaded, game.MeshCube, [0.5, 0.5, 0.5, 0.3]), 16 | ]), 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /FollowCamera/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_collide.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_control_player.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_player.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_follow.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_follow.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_look_at.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_look_at.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_named.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_named.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_rigid_body.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_rigid_body.ts -------------------------------------------------------------------------------- /FollowCamera/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /FollowCamera/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | FollowCamera 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /FollowCamera/index.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | import {scene_stage} from "./scenes/sce_stage.js"; 3 | 4 | let game = new Game(); 5 | scene_stage(game); 6 | game.Start(); 7 | 8 | // @ts-ignore 9 | window.game = game; 10 | -------------------------------------------------------------------------------- /FollowCamera/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_collide.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_debug.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_debug.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_follow.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_follow.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_look_at.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_look_at.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_physics_integrate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_integrate.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_physics_resolve.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_resolve.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /FollowCamera/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /ForwardShading/blueprints/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera(game: Game) { 8 | return [ 9 | transform(), 10 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 0.1, 1000))]), 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /ForwardShading/blueprints/blu_camera_minimap.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_target} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera_minimap(game: Game) { 8 | return [ 9 | transform(), 10 | children([ 11 | transform(undefined, [0, 1, 0, 0]), 12 | camera_target(game.Targets.Minimap, perspective(1, 0.1, 1000), [0.5, 0.7, 0.9, 1]), 13 | ]), 14 | ]; 15 | } 16 | -------------------------------------------------------------------------------- /ForwardShading/blueprints/blu_sun.ts: -------------------------------------------------------------------------------- 1 | import {orthographic} from "../../lib/projection.js"; 2 | import {camera_target} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {control_always} from "../components/com_control_always.js"; 5 | import {light_directional} from "../components/com_light.js"; 6 | import {move} from "../components/com_move.js"; 7 | import {transform} from "../components/com_transform.js"; 8 | import {Game} from "../game.js"; 9 | 10 | export function blueprint_sun(game: Game) { 11 | return [ 12 | transform(), 13 | control_always(null, [0, 1, 0, 0]), 14 | move(0, 0.5), 15 | children([ 16 | transform([0, 0, 10]), 17 | light_directional([1, 1, 1], 0.3), 18 | camera_target(game.Targets.Sun, orthographic([10, 10], 1, 100)), 19 | ]), 20 | ]; 21 | } 22 | -------------------------------------------------------------------------------- /ForwardShading/components/com_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_animate.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_always.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /ForwardShading/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /ForwardShading/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ForwardShading 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /ForwardShading/index.ts: -------------------------------------------------------------------------------- 1 | import {load_texture} from "../lib/load.js"; 2 | import {Game} from "./game.js"; 3 | import {scene_stage} from "./scenes/sce_stage.js"; 4 | 5 | let game = new Game(); 6 | 7 | // @ts-ignore 8 | window.game = game; 9 | 10 | Promise.all([ 11 | load_texture(game, "Bricks059_1K_Color.jpg"), 12 | load_texture(game, "Bricks059_1K_Normal.jpg"), 13 | load_texture(game, "Bricks059_1K_Roughness.jpg"), 14 | 15 | load_texture(game, "Wood063_1K_Color.jpg"), 16 | load_texture(game, "Wood063_1K_Normal.jpg"), 17 | load_texture(game, "Wood063_1K_Roughness.jpg"), 18 | 19 | load_texture(game, "Concrete018_1K_Color.jpg"), 20 | load_texture(game, "Concrete018_1K_Normal.jpg"), 21 | load_texture(game, "Concrete018_1K_Roughness.jpg"), 22 | ]).then(() => { 23 | scene_stage(game); 24 | game.Start(); 25 | }); 26 | -------------------------------------------------------------------------------- /ForwardShading/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_always.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_render_depth.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_depth.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /ForwardShading/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /Instancing/blueprints/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera(game: Game) { 8 | return [ 9 | transform(), 10 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 1, 150))]), 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /Instancing/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /Instancing/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /Instancing/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /Instancing/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /Instancing/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Instancing 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /Instancing/index.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | import {scene_stage} from "./scenes/sce_stage.js"; 3 | 4 | let game = new Game(); 5 | scene_stage(game); 6 | game.Start(); 7 | 8 | // @ts-ignore 9 | window.game = game; 10 | -------------------------------------------------------------------------------- /Instancing/materials/layout_instancing.ts: -------------------------------------------------------------------------------- 1 | export interface InstancedColumnLayout { 2 | InstanceColumn1: GLint; 3 | InstanceColumn2: GLint; 4 | InstanceColumn3: GLint; 5 | InstanceColumn4: GLint; 6 | } 7 | 8 | export interface InstancedColorLayout { 9 | InstanceColor: GLint; 10 | } 11 | 12 | export interface FogLayout { 13 | Eye: WebGLUniformLocation; 14 | FogColor: WebGLUniformLocation; 15 | FogDistance: WebGLUniformLocation; 16 | } 17 | -------------------------------------------------------------------------------- /Instancing/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /Instancing/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /Instancing/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /Instancing/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /Instancing/world.ts: -------------------------------------------------------------------------------- 1 | import {WorldImpl} from "../lib/world.js"; 2 | import {Camera} from "./components/com_camera.js"; 3 | import {Children} from "./components/com_children.js"; 4 | import {Light} from "./components/com_light.js"; 5 | import {Render} from "./components/com_render_instanced.js"; 6 | import {Transform} from "./components/com_transform.js"; 7 | 8 | const enum Component { 9 | Camera, 10 | Children, 11 | Dirty, 12 | Light, 13 | Render, 14 | Transform, 15 | } 16 | 17 | export const enum Has { 18 | None = 0, 19 | Camera = 1 << Component.Camera, 20 | Children = 1 << Component.Children, 21 | Dirty = 1 << Component.Dirty, 22 | Light = 1 << Component.Light, 23 | Render = 1 << Component.Render, 24 | Transform = 1 << Component.Transform, 25 | } 26 | 27 | export class World extends WorldImpl { 28 | Camera: Array = []; 29 | Children: Array = []; 30 | Light: Array = []; 31 | Render: Array = []; 32 | Transform: Array = []; 33 | } 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | ISC License 2 | 3 | Copyright 2019 Contributors to the Goodluck project. 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /Monkey/blueprints/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera(game: Game) { 8 | return [ 9 | transform(), 10 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 0.1, 1000))]), 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /Monkey/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /Monkey/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /Monkey/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /Monkey/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /Monkey/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /Monkey/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /Monkey/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Monkey 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /Monkey/index.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | import {scene_stage} from "./scenes/sce_stage.js"; 3 | 4 | let game = new Game(); 5 | scene_stage(game); 6 | game.Start(); 7 | 8 | // @ts-ignore 9 | window.game = game; 10 | -------------------------------------------------------------------------------- /Monkey/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /Monkey/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /Monkey/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /Monkey/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /Monkey/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /NewProject3D/actions.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../lib/world.js"; 2 | import {destroy_all} from "./components/com_children.js"; 3 | import {Game} from "./game.js"; 4 | 5 | export const enum Action { 6 | ToggleFullscreen, 7 | CollectItem, 8 | ExpireItem, 9 | } 10 | 11 | export function dispatch(game: Game, action: Action, payload: unknown) { 12 | switch (action) { 13 | case Action.ToggleFullscreen: { 14 | if (document.fullscreenElement) { 15 | document.exitFullscreen(); 16 | } else { 17 | document.body.requestFullscreen(); 18 | } 19 | break; 20 | } 21 | case Action.CollectItem: { 22 | let [item_entity] = payload as [Entity, Entity]; 23 | destroy_all(game.World, item_entity); 24 | game.ItemsCollected++; 25 | break; 26 | } 27 | case Action.ExpireItem: { 28 | game.ItemsMissed++; 29 | break; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /NewProject3D/blueprints/blu_camera_follow.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {mimic} from "../components/com_mimic.js"; 5 | import {first_named} from "../components/com_named.js"; 6 | import {transform} from "../components/com_transform.js"; 7 | import {Game} from "../game.js"; 8 | 9 | export function blueprint_camera_follow(game: Game) { 10 | return [ 11 | transform(), 12 | mimic(first_named(game.World, "camera anchor")), 13 | children([ 14 | transform([0, 1, -6], [0, 1, 0, 0]), 15 | camera_canvas(perspective(1, 0.1, 1000), [0.1, 0.5, 0.8, 1]), 16 | ]), 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /NewProject3D/blueprints/blu_ground.ts: -------------------------------------------------------------------------------- 1 | import {float} from "../../lib/random.js"; 2 | import {children} from "../components/com_children.js"; 3 | import {collide} from "../components/com_collide.js"; 4 | import {render_colored_shaded} from "../components/com_render.js"; 5 | import {RigidKind, rigid_body} from "../components/com_rigid_body.js"; 6 | import {transform} from "../components/com_transform.js"; 7 | import {Game, Layer} from "../game.js"; 8 | 9 | export function blueprint_ground(game: Game) { 10 | return [ 11 | transform(), 12 | collide(false, Layer.Terrain, Layer.None), 13 | rigid_body(RigidKind.Static), 14 | children([ 15 | transform([0, float(-0.2, 0.2), 0]), 16 | render_colored_shaded(game.MaterialColoredShaded, game.MeshCube, [0, 1, 0.1, 1]), 17 | ]), 18 | ]; 19 | } 20 | -------------------------------------------------------------------------------- /NewProject3D/blueprints/blu_obstacle.ts: -------------------------------------------------------------------------------- 1 | import {children} from "../components/com_children.js"; 2 | import {collide} from "../components/com_collide.js"; 3 | import {render_colored_shaded} from "../components/com_render.js"; 4 | import {RigidKind, rigid_body} from "../components/com_rigid_body.js"; 5 | import {transform} from "../components/com_transform.js"; 6 | import {Game, Layer} from "../game.js"; 7 | 8 | export function blueprint_obstacle(game: Game) { 9 | return [ 10 | transform(), 11 | collide(true, Layer.Obstacle, Layer.Terrain | Layer.Player), 12 | rigid_body(RigidKind.Dynamic, 0.3), 13 | children([ 14 | transform(), 15 | render_colored_shaded(game.MaterialColoredShaded, game.MeshCube, [0.5, 0.5, 0.5, 0.3]), 16 | ]), 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /NewProject3D/components/com_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_animate.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_audio_listener.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_audio_listener.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_audio_source.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_audio_source.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_callback.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_callback.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_collide.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_always.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_control_player.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_player.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_disable.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_disable.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_draw.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_lifespan.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_lifespan.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_mimic.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_mimic.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_named.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_named.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_rigid_body.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_rigid_body.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_shake.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_spawn.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_task.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_task.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_toggle.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_toggle.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /NewProject3D/components/com_trigger.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_trigger.ts -------------------------------------------------------------------------------- /NewProject3D/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | NewProject3D 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /NewProject3D/index.ts: -------------------------------------------------------------------------------- 1 | import {input_pointer_lock} from "../lib/input.js"; 2 | import {dispatch} from "./actions.js"; 3 | import {Game} from "./game.js"; 4 | import {scene_stage} from "./scenes/sce_stage.js"; 5 | 6 | let game = new Game(); 7 | input_pointer_lock(game); 8 | scene_stage(game); 9 | game.Start(); 10 | 11 | // @ts-ignore 12 | window.$ = dispatch.bind(null, game); 13 | 14 | // @ts-ignore 15 | window.game = game; 16 | -------------------------------------------------------------------------------- /NewProject3D/systems/sys_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_animate.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_audio_listener.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_audio_listener.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_audio_source.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_audio_source.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_collide.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_always.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_control_keyboard.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_keyboard.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_control_mouse_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_mouse_move.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_control_touch_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_touch_move.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_control_xbox.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_xbox.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_debug.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_debug.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_draw.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_lifespan.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_lifespan.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_mimic.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_mimic.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_particles.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_physics_integrate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_integrate.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_physics_kinematic.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_kinematic.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_physics_resolve.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_resolve.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_poll.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_poll.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_shake.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_spawn.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_toggle.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_toggle.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_trigger.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_trigger.ts -------------------------------------------------------------------------------- /NewProject3D/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_ui.ts -------------------------------------------------------------------------------- /NewProject3D/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | import {Fullscreen} from "./Fullscreen.js"; 4 | import {Score} from "./Score.js"; 5 | 6 | export function App(game: Game) { 7 | return html`
${Fullscreen()} ${Score(game)}
`; 8 | } 9 | -------------------------------------------------------------------------------- /NewProject3D/ui/Fullscreen.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Action} from "../actions.js"; 3 | 4 | export function Fullscreen() { 5 | return html` 6 |
16 | 27 |
28 | `; 29 | } 30 | -------------------------------------------------------------------------------- /NewProject3D/ui/Score.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | 4 | export function Score(game: Game) { 5 | return html` 6 |
24 |
Collected: ${game.ItemsCollected}
25 |
Missed: ${game.ItemsMissed}
26 |
27 | `; 28 | } 29 | -------------------------------------------------------------------------------- /PathFinding/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /PathFinding/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /PathFinding/components/com_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_collide.ts -------------------------------------------------------------------------------- /PathFinding/components/com_control_dolly.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../lib/world"; 2 | import {Game} from "../game"; 3 | import {Has} from "../world"; 4 | 5 | export interface ControlDolly { 6 | MoveSpeed: number; 7 | } 8 | 9 | /** 10 | * @param move_speed - Base movement speed. It will be adjusted by the current dolly level. 11 | */ 12 | export function control_dolly(move_speed: number) { 13 | return (game: Game, entity: Entity) => { 14 | game.World.Signature[entity] |= Has.ControlDolly; 15 | game.World.ControlDolly[entity] = { 16 | MoveSpeed: move_speed, 17 | }; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /PathFinding/components/com_control_player.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_player.ts -------------------------------------------------------------------------------- /PathFinding/components/com_disable.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_disable.ts -------------------------------------------------------------------------------- /PathFinding/components/com_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_draw.ts -------------------------------------------------------------------------------- /PathFinding/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /PathFinding/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /PathFinding/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /PathFinding/components/com_nav_agent.ts: -------------------------------------------------------------------------------- 1 | import {Vec3} from "../../lib/math.js"; 2 | import {NavMesh} from "../../lib/navmesh.js"; 3 | import {Entity} from "../../lib/world.js"; 4 | import {Game} from "../game.js"; 5 | import {Has} from "../world.js"; 6 | 7 | export interface NavAgent { 8 | NavMesh: NavMesh; 9 | Origin: number; 10 | Goal?: NavDestination; 11 | Waypoints?: Array; 12 | } 13 | 14 | export interface NavDestination { 15 | Node: number; 16 | Position: Vec3; 17 | } 18 | 19 | /** 20 | * The NavAgent mixin. 21 | * 22 | * @param navmesh - The navmesh used for path finding. 23 | * @param origin - The node of the path finding graph that this entity is 24 | * currently at. 25 | */ 26 | export function nav_agent(navmesh: NavMesh, origin: number) { 27 | return (game: Game, entity: Entity) => { 28 | game.World.Signature[entity] |= Has.NavAgent; 29 | game.World.NavAgent[entity] = { 30 | NavMesh: navmesh, 31 | Origin: origin, 32 | }; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /PathFinding/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /PathFinding/components/com_selectable.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../lib/world.js"; 2 | import {Game} from "../game.js"; 3 | import {Has} from "../world.js"; 4 | 5 | export interface Selectable { 6 | Selected: SelectedState; 7 | } 8 | 9 | export const enum SelectedState { 10 | None, 11 | ThisFrame, 12 | Currently, 13 | } 14 | 15 | export function selectable() { 16 | return (game: Game, entity: Entity) => { 17 | game.World.Signature[entity] |= Has.Selectable; 18 | game.World.Selectable[entity] = { 19 | Selected: SelectedState.None, 20 | }; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /PathFinding/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /PathFinding/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PathFinding 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /PathFinding/index.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | import {scene_stage} from "./scenes/sce_stage.js"; 3 | 4 | let game = new Game(); 5 | scene_stage(game); 6 | game.Start(); 7 | 8 | // @ts-ignore 9 | window.game = game; 10 | -------------------------------------------------------------------------------- /PathFinding/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_collide.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_control_keyboard.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_keyboard.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_control_mouse_drag.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_mouse_drag.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_control_touch_drag.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_touch_drag.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_draw.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /PathFinding/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /Platformer2D/actions.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | 3 | export const enum Action { 4 | NoOp, 5 | } 6 | 7 | export function dispatch(game: Game, action: Action, payload: unknown) { 8 | switch (action) { 9 | case Action.NoOp: { 10 | break; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Platformer2D/components/com_animate_sprite.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_animate_sprite.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_callback.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_callback.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_camera2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_collide2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_collide2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_control_always2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_always2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_control_player.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * @module components/com_control_player 3 | */ 4 | 5 | import {Entity} from "../../lib/world.js"; 6 | import {Game} from "../game.js"; 7 | import {Has} from "../world.js"; 8 | 9 | export interface ControlPlayer {} 10 | 11 | export function control_player() { 12 | return (game: Game, entity: Entity) => { 13 | game.World.Signature[entity] |= Has.ControlPlayer; 14 | game.World.ControlPlayer[entity] = {}; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /Platformer2D/components/com_disable.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_disable.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_draw.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_draw.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_lifespan.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_lifespan.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_local_transform2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_local_transform2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_move2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_named.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_named.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_render2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_rigid_body2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_rigid_body2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_shake.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_spatial_node2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_spatial_node2d.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_spawn.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_task.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_task.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_toggle.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_toggle.ts -------------------------------------------------------------------------------- /Platformer2D/components/com_trigger.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_trigger.ts -------------------------------------------------------------------------------- /Platformer2D/index.ts: -------------------------------------------------------------------------------- 1 | import {dispatch} from "./actions.js"; 2 | import {Game} from "./game.js"; 3 | import {scene_platforms} from "./scenes/sce_platforms.js"; 4 | 5 | let game = new Game(); 6 | scene_platforms(game); 7 | game.Start(); 8 | 9 | // @ts-ignore 10 | window.$ = dispatch.bind(null, game); 11 | 12 | // @ts-ignore 13 | window.game = game; 14 | -------------------------------------------------------------------------------- /Platformer2D/maps/Makefile: -------------------------------------------------------------------------------- 1 | all: map_platforms.ts 2 | 3 | %.ts: %.tmj 4 | node ../../util/tiled_tmj2map.cjs $< > $@ 5 | -------------------------------------------------------------------------------- /Platformer2D/scenes/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {camera2d} from "../components/com_camera2d.js"; 2 | import {local_transform2d} from "../components/com_local_transform2d.js"; 3 | import {spatial_node2d} from "../components/com_spatial_node2d.js"; 4 | import {Game} from "../game.js"; 5 | 6 | export function blueprint_camera(game: Game) { 7 | return [spatial_node2d(), local_transform2d(), camera2d([0, 0])]; 8 | } 9 | -------------------------------------------------------------------------------- /Platformer2D/scenes/blu_player.ts: -------------------------------------------------------------------------------- 1 | import {animate_sprite} from "../components/com_animate_sprite.js"; 2 | import {collide2d} from "../components/com_collide2d.js"; 3 | import {control_player} from "../components/com_control_player.js"; 4 | import {disable} from "../components/com_disable.js"; 5 | import {local_transform2d} from "../components/com_local_transform2d.js"; 6 | import {render2d} from "../components/com_render2d.js"; 7 | import {RigidKind, rigid_body2d} from "../components/com_rigid_body2d.js"; 8 | import {spatial_node2d} from "../components/com_spatial_node2d.js"; 9 | import {Game, Layer} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | export function blueprint_player(game: Game) { 13 | return [ 14 | spatial_node2d(), 15 | local_transform2d(undefined, 0, [1.5, 1.5]), 16 | collide2d(true, Layer.Object, Layer.Terrain | Layer.Object, [1.5, 1.5]), 17 | rigid_body2d(RigidKind.Dynamic, 0.3), 18 | control_player(), 19 | render2d("6"), 20 | animate_sprite({6: 0.4, 7: 0.4}), 21 | disable(Has.AnimateSprite), 22 | ]; 23 | } 24 | -------------------------------------------------------------------------------- /Platformer2D/scenes/blu_square.ts: -------------------------------------------------------------------------------- 1 | import {animate_sprite} from "../components/com_animate_sprite.js"; 2 | import {collide2d} from "../components/com_collide2d.js"; 3 | import {lifespan} from "../components/com_lifespan.js"; 4 | import {local_transform2d} from "../components/com_local_transform2d.js"; 5 | import {render2d} from "../components/com_render2d.js"; 6 | import {RigidKind, rigid_body2d} from "../components/com_rigid_body2d.js"; 7 | import {spatial_node2d} from "../components/com_spatial_node2d.js"; 8 | import {Game, Layer} from "../game.js"; 9 | 10 | export const SQUARE_LIFESPAN = 10; 11 | 12 | export function blueprint_square(game: Game) { 13 | return [ 14 | spatial_node2d(), 15 | local_transform2d(undefined, 0, [1.5, 1.5]), 16 | collide2d(true, Layer.Object, Layer.Terrain | Layer.Player | Layer.Object, [1.125, 1.125]), 17 | rigid_body2d(RigidKind.Dynamic, 0.3), 18 | render2d("13"), 19 | animate_sprite({13: 0.8, 14: 0.4}), 20 | lifespan(SQUARE_LIFESPAN), 21 | ]; 22 | } 23 | -------------------------------------------------------------------------------- /Platformer2D/sprites/License.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | Pixel Platformer (1.1) 4 | 5 | Created/distributed by Kenney (www.kenney.nl) 6 | Creation date: 03-07-2021 7 | 8 | ------------------------------ 9 | 10 | License: (Creative Commons Zero, CC0) 11 | http://creativecommons.org/publicdomain/zero/1.0/ 12 | 13 | This content is free to use in personal, educational and commercial projects. 14 | Support us by crediting Kenney or www.kenney.nl (this is not mandatory) 15 | 16 | ------------------------------ 17 | 18 | Donate: http://support.kenney.nl 19 | Patreon: http://patreon.com/kenney/ 20 | 21 | Follow on Twitter for updates: 22 | http://twitter.com/KenneyNL -------------------------------------------------------------------------------- /Platformer2D/sprites/Makefile: -------------------------------------------------------------------------------- 1 | # See https://developers.google.com/speed/webp/download. 2 | # On Ubuntu, install the `webp` package. 3 | 4 | SPRITES := $(shell node ../../util/tiled_tile_names.cjs atlas.tsj) 5 | PADDED := $(SPRITES:%.png=%.pad.png) 6 | 7 | all: atlas.png.webp atlas.ts 8 | 9 | atlas.png: atlas.tsj $(PADDED) 10 | convert $(PADDED) -background None -append $@ 11 | 12 | %.png.webp: %.png 13 | cwebp -short -z 9 $< -o $@ 14 | 15 | atlas.ts: atlas.tsj 16 | node ../../util/tiled_tsj2atlas.cjs $< > $@ 17 | 18 | $(PADDED): %.pad.png: %.png 19 | convert $< -set option:distort:viewport "%[fx:w+2]x%[fx:h+2]"-1-1 -virtual-pixel Edge -filter point -distort SRT 0 +repage $@ 20 | -------------------------------------------------------------------------------- /Platformer2D/sprites/atlas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/atlas.png -------------------------------------------------------------------------------- /Platformer2D/sprites/atlas.png.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/atlas.png.webp -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0000.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0001.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0002.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0003.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0004.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0005.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0006.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0007.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0009.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0010.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0011.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0012.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0012.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0013.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0013.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0014.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0014.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0015.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0015.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0016.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0017.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0018.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0019.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0020.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0021.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0022.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0023.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0024.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0025.png -------------------------------------------------------------------------------- /Platformer2D/sprites/character_0026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/character_0026.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0000.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0001.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0002.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0002.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0003.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0003.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0004.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0004.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0005.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0005.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0006.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0007.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0007.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0008.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0009.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0009.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0010.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0010.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0011.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0011.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0016.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0016.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0017.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0017.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0018.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0018.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0019.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0019.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0020.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0020.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0021.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0021.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0022.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0022.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0023.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0023.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0024.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0025.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0025.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0026.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0026.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0027.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0027.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0028.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0028.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0029.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0029.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0030.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0030.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0031.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0031.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0033.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0033.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0034.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0034.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0035.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0035.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0036.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0036.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0037.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0037.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0038.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0038.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0039.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0039.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0040.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0040.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0041.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0041.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0042.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0042.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0043.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0043.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0044.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0044.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0045.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0045.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0046.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0046.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0047.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0047.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0048.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0048.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0049.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0050.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0050.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0051.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0051.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0053.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0053.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0054.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0054.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0055.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0055.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0056.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0056.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0057.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0057.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0058.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0058.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0059.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0059.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0060.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0060.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0061.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0061.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0062.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0062.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0063.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0063.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0064.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0064.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0065.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0065.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0066.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0066.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0067.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0067.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0068.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0068.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0069.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0069.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0070.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0070.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0071.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0071.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0073.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0073.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0074.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0074.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0075.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0075.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0076.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0076.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0077.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0077.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0078.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0078.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0079.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0079.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0086.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0086.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0087.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0087.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0088.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0088.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0089.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0089.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0090.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0090.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0091.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0091.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0092.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0092.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0093.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0093.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0094.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0094.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0095.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0095.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0096.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0096.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0097.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0097.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0098.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0098.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0099.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0099.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0104.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0105.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0105.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0106.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0106.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0107.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0107.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0108.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0108.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0109.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0109.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0110.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0111.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0111.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0112.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0112.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0113.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0113.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0114.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0115.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0115.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0116.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0116.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0117.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0117.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0118.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0118.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0119.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0119.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0120.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0121.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0121.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0122.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0122.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0123.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0123.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0124.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0124.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0125.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0126.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0126.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0127.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0127.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0128.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0129.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0129.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0130.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0130.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0131.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0131.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0132.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0132.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0133.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0133.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0134.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0135.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0135.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0136.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0136.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0137.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0137.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0138.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0138.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0139.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0139.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0140.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0140.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0141.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0141.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0142.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0142.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0143.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0143.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0146.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0146.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0147.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0147.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0148.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0148.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0149.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0149.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0150.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0151.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0151.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0152.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0153.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0153.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0154.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0154.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0155.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0155.png -------------------------------------------------------------------------------- /Platformer2D/sprites/tile_0156.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/Platformer2D/sprites/tile_0156.png -------------------------------------------------------------------------------- /Platformer2D/systems/sys_camera2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_collide2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_collide2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_control_always2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_always2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_draw2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_draw2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_lifespan.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_lifespan.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_move2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_physics2d_integrate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics2d_integrate.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_physics2d_resolve.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics2d_resolve.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_poll.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_poll.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_render2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_render2d_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render2d_animate.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_resize2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_shake2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_shake2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_spawn2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_spawn2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_toggle.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_toggle.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_transform2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_trigger2d.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_trigger2d.ts -------------------------------------------------------------------------------- /Platformer2D/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_ui.ts -------------------------------------------------------------------------------- /Platformer2D/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | import {SQUARE_LIFESPAN} from "../scenes/blu_square.js"; 4 | 5 | export function App(game: Game) { 6 | return html` 7 |
8 |

Platformer2D

9 |
Click to spawn new squares.
10 |
A square lives for ${SQUARE_LIFESPAN} seconds.
11 |
12 | `; 13 | } 14 | -------------------------------------------------------------------------------- /RigidBody/actions.ts: -------------------------------------------------------------------------------- 1 | ../core/actions.ts -------------------------------------------------------------------------------- /RigidBody/blueprints/blu_box.ts: -------------------------------------------------------------------------------- 1 | import {collide} from "../components/com_collide.js"; 2 | import {lifespan} from "../components/com_lifespan.js"; 3 | import {render_colored_shaded} from "../components/com_render.js"; 4 | import {RigidKind, rigid_body} from "../components/com_rigid_body.js"; 5 | import {transform} from "../components/com_transform.js"; 6 | import {Game, Layer} from "../game.js"; 7 | 8 | export function blueprint_box(game: Game) { 9 | return [ 10 | transform(), 11 | render_colored_shaded(game.MaterialColoredGouraud, game.MeshCube, [1, 0.3, 0, 1]), 12 | collide(true, Layer.Physics, Layer.Terrain | Layer.Physics), 13 | rigid_body(RigidKind.Dynamic), 14 | lifespan(7), 15 | ]; 16 | } 17 | -------------------------------------------------------------------------------- /RigidBody/blueprints/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera(game: Game) { 8 | return [ 9 | transform(), 10 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 0.1, 1000))]), 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /RigidBody/blueprints/blu_hand.ts: -------------------------------------------------------------------------------- 1 | import {children} from "../components/com_children.js"; 2 | import {collide} from "../components/com_collide.js"; 3 | import {render_colored_shaded} from "../components/com_render.js"; 4 | import {RigidKind, rigid_body} from "../components/com_rigid_body.js"; 5 | import {transform} from "../components/com_transform.js"; 6 | import {Game, Layer} from "../game.js"; 7 | 8 | export function blueprint_hand(game: Game) { 9 | return [ 10 | transform(), 11 | collide(true, Layer.Physics, Layer.Physics, [0.5, 0.5, 0.5]), 12 | rigid_body(RigidKind.Kinematic), 13 | children([ 14 | transform(undefined, undefined, [3, 3, 3]), 15 | render_colored_shaded(game.MaterialColoredGouraud, game.MeshHand, [1, 1, 0.3, 1]), 16 | ]), 17 | ]; 18 | } 19 | -------------------------------------------------------------------------------- /RigidBody/components/com_animate.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_animate.ts -------------------------------------------------------------------------------- /RigidBody/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /RigidBody/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /RigidBody/components/com_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_collide.ts -------------------------------------------------------------------------------- /RigidBody/components/com_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_control_always.ts -------------------------------------------------------------------------------- /RigidBody/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /RigidBody/components/com_lifespan.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_lifespan.ts -------------------------------------------------------------------------------- /RigidBody/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /RigidBody/components/com_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_move.ts -------------------------------------------------------------------------------- /RigidBody/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /RigidBody/components/com_rigid_body.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_rigid_body.ts -------------------------------------------------------------------------------- /RigidBody/components/com_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_shake.ts -------------------------------------------------------------------------------- /RigidBody/components/com_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_spawn.ts -------------------------------------------------------------------------------- /RigidBody/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /RigidBody/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | RigidBody 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 |
14 |
update:
15 |
delta:
16 |
fps:
17 |
18 |
19 | 32 | 33 | -------------------------------------------------------------------------------- /RigidBody/index.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | import {scene_stage} from "./scenes/sce_stage.js"; 3 | 4 | let game = new Game(); 5 | scene_stage(game); 6 | game.Start(); 7 | 8 | // @ts-ignore 9 | window.game = game; 10 | -------------------------------------------------------------------------------- /RigidBody/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_collide.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_collide.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_control_always.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_control_always.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_debug.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_debug.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_lifespan.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_lifespan.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_move.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_move.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_physics_integrate.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_integrate.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_physics_kinematic.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_kinematic.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_physics_resolve.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_physics_resolve.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_shake.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_shake.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_spawn.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_spawn.ts -------------------------------------------------------------------------------- /RigidBody/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /TodoApp/actions.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | 3 | export const enum Action { 4 | AddTodo, 5 | CompleteTodo, 6 | } 7 | 8 | export function dispatch(game: Game, action: Action, payload: unknown) { 9 | switch (action) { 10 | case Action.AddTodo: { 11 | let todo = payload as string; 12 | if (todo) { 13 | game.Todos.push(todo); 14 | } 15 | break; 16 | } 17 | case Action.CompleteTodo: { 18 | let idx = payload as number; 19 | if (idx < game.Todos.length) { 20 | let removed = game.Todos.splice(idx, 1); 21 | game.Completed.push(...removed); 22 | } 23 | break; 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /TodoApp/game.ts: -------------------------------------------------------------------------------- 1 | import {GameImpl} from "../lib/game.js"; 2 | import {WorldImpl} from "../lib/world.js"; 3 | import {sys_ui} from "./systems/sys_ui.js"; 4 | 5 | export class Game extends GameImpl { 6 | World = new WorldImpl(); 7 | 8 | Todos: Array = []; 9 | Completed: Array = []; 10 | 11 | override FrameUpdate(delta: number) { 12 | sys_ui(this, delta); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /TodoApp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TodoApp 5 | 6 | 7 | 12 | 13 | 14 |
15 | 16 |
17 |
update:
18 |
delta:
19 |
fps:
20 |
21 |
22 | 35 | 36 | -------------------------------------------------------------------------------- /TodoApp/index.ts: -------------------------------------------------------------------------------- 1 | import {dispatch} from "./actions.js"; 2 | import {Game} from "./game.js"; 3 | 4 | let game = new Game(); 5 | game.Start(); 6 | 7 | // @ts-ignore 8 | window.$ = dispatch.bind(null, game); 9 | 10 | // @ts-ignore 11 | window.game = game; 12 | -------------------------------------------------------------------------------- /TodoApp/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_ui.ts -------------------------------------------------------------------------------- /TodoApp/ui/AddForm.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Action} from "../actions.js"; 3 | 4 | export function AddForm() { 5 | return html` 6 | 12 | 13 | `; 14 | } 15 | -------------------------------------------------------------------------------- /TodoApp/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | import {AddForm} from "./AddForm.js"; 4 | import {CompletedItem} from "./CompletedItem.js"; 5 | import {TodoItem} from "./TodoItem.js"; 6 | 7 | export function App(game: Game) { 8 | return html` 9 |
10 |

Todo App

11 |
${AddForm()}
12 |
13 |
14 |
    15 | ${game.Todos.map(TodoItem)} 16 |
17 |
18 |
19 |
    20 | ${game.Completed.map(CompletedItem)} 21 |
22 |
23 |
24 |
25 | `; 26 | } 27 | -------------------------------------------------------------------------------- /TodoApp/ui/CompletedItem.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | 3 | export function CompletedItem(content: string) { 4 | return html` 5 |
  • 6 | 12 | ${content} 13 | 14 |
  • 15 | `; 16 | } 17 | -------------------------------------------------------------------------------- /TodoApp/ui/TodoItem.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Action} from "../actions.js"; 3 | 4 | export function TodoItem(content: string, idx: number) { 5 | return html` 6 |
  • 7 | ${content} 8 | 16 | complete 17 | 18 |
  • 19 | `; 20 | } 21 | -------------------------------------------------------------------------------- /WebXR/actions.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | 3 | export const enum Action { 4 | EnterVr, 5 | ExitVr, 6 | } 7 | 8 | export function dispatch(game: Game, action: Action, args: unknown) { 9 | switch (action) { 10 | case Action.EnterVr: { 11 | if (game.XrSupported) { 12 | game.EnterXR(); 13 | } 14 | break; 15 | } 16 | case Action.ExitVr: { 17 | if (game.XrFrame) { 18 | game.XrFrame.session.end(); 19 | } 20 | break; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /WebXR/blueprints/blu_camera.ts: -------------------------------------------------------------------------------- 1 | import {perspective} from "../../lib/projection.js"; 2 | import {camera_canvas} from "../components/com_camera.js"; 3 | import {children} from "../components/com_children.js"; 4 | import {transform} from "../components/com_transform.js"; 5 | import {Game} from "../game.js"; 6 | 7 | export function blueprint_camera(game: Game) { 8 | return [ 9 | transform(), 10 | children([transform(undefined, [0, 1, 0, 0]), camera_canvas(perspective(1, 0.1, 1000))]), 11 | ]; 12 | } 13 | -------------------------------------------------------------------------------- /WebXR/components/com_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_camera.ts -------------------------------------------------------------------------------- /WebXR/components/com_children.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_children.ts -------------------------------------------------------------------------------- /WebXR/components/com_control_xr.ts: -------------------------------------------------------------------------------- 1 | import {Entity} from "../../lib/world.js"; 2 | import {Game} from "../game.js"; 3 | import {Has} from "../world.js"; 4 | 5 | export const enum ControlXrKind { 6 | Head, 7 | Left, 8 | Right, 9 | } 10 | 11 | export interface ControlXr { 12 | Kind: ControlXrKind; 13 | Squeezed: boolean; 14 | } 15 | 16 | export function control_xr(kind: ControlXrKind) { 17 | return (game: Game, entity: Entity) => { 18 | game.World.Signature[entity] |= Has.ControlXr; 19 | game.World.ControlXr[entity] = { 20 | Kind: kind, 21 | Squeezed: false, 22 | }; 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /WebXR/components/com_emit_particles.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_emit_particles.ts -------------------------------------------------------------------------------- /WebXR/components/com_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_light.ts -------------------------------------------------------------------------------- /WebXR/components/com_render.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_render.ts -------------------------------------------------------------------------------- /WebXR/components/com_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/components/com_transform.ts -------------------------------------------------------------------------------- /WebXR/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WebXR 5 | 6 | 7 | 8 | 9 | 10 | 11 |
    12 | 13 |
    14 |
    update:
    15 |
    delta:
    16 |
    fps:
    17 |
    18 |
    19 | 33 | 34 | -------------------------------------------------------------------------------- /WebXR/index.ts: -------------------------------------------------------------------------------- 1 | import {dispatch} from "./actions.js"; 2 | import {Game} from "./game.js"; 3 | import {scene_stage} from "./scenes/sce_stage.js"; 4 | 5 | let game = new Game(); 6 | scene_stage(game); 7 | game.Start(); 8 | 9 | // @ts-ignore 10 | window.$ = dispatch.bind(null, game); 11 | 12 | // @ts-ignore 13 | window.game = game; 14 | -------------------------------------------------------------------------------- /WebXR/systems/sys_camera.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_camera_xr.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_camera_xr.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_light.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_light.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_render_forward.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_forward.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_render_xr.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_render_xr.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_resize.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_resize.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_transform.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_transform.ts -------------------------------------------------------------------------------- /WebXR/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | ../../core/systems/sys_ui.ts -------------------------------------------------------------------------------- /WebXR/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {html} from "../../lib/html.js"; 2 | import {Game} from "../game.js"; 3 | import {EnterVr} from "./EnterVr.js"; 4 | 5 | export function App(game: Game) { 6 | return html`
    ${EnterVr(game)}
    `; 7 | } 8 | -------------------------------------------------------------------------------- /assets/README.md: -------------------------------------------------------------------------------- 1 | # Assets 2 | 3 | The Blender files in this directory are first exported to GLTF, 4 | and then converted to TypeScript source files in `meshes/` 5 | using `make -C meshes`. 6 | 7 | Even though GLTF files contain data buffers that are ready to be uploaded to the GPU, 8 | the mesh files reconstruct the arrays of numbers from these buffers. 9 | This is done for two reasons: 10 | 11 | - Some logic requires the actual vertex data anyways, e.g. 12 | path finding on a navigation mesh, 13 | tangent and bitangent computation for normal mapping, etc. 14 | 15 | - In testing, it turned out that DEFLATE can compress these source files better than the equivalent GLTF files. 16 | 17 | ## Hints for GLTF Export 18 | 19 | - Export only one mesh at a time. 20 | - +Y is up. 21 | - Apply modifiers. 22 | -------------------------------------------------------------------------------- /assets/cube.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/cube.blend -------------------------------------------------------------------------------- /assets/fire.pyxel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/fire.pyxel -------------------------------------------------------------------------------- /assets/hand.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/hand.blend -------------------------------------------------------------------------------- /assets/icosphere_flat.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/icosphere_flat.blend -------------------------------------------------------------------------------- /assets/icosphere_smooth.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/icosphere_smooth.blend -------------------------------------------------------------------------------- /assets/ludek.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/ludek.blend -------------------------------------------------------------------------------- /assets/monkey_flat.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/monkey_flat.blend -------------------------------------------------------------------------------- /assets/monkey_smooth.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/monkey_smooth.blend -------------------------------------------------------------------------------- /assets/plane.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/plane.blend -------------------------------------------------------------------------------- /assets/quad.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/quad.blend -------------------------------------------------------------------------------- /assets/terrain.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/assets/terrain.blend -------------------------------------------------------------------------------- /core/actions.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "./game.js"; 2 | 3 | export const enum Action { 4 | NoOp, 5 | } 6 | 7 | export function dispatch(game: Game, action: Action, payload: unknown) { 8 | switch (action) { 9 | case Action.NoOp: { 10 | break; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /core/components/com_animate_sprite.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # AnimateSprite 3 | * 4 | * The `AnimateSprite` component cycles through spritesheet tiles. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | import {Has} from "../world.js"; 10 | 11 | export interface AnimateSprite { 12 | Frames: Record; 13 | Duration: number; 14 | Time: number; 15 | } 16 | 17 | export function animate_sprite(frames: Record) { 18 | let duration = 0; 19 | for (let frame_name in frames) { 20 | let frame_duration = frames[frame_name]; 21 | duration = frames[frame_name] = duration + frame_duration; 22 | } 23 | 24 | return (game: Game, entity: Entity) => { 25 | game.World.Signature[entity] |= Has.AnimateSprite; 26 | game.World.AnimateSprite[entity] = { 27 | Frames: frames, 28 | Duration: duration, 29 | Time: 0, 30 | }; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /core/components/com_audio_listener.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # AudioListener 3 | * 4 | * The [transform](com_transform.html) of the entity with the `AudioListener` 5 | * component will be used to set the position and orientation of `game.Audio`'s 6 | * listener. 7 | */ 8 | 9 | import {Entity} from "../../lib/world.js"; 10 | import {Game} from "../game.js"; 11 | import {Has} from "../world.js"; 12 | 13 | /** 14 | * Add `AudioListener` to an entity. 15 | * 16 | * This component has no data; only the bitflag. 17 | */ 18 | export function audio_listener() { 19 | return (game: Game, entity: Entity) => { 20 | game.World.Signature[entity] |= Has.AudioListener; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /core/components/com_callback.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Callback 3 | * 4 | * A utility mixin which runs arbitrary logic when an entity is created. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | 10 | type Callback = (game: Game, entity: Entity) => void; 11 | 12 | /** 13 | * Run arbitrary logic when an entity is created. 14 | * 15 | * @param fn The callback to run on the created entity. 16 | */ 17 | export function callback(fn: Callback) { 18 | return (game: Game, entity: Entity) => { 19 | fn(game, entity); 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /core/components/com_disable.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Disable 3 | * 4 | * A utility mixin which disables a component mask when an entity is created. 5 | * 6 | * This is useful for adding components to an entity during instantiation, and 7 | * immediately disabling them. The `disable()` mixin must be used **after** the 8 | * mixins of components that are to be disabled. 9 | * 10 | * instantiate(game, [ 11 | * transform(), 12 | * // Add and set up the `Lifespan` component. 13 | * lifespan(5), 14 | * // Disable it. 15 | * disable(Has.Lifespan), 16 | * ]) 17 | */ 18 | 19 | import {Entity} from "../../lib/world.js"; 20 | import {Game} from "../game.js"; 21 | 22 | /** 23 | * Disable a component mask when an entity is created. 24 | * 25 | * This is useful for adding components to an entity during instantiation, and 26 | * immediately disabling them. 27 | * 28 | * @param mask The component mask to disable. 29 | */ 30 | export function disable(mask: number) { 31 | return (game: Game, entity: Entity) => { 32 | game.World.Signature[entity] &= ~mask; 33 | }; 34 | } 35 | -------------------------------------------------------------------------------- /core/components/com_follow.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Follow 3 | * 4 | * The `Follow` component allows an entity to follow another entity. Only the 5 | * position is followed, not the rotation. 6 | */ 7 | 8 | import {Entity} from "../../lib/world.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | export interface Follow { 13 | /** Entity whose transform to follow. */ 14 | Target: Entity; 15 | /** How laggy vs. precise is the following [0-1]. */ 16 | Stiffness: number; 17 | } 18 | 19 | /** 20 | * Add `Follow` to an entity. 21 | * 22 | * Only the position is followed, not the rotation. 23 | * 24 | * @param target Entity whose transform to follow. 25 | * @param stiffness How laggy vs. precise is the following [0-1]. 26 | */ 27 | export function follow(target: Entity, stiffness = 0.1) { 28 | return (game: Game, entity: Entity) => { 29 | game.World.Signature[entity] |= Has.Follow; 30 | game.World.Follow[entity] = { 31 | Target: target, 32 | Stiffness: stiffness, 33 | }; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /core/components/com_lifespan.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Lifespan 3 | * 4 | * The `Lifespan` component allows the entity to autodestruct after a certain 5 | * time. Upon destruction, the entity can emit an `Action`. 6 | */ 7 | 8 | import {Entity} from "../../lib/world.js"; 9 | import {Action} from "../actions.js"; 10 | import {Game} from "../game.js"; 11 | import {Has} from "../world.js"; 12 | 13 | export interface Lifespan { 14 | Remaining: number; 15 | Action?: Action; 16 | } 17 | 18 | /** 19 | * Add `Lifespan` to an entity. 20 | * 21 | * @param remaining How long until the entity is destroyed (in seconds). 22 | * @param action Optional action to dispatch when the entity is destroyed. 23 | */ 24 | export function lifespan(remaining: number, action?: Action) { 25 | return (game: Game, entity: Entity) => { 26 | game.World.Signature[entity] |= Has.Lifespan; 27 | game.World.Lifespan[entity] = { 28 | Remaining: remaining, 29 | Action: action, 30 | }; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /core/components/com_look_at.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # LooktAt 3 | * 4 | * The `LookAt` component allows an entity to look at another entity. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | import {Has} from "../world.js"; 10 | 11 | export interface LookAt { 12 | /** Entity to look at. */ 13 | Target: Entity; 14 | /** How laggy vs. precise is the following [0-1]. */ 15 | Stiffness: number; 16 | } 17 | 18 | /** 19 | * Add `LookAt` to an entity. 20 | * 21 | * @param target Entity to look at. 22 | * @param stiffness How laggy vs. precise is the following [0-1]. 23 | */ 24 | export function look_at(target: Entity, stiffness = 0.1) { 25 | return (game: Game, entity: Entity) => { 26 | game.World.Signature[entity] |= Has.LookAt; 27 | game.World.LookAt[entity] = { 28 | Target: target, 29 | Stiffness: stiffness, 30 | }; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /core/components/com_mimic.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Mimic 3 | * 4 | * The `Mimic` component allows an entity to mimic another entity, i.e. match 5 | * the target entity's position and rotation with a small lag. 6 | * 7 | * `Mimic` is different from `Follow` in that `Follow` only follows the 8 | * position, but not the rotation of the target entity. 9 | */ 10 | 11 | import {Entity} from "../../lib/world.js"; 12 | import {Game} from "../game.js"; 13 | import {Has} from "../world.js"; 14 | 15 | export interface Mimic { 16 | /** Entity whose transform to mimic. */ 17 | Target: Entity; 18 | /** How laggy vs. precise is the mimicking [0-1]. */ 19 | Stiffness: number; 20 | } 21 | 22 | /** 23 | * Add `Mimic` to an entity. 24 | * 25 | * @param target Entity whose transform to mimic. 26 | * @param stiffness How laggy vs. precise is the mimicking [0-1]. 27 | */ 28 | export function mimic(target: Entity, stiffness: number = 0.1) { 29 | return (game: Game, entity: Entity) => { 30 | game.World.Signature[entity] |= Has.Mimic; 31 | game.World.Mimic[entity] = { 32 | Target: target, 33 | Stiffness: stiffness, 34 | }; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /core/components/com_shake.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Shake 3 | * 4 | * The `Shake` component allows the entity to change its position randomly every 5 | * frame. 6 | * 7 | * It should only be used on child entities whose position relative to the 8 | * parent is [0, 0, 0]. 9 | */ 10 | 11 | import {Entity} from "../../lib/world.js"; 12 | import {Game} from "../game.js"; 13 | import {Has} from "../world.js"; 14 | 15 | export interface Shake { 16 | Radius: number; 17 | } 18 | 19 | /** 20 | * Add `Shake` to an entity. 21 | * 22 | * @param radius The radius of the shake, in local units. 23 | */ 24 | export function shake(radius: number) { 25 | return (game: Game, entity: Entity) => { 26 | game.World.Signature[entity] |= Has.Shake; 27 | game.World.Shake[entity] = { 28 | Radius: radius, 29 | }; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /core/components/com_spawn.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Spawn 3 | * 4 | * The `Spawn` component allows the entity to spawn other entities. 5 | */ 6 | 7 | import {Blueprint} from "../../lib/game.js"; 8 | import {Entity} from "../../lib/world.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | interface Creator { 13 | (game: Game): Blueprint; 14 | } 15 | 16 | export interface Spawn { 17 | Creator: Creator; 18 | Interval: number; 19 | SinceLast: number; 20 | } 21 | 22 | /** 23 | * Spawn blueprints with a given frequency. 24 | * 25 | * @param creator The function returning the blueprint to spawn. 26 | * @param interval The frequency of spawning. 27 | */ 28 | export function spawn(creator: Creator, interval: number) { 29 | return (game: Game, entity: Entity) => { 30 | game.World.Signature[entity] |= Has.Spawn; 31 | game.World.Spawn[entity] = { 32 | Creator: creator, 33 | Interval: interval, 34 | SinceLast: interval, 35 | }; 36 | }; 37 | } 38 | -------------------------------------------------------------------------------- /core/components/com_toggle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Toggle 3 | * 4 | * The `Toggle` component allows to periodically enable and disable other 5 | * components on the entity. 6 | */ 7 | 8 | import {Entity} from "../../lib/world.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | export interface Toggle { 13 | Mask: number; 14 | Frequency: number; 15 | SinceLast: number; 16 | } 17 | 18 | /** 19 | * Add `Toggle` to an entity. 20 | * 21 | * @param mask The mask of the components to enable or disable. 22 | * @param frequency How often to toggle, in seconds. 23 | */ 24 | export function toggle(mask: number, frequency: number) { 25 | return (game: Game, entity: Entity) => { 26 | game.World.Signature[entity] |= Has.Toggle; 27 | game.World.Toggle[entity] = { 28 | Mask: mask, 29 | Frequency: frequency, 30 | SinceLast: 0, 31 | }; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /core/components/com_trigger.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # Trigger 3 | * 4 | * The `Trigger` component allows the entity's collider to trigger `Actions`. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Action} from "../actions.js"; 9 | import {Game, Layer} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | export interface Trigger { 13 | Mask: Layer; 14 | Action: Action; 15 | } 16 | 17 | /** 18 | * Add `Trigger` to an entity. 19 | * 20 | * @param mask The mask of the collision layers to trigger on. 21 | * @param action The action to trigger. 22 | */ 23 | export function trigger(mask: Layer, action: Action) { 24 | return (game: Game, entity: Entity) => { 25 | game.World.Signature[entity] |= Has.Trigger; 26 | game.World.Trigger[entity] = { 27 | Mask: mask, 28 | Action: action, 29 | }; 30 | }; 31 | } 32 | -------------------------------------------------------------------------------- /core/sprites/atlas.ts: -------------------------------------------------------------------------------- 1 | export let atlas: { 2 | [key: string]: { 3 | x: number; 4 | y: number; 5 | w: number; 6 | h: number; 7 | }; 8 | } = {}; 9 | -------------------------------------------------------------------------------- /core/systems/sys_camera2d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_camera2d 3 | * 4 | * Update the `PV` matrix of the [camera](com_camera2d.html) used for 2D 5 | * rendering. 6 | */ 7 | 8 | import {mat2d_copy, mat2d_multiply} from "../../lib/mat2d.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | const QUERY = Has.SpatialNode2D | Has.Camera2D; 13 | 14 | export function sys_camera2d(game: Game, delta: number) { 15 | game.Cameras = []; 16 | 17 | for (let ent = 0; ent < game.World.Signature.length; ent++) { 18 | if ((game.World.Signature[ent] & QUERY) === QUERY) { 19 | let camera = game.World.Camera2D[ent]; 20 | let camera_node = game.World.SpatialNode2D[ent]; 21 | 22 | mat2d_multiply(camera.Pv, camera.Projection.Projection, camera_node.Self); 23 | mat2d_copy(camera.World, camera_node.World); 24 | 25 | game.Cameras.push(ent); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /core/systems/sys_control_always2d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_control_always2d 3 | * 4 | * Update the entity's `Move2D` component every frame. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | import {Has} from "../world.js"; 10 | 11 | const QUERY = Has.ControlAlways2D | Has.Move2D; 12 | 13 | export function sys_control_always2d(game: Game, delta: number) { 14 | for (let i = 0; i < game.World.Signature.length; i++) { 15 | if ((game.World.Signature[i] & QUERY) === QUERY) { 16 | update(game, i); 17 | } 18 | } 19 | } 20 | 21 | function update(game: Game, entity: Entity) { 22 | let control = game.World.ControlAlways2D[entity]; 23 | let move = game.World.Move2D[entity]; 24 | 25 | if (control.Direction) { 26 | move.Direction[0] = control.Direction[0]; 27 | move.Direction[1] = control.Direction[1]; 28 | game.World.Signature[entity] |= Has.Dirty; 29 | } 30 | 31 | if (control.Rotation) { 32 | move.Rotation = control.Rotation; 33 | game.World.Signature[entity] |= Has.Dirty; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /core/systems/sys_lifespan.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_lifespan 3 | * 4 | * Autodestruct entities after a given time. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {dispatch} from "../actions.js"; 9 | import {destroy_all} from "../components/com_children.js"; 10 | import {Game} from "../game.js"; 11 | import {Has} from "../world.js"; 12 | 13 | const QUERY = Has.Lifespan; 14 | 15 | export function sys_lifespan(game: Game, delta: number) { 16 | for (let i = 0; i < game.World.Signature.length; i++) { 17 | if ((game.World.Signature[i] & QUERY) == QUERY) { 18 | update(game, i, delta); 19 | } 20 | } 21 | } 22 | 23 | function update(game: Game, entity: Entity, delta: number) { 24 | let lifespan = game.World.Lifespan[entity]; 25 | lifespan.Remaining -= delta; 26 | if (lifespan.Remaining < 0) { 27 | if (lifespan.Action) { 28 | dispatch(game, lifespan.Action, entity); 29 | } 30 | destroy_all(game.World, entity); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/systems/sys_render2d_animate.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_render2d_animate 3 | * 4 | * Animate sprites (WIP). 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {set_sprite} from "../components/com_render2d.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | const QUERY = Has.AnimateSprite | Has.Render2D; 13 | 14 | export function sys_render2d_animate(game: Game, delta: number) { 15 | for (let i = 0; i < game.World.Signature.length; i++) { 16 | if ((game.World.Signature[i] & QUERY) === QUERY) { 17 | update(game, i, delta); 18 | } 19 | } 20 | } 21 | 22 | function update(game: Game, entity: Entity, delta: number) { 23 | let animate = game.World.AnimateSprite[entity]; 24 | 25 | for (let frame_name in animate.Frames) { 26 | let frame_timestamp = animate.Frames[frame_name]; 27 | if (animate.Time < frame_timestamp) { 28 | set_sprite(game, entity, frame_name); 29 | break; 30 | } 31 | } 32 | 33 | animate.Time += delta; 34 | if (animate.Time >= animate.Duration) { 35 | animate.Time -= animate.Duration; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /core/systems/sys_shake.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_shake 3 | * 4 | * Shake entities randomly. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | import {Has} from "../world.js"; 10 | 11 | const QUERY = Has.Transform | Has.Shake; 12 | 13 | export function sys_shake(game: Game, delta: number) { 14 | for (let i = 0; i < game.World.Signature.length; i++) { 15 | if ((game.World.Signature[i] & QUERY) == QUERY) { 16 | update(game, i); 17 | } 18 | } 19 | } 20 | 21 | function update(game: Game, entity: Entity) { 22 | let shake = game.World.Shake[entity]; 23 | let transform = game.World.Transform[entity]; 24 | 25 | transform.Translation[0] = (Math.random() - 0.5) * shake.Radius * 2; 26 | transform.Translation[1] = (Math.random() - 0.5) * shake.Radius * 2; 27 | transform.Translation[2] = (Math.random() - 0.5) * shake.Radius * 2; 28 | game.World.Signature[entity] |= Has.Dirty; 29 | } 30 | -------------------------------------------------------------------------------- /core/systems/sys_shake2d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_shake2d 3 | * 4 | * Shake entities randomly. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | import {Has} from "../world.js"; 10 | 11 | const QUERY = Has.LocalTransform2D | Has.Shake; 12 | 13 | export function sys_shake2d(game: Game, delta: number) { 14 | for (let i = 0; i < game.World.Signature.length; i++) { 15 | if ((game.World.Signature[i] & QUERY) == QUERY) { 16 | update(game, i); 17 | } 18 | } 19 | } 20 | 21 | function update(game: Game, entity: Entity) { 22 | let shake = game.World.Shake[entity]; 23 | let local = game.World.LocalTransform2D[entity]; 24 | 25 | local.Translation[0] = (Math.random() - 0.5) * shake.Radius * 2; 26 | local.Translation[1] = (Math.random() - 0.5) * shake.Radius * 2; 27 | game.World.Signature[entity] |= Has.Dirty; 28 | } 29 | -------------------------------------------------------------------------------- /core/systems/sys_toggle.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_toggle 3 | * 4 | * Enable and disable the entity's other components periodically. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {Game} from "../game.js"; 9 | import {Has} from "../world.js"; 10 | 11 | const QUERY = Has.Toggle; 12 | 13 | export function sys_toggle(game: Game, delta: number) { 14 | for (let i = 0; i < game.World.Signature.length; i++) { 15 | if ((game.World.Signature[i] & QUERY) == QUERY) { 16 | update(game, i, delta); 17 | } 18 | } 19 | } 20 | 21 | function update(game: Game, entity: Entity, delta: number) { 22 | let toggle = game.World.Toggle[entity]; 23 | 24 | toggle.SinceLast += delta; 25 | 26 | if (toggle.SinceLast > toggle.Frequency) { 27 | toggle.SinceLast = 0; 28 | if ((game.World.Signature[entity] & toggle.Mask) === toggle.Mask) { 29 | game.World.Signature[entity] &= ~toggle.Mask; 30 | } else { 31 | game.World.Signature[entity] |= toggle.Mask; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /core/systems/sys_trigger.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_trigger 3 | * 4 | * Emit an `Action` when another entity collides with this entity. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {dispatch} from "../actions.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | const QUERY = Has.Transform | Has.Collide | Has.Trigger; 13 | 14 | export function sys_trigger(game: Game, delta: number) { 15 | for (let i = 0; i < game.World.Signature.length; i++) { 16 | if ((game.World.Signature[i] & QUERY) === QUERY) { 17 | update(game, i); 18 | } 19 | } 20 | } 21 | 22 | function update(game: Game, entity: Entity) { 23 | let collide = game.World.Collide[entity]; 24 | let trigger = game.World.Trigger[entity]; 25 | 26 | for (let collision of collide.Collisions) { 27 | let other_collide = game.World.Collide[collision.Other]; 28 | if (trigger.Mask & other_collide.Layers) { 29 | dispatch(game, trigger.Action, [entity, collision.Other]); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/systems/sys_trigger2d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_trigger2d 3 | * 4 | * Emit an `Action` when another entity collides with this entity. 5 | */ 6 | 7 | import {Entity} from "../../lib/world.js"; 8 | import {dispatch} from "../actions.js"; 9 | import {Game} from "../game.js"; 10 | import {Has} from "../world.js"; 11 | 12 | const QUERY = Has.Collide2D | Has.Trigger; 13 | 14 | export function sys_trigger2d(game: Game, delta: number) { 15 | for (let i = 0; i < game.World.Signature.length; i++) { 16 | if ((game.World.Signature[i] & QUERY) === QUERY) { 17 | update(game, i); 18 | } 19 | } 20 | } 21 | 22 | function update(game: Game, entity: Entity) { 23 | let collide = game.World.Collide2D[entity]; 24 | let trigger = game.World.Trigger[entity]; 25 | 26 | for (let collision of collide.Collisions) { 27 | let other_collide = game.World.Collide2D[collision.Other]; 28 | if (trigger.Mask & other_collide.Layers) { 29 | dispatch(game, trigger.Action, [entity, collision.Other]); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /core/systems/sys_ui.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * # sys_ui 3 | * 4 | * Render the UI. 5 | * 6 | * The entire `App` UI component is evaluated every frame to a string. If the 7 | * result is different from the previous frame, the UI is re-rendered. 8 | * 9 | * Because `sys_ui` uses `innerHTML`, it's not a great choice for stateful UI 10 | * elements, like input forms. 11 | */ 12 | 13 | import {Game} from "../game.js"; 14 | import {App} from "../ui/App.js"; 15 | 16 | let prev: string; 17 | 18 | export function sys_ui(game: Game, delta: number) { 19 | let next = App(game); 20 | if (next !== prev) { 21 | game.Ui.innerHTML = prev = next; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /core/ui/App.ts: -------------------------------------------------------------------------------- 1 | import {Game} from "../game"; 2 | 3 | export function App(game: Game) { 4 | return ""; 5 | } 6 | -------------------------------------------------------------------------------- /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/favicon.ico -------------------------------------------------------------------------------- /lib/html.ts: -------------------------------------------------------------------------------- 1 | type Interpolation = string | number | boolean | undefined | null | Array; 2 | 3 | function shift(values: Array) { 4 | let value = values.shift(); 5 | if (typeof value === "boolean" || value == undefined) { 6 | return ""; 7 | } else if (Array.isArray(value)) { 8 | return value.join(""); 9 | } else { 10 | return value; 11 | } 12 | } 13 | 14 | /** 15 | * Template literal tag for generating HTML strings in UI components. 16 | */ 17 | export function html(strings: TemplateStringsArray, ...values: Array) { 18 | return strings.reduce((out, cur) => out + shift(values) + cur); 19 | } 20 | -------------------------------------------------------------------------------- /lib/material.ts: -------------------------------------------------------------------------------- 1 | import {GL_COMPILE_STATUS, GL_FRAGMENT_SHADER, GL_LINK_STATUS, GL_VERTEX_SHADER} from "./webgl.js"; 2 | 3 | export interface Material { 4 | Mode: GLenum; 5 | Program: WebGLProgram; 6 | Locations: L; 7 | } 8 | 9 | export function link(gl: WebGLRenderingContext, vertex: string, fragment: string) { 10 | let program = gl.createProgram()!; 11 | gl.attachShader(program, compile(gl, GL_VERTEX_SHADER, vertex)); 12 | gl.attachShader(program, compile(gl, GL_FRAGMENT_SHADER, fragment)); 13 | gl.linkProgram(program); 14 | 15 | if (DEBUG && !gl.getProgramParameter(program, GL_LINK_STATUS)) { 16 | throw new Error(gl.getProgramInfoLog(program)!); 17 | } 18 | 19 | return program; 20 | } 21 | 22 | function compile(gl: WebGLRenderingContext, type: GLenum, source: string) { 23 | let shader = gl.createShader(type)!; 24 | gl.shaderSource(shader, source); 25 | gl.compileShader(shader); 26 | 27 | if (DEBUG && !gl.getShaderParameter(shader, GL_COMPILE_STATUS)) { 28 | throw new Error(gl.getShaderInfoLog(shader)!); 29 | } 30 | 31 | return shader; 32 | } 33 | -------------------------------------------------------------------------------- /lib/number.ts: -------------------------------------------------------------------------------- 1 | export function lerp(from: number, to: number, progress: number) { 2 | return from + progress * (to - from); 3 | } 4 | 5 | export function clamp(min: number, max: number, num: number) { 6 | return Math.max(min, Math.min(max, num)); 7 | } 8 | 9 | export function map_range( 10 | value: number, 11 | old_min: number, 12 | old_max: number, 13 | new_min: number, 14 | new_max: number, 15 | ) { 16 | return ((value - old_min) / (old_max - old_min)) * (new_max - new_min) + new_min; 17 | } 18 | -------------------------------------------------------------------------------- /lib/projection2d.ts: -------------------------------------------------------------------------------- 1 | import {mat2d_create, mat2d_from_ortho} from "./mat2d.js"; 2 | import {Mat2D, Vec2} from "./math.js"; 3 | 4 | export interface Projection2D { 5 | Radius: Vec2; 6 | Projection: Mat2D; 7 | Inverse: Mat2D; 8 | } 9 | 10 | /** 11 | * Create an orthographic projection. 12 | * 13 | * As a special case, if the radius is [0, 0], sys_resize2d will dynamically 14 | * resize the projection to keep the unit size in pixels constant. 15 | * 16 | * @param radius The radius of the projection: [left, top]. 17 | */ 18 | export function orthographic2d(radius: Vec2): Projection2D { 19 | return { 20 | Radius: radius, 21 | Projection: mat2d_from_ortho(mat2d_create(), radius[0], radius[1]), 22 | Inverse: mat2d_create(), 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /lib/random.ts: -------------------------------------------------------------------------------- 1 | let seed = 1; 2 | 3 | export function set_seed(new_seed: number) { 4 | seed = 198706 * new_seed; 5 | } 6 | 7 | export function rand() { 8 | seed = (seed * 16807) % 2147483647; 9 | return (seed - 1) / 2147483646; 10 | } 11 | 12 | export function integer(min = 0, max = 1) { 13 | return ~~(rand() * (max - min + 1) + min); 14 | } 15 | 16 | export function float(min = 0, max = 1) { 17 | return rand() * (max - min) + min; 18 | } 19 | 20 | export function element(arr: Array) { 21 | return arr[integer(0, arr.length - 1)]; 22 | } 23 | -------------------------------------------------------------------------------- /lib/window.d.ts: -------------------------------------------------------------------------------- 1 | declare var DEBUG: boolean; 2 | -------------------------------------------------------------------------------- /meshes/Makefile: -------------------------------------------------------------------------------- 1 | TARGETS := $(wildcard *.ts) 2 | 3 | all: $(TARGETS) 4 | 5 | %.ts: ../assets/%.gltf 6 | @echo "$< → $@" 7 | @cat $< | node gltf2mesh.cjs $* > $@ 8 | @npx prettier --loglevel=silent --write $@ 9 | -------------------------------------------------------------------------------- /play/debug.css: -------------------------------------------------------------------------------- 1 | #debug { 2 | display: flex; 3 | flex-flow: column nowrap; 4 | align-items: flex-end; 5 | position: absolute; 6 | top: 0; 7 | right: 0; 8 | color: #fff; 9 | font-family: monospace; 10 | } 11 | #debug button { 12 | cursor: pointer; 13 | padding: 0; 14 | background: none; 15 | border: none; 16 | font: inherit; 17 | color: inherit; 18 | } 19 | #debug div { 20 | width: max-content; 21 | background: #000; 22 | color: #fff; 23 | } 24 | -------------------------------------------------------------------------------- /play/game.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | overflow: hidden; 4 | margin: 0; 5 | } 6 | canvas, 7 | main { 8 | position: absolute; 9 | width: 100vw; 10 | height: 100vh; 11 | overflow: hidden; 12 | word-break: break-word; 13 | user-select: none; 14 | touch-action: none; 15 | } 16 | [hidden] { 17 | display: none; 18 | } 19 | [onclick] { 20 | cursor: pointer; 21 | } 22 | .grabbing { 23 | cursor: grabbing; 24 | } 25 | -------------------------------------------------------------------------------- /play/game.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | GoodLuck (opt) 8 | 9 | 10 | 11 | 12 | 13 |
    14 | 15 | -------------------------------------------------------------------------------- /play/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "goodluck-play", 3 | "version": "0.0.0", 4 | "private": true, 5 | "devDependencies": { 6 | "cssnano": "7.0", 7 | "htmlnano": "2.1", 8 | "posthtml": "0.16", 9 | "posthtml-inline-assets": "3.1", 10 | "roadroller": "2.1", 11 | "terser": "5.31" 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /play/posthtml.cjs: -------------------------------------------------------------------------------- 1 | const fs = require("fs"); 2 | const posthtml = require("posthtml"); 3 | 4 | if (process.argv.length !== 3) { 5 | console.log(`Usage: ${process.argv[1]} INPUT`); 6 | process.exit(1); 7 | } 8 | 9 | let content = fs.readFileSync(process.argv[2]); 10 | let processor = posthtml([ 11 | require("posthtml-inline-assets")(), 12 | require("htmlnano")({ 13 | collapseAttributeWhitespace: true, 14 | collapseBooleanAttributes: true, 15 | collapseWhitespace: "conservative", 16 | deduplicateAttributeValues: true, 17 | mergeScripts: true, 18 | mergeStyles: true, 19 | minifyCss: true, 20 | minifyJs: false, 21 | minifySvg: false, 22 | removeComments: "all", 23 | removeEmptyAttributes: true, 24 | removeRedundantAttributes: false, 25 | removeUnusedCss: false, 26 | }), 27 | ]); 28 | 29 | processor 30 | .process(content.toString(), { 31 | quoteAllAttributes: false, 32 | }) 33 | .then((result) => console.log(result.html)); 34 | -------------------------------------------------------------------------------- /play/sed.txt: -------------------------------------------------------------------------------- 1 | # Remove strict mode 2 | s/'use strict';// 3 | 4 | # Remove indents 5 | s/^ *// 6 | 7 | # Remove double-slash comments 8 | s/\/\/ .*// 9 | -------------------------------------------------------------------------------- /play/terser_compress.txt: -------------------------------------------------------------------------------- 1 | passes=3 2 | ecma=2022 3 | drop_console 4 | pure_getters 5 | toplevel 6 | unsafe 7 | unsafe_math 8 | hoist_funs 9 | -------------------------------------------------------------------------------- /reference/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "goodluck-docs", 3 | "version": "0.0.0", 4 | "author": "", 5 | "dependencies": { 6 | "highlight.js": "^11.6.0", 7 | "marked": "^4.0.18" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /textures/Bricks059_1K_AmbientOcclusion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_AmbientOcclusion.jpg -------------------------------------------------------------------------------- /textures/Bricks059_1K_AmbientOcclusion.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_AmbientOcclusion.jpg.webp -------------------------------------------------------------------------------- /textures/Bricks059_1K_Color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Color.jpg -------------------------------------------------------------------------------- /textures/Bricks059_1K_Color.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Color.jpg.webp -------------------------------------------------------------------------------- /textures/Bricks059_1K_Displacement.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Displacement.jpg -------------------------------------------------------------------------------- /textures/Bricks059_1K_Displacement.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Displacement.jpg.webp -------------------------------------------------------------------------------- /textures/Bricks059_1K_Normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Normal.jpg -------------------------------------------------------------------------------- /textures/Bricks059_1K_Normal.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Normal.jpg.webp -------------------------------------------------------------------------------- /textures/Bricks059_1K_Roughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Roughness.jpg -------------------------------------------------------------------------------- /textures/Bricks059_1K_Roughness.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Bricks059_1K_Roughness.jpg.webp -------------------------------------------------------------------------------- /textures/Concrete018_1K_Color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Color.jpg -------------------------------------------------------------------------------- /textures/Concrete018_1K_Color.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Color.jpg.webp -------------------------------------------------------------------------------- /textures/Concrete018_1K_Displacement.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Displacement.jpg -------------------------------------------------------------------------------- /textures/Concrete018_1K_Displacement.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Displacement.jpg.webp -------------------------------------------------------------------------------- /textures/Concrete018_1K_Normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Normal.jpg -------------------------------------------------------------------------------- /textures/Concrete018_1K_Normal.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Normal.jpg.webp -------------------------------------------------------------------------------- /textures/Concrete018_1K_Roughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Roughness.jpg -------------------------------------------------------------------------------- /textures/Concrete018_1K_Roughness.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Concrete018_1K_Roughness.jpg.webp -------------------------------------------------------------------------------- /textures/Makefile: -------------------------------------------------------------------------------- 1 | # See https://developers.google.com/speed/webp/download. 2 | # On Ubuntu, install the `webp` package. 3 | 4 | PNGS := $(wildcard *.png) 5 | JPGS := $(wildcard *.jpg) 6 | WEBPS := $(PNGS:%=%.webp) $(JPGS:%=%.webp) 7 | 8 | all: $(WEBPS) 9 | 10 | %.png.webp: %.png 11 | @echo "$< → $@" 12 | @cwebp -short -z 9 $< -o $@ 13 | 14 | %.jpg.webp: %.jpg 15 | @echo "$< → $@" 16 | @cwebp -short $< -o $@ 17 | -------------------------------------------------------------------------------- /textures/Wood063_1K_AmbientOcclusion.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_AmbientOcclusion.jpg -------------------------------------------------------------------------------- /textures/Wood063_1K_AmbientOcclusion.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_AmbientOcclusion.jpg.webp -------------------------------------------------------------------------------- /textures/Wood063_1K_Color.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Color.jpg -------------------------------------------------------------------------------- /textures/Wood063_1K_Color.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Color.jpg.webp -------------------------------------------------------------------------------- /textures/Wood063_1K_Displacement.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Displacement.jpg -------------------------------------------------------------------------------- /textures/Wood063_1K_Displacement.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Displacement.jpg.webp -------------------------------------------------------------------------------- /textures/Wood063_1K_Normal.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Normal.jpg -------------------------------------------------------------------------------- /textures/Wood063_1K_Normal.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Normal.jpg.webp -------------------------------------------------------------------------------- /textures/Wood063_1K_Roughness.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Roughness.jpg -------------------------------------------------------------------------------- /textures/Wood063_1K_Roughness.jpg.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/Wood063_1K_Roughness.jpg.webp -------------------------------------------------------------------------------- /textures/checker1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/checker1.png -------------------------------------------------------------------------------- /textures/checker1.png.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/checker1.png.webp -------------------------------------------------------------------------------- /textures/fire.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/fire.png -------------------------------------------------------------------------------- /textures/fire.png.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/piesku/goodluck/6bca87450a5cd30b2f4af3fe046a4b4c773ad7cf/textures/fire.png.webp -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es2022", 4 | "module": "es2022", 5 | "moduleResolution": "bundler", 6 | "strict": true, 7 | "noImplicitOverride": true, 8 | }, 9 | "exclude": [ 10 | "node_modules" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /util/tiled_tile_names.cjs: -------------------------------------------------------------------------------- 1 | const {readFileSync} = require("fs"); 2 | 3 | let args = process.argv.slice(2); 4 | if (args.length !== 1) { 5 | console.error("Generate names of tiles from a Tiled tileset (.tsj)."); 6 | console.error(" node tiled_tile_names.cjs atlas.tsj"); 7 | process.exit(1); 8 | } 9 | 10 | let tileset_path = args.pop(); 11 | let tileset_file = readFileSync("./" + tileset_path); 12 | let tileset = JSON.parse(tileset_file); 13 | 14 | for (let tile of tileset.tiles) { 15 | console.log(tile.image); 16 | } 17 | --------------------------------------------------------------------------------