Parcourir la source

Delete 02.sprites

Daniele Bartolini il y a 11 ans
Parent
commit
7b4b788cd9

+ 0 - 5
samples/02.sprites/crown.config

@@ -1,5 +0,0 @@
-{
-	"boot" : "lua/game",
-	"window_width" : 1000,
-	"window_height" : 625
-}

+ 0 - 26
samples/02.sprites/global.physics_config

@@ -1,26 +0,0 @@
-{
-	"scale" : 64,
-
-	"materials" : {
-		"default" : { "static_friction" : 0.5, "dynamic_friction" : 0.5, "restitution" : 0.1 },
-		"test" : { "static_friction" : 0.2, "dynamic_friction" : 0.7, "restitution" : 0.5 },
-		"light" : { "static_friction" : 0.2, "dynamic_friction" : 0.2, "restitution" : 0.7}
-	},
-
-	"shapes" : {
-		"default" : { "trigger" : false, "collision_filter" : "default" },
-		"trigger" : { "trigger" : true, "collision_filter" : "default" }
-	},
-
-	"actors" : {
-		"static" : { "dynamic" : false },
-		"dynamic" : { "dynamic" : true },
-		"keyframed" : { "dynamic" : true, "kinematic" : true, "disable_gravity" : true },
-		"test" : { "dynamic" : true, "linear_damping" : 10.0, "angular_damping" : 23.0 }
-	},
-
-	"collision_filters" : {
-		"default" : { "collides_with" : ["default"] },
-		"foo" : { "collides_with" : ["default", "foo"] }
-	}
-}

+ 0 - 26
samples/02.sprites/level.package

@@ -1,26 +0,0 @@
-{
-	"unit" : [
-		"units/camera",
-		"units/star",
-		"units/circle",
-		"units/pentagon",
-		"units/square"
-	],
-	"texture" : [
-		"textures/shapes"
-	],
-	"sprite" :
-	[
-		"sprites/star",
-		"sprites/circle",
-		"sprites/pentagon",
-		"sprites/square"
-	],
-	"material" :
-	[
-		"units/star",
-		"units/circle",
-		"units/pentagon",
-		"units/square"
-	]
-}

+ 0 - 76
samples/02.sprites/lua/game.lua

@@ -1,76 +0,0 @@
-objects = {}
-max_objects = 70
-
-function init()
-	-- Set the title of the main window
-	Window.set_title("Hello world!")
-
-	-- Create the resource package
-	package = Device.create_resource_package("level")
-	-- Load resource package
-	ResourcePackage.load(package)
-	-- Wait for completion
-	ResourcePackage.flush(package)
-
-	-- Create world
-	world = Device.create_world()
-
-	-- Spawn camera
-	camera_unit = World.spawn_unit(world, "units/camera")
-	camera = Unit.camera(camera_unit, "camera")
-
-	-- Setup camera
-	Camera.set_near_clip_distance(camera, 0.01)
-	Camera.set_far_clip_distance(camera, 1000)
-	Camera.set_projection_type(camera, Camera.ORTHOGRAPHIC)
-	Camera.set_orthographic_metrics(camera, -6, 6, -6 / 1.6, 6 / 1.6)
-	Camera.set_viewport_metrics(camera, 0, 0, 1000, 625)
-	Unit.set_local_position(camera_unit, 0, Vector3(0, 0, 1))
-
-	local unit_names = { "units/star", "units/circle", "units/pentagon", "units/square" }
-	-- Spawn units randomly
-	math.randomseed(os.time())
-	for i = 1, max_objects do
-		objects[i] = {
-						unit = World.spawn_unit(world, unit_names[math.random(#unit_names)],
-									Vector3(math.random(-6, 6), math.random(-6 / 1.6, 6 / 1.6), 0)),
-						rot_speed = math.random(1.5),
-						cur_rot = math.random(3.14)
-					}
-	end
-end
-
-function frame(dt)
-	-- Update the world
-	Device.update_world(world, dt)
-
-	-- Stop the engine when the 'ESC' key is released
-	if Keyboard.button_released(Keyboard.ESCAPE) then
-		Device.stop()
-	end
-
-	for i = 1, max_objects do
-		local obj = objects[i]
-		local r = obj.rot_speed
-		obj.cur_rot = obj.cur_rot + r * dt
-
-		Unit.set_local_rotation(obj.unit, 0, Quaternion(Vector3(0, 0, 1), obj.cur_rot))
-	end
-
-	-- Render the world
-	Device.render_world(world, camera)
-end
-
-function shutdown()
-	-- Destroy all units
-	for i = 1, max_objects do
-		World.destroy_unit(world, objects[i].unit)
-	end
-	World.destroy_unit(world, camera_unit)
-
-	-- Destroy world
-	Device.destroy_world(world)
-	-- Unload package
-	ResourcePackage.unload(package)
-	Device.destroy_resource_package(package)
-end

+ 0 - 13
samples/02.sprites/sprites/circle.sprite

@@ -1,13 +0,0 @@
-{
-	"width" : 256,
-	"height" : 256,
-	"frames" : [
-		{
-			"name" : "circle",
-			"region" : [0.5, 0.5, 0.5, 0.5],
-			"offset" : [0.0, 0.0],
-			"scale" : [1.0, 1.0],
-			"rotated" : false
-		}
-	]
-}

+ 0 - 13
samples/02.sprites/sprites/pentagon.sprite

@@ -1,13 +0,0 @@
-{
-	"width" : 256,
-	"height" : 256,
-	"frames" : [
-		{
-			"name" : "circle",
-			"region" : [0.0, 0.0, 0.5, 0.5],
-			"offset" : [0.0, 0.0],
-			"scale" : [1.0, 1.0],
-			"rotated" : false
-		}
-	]
-}

+ 0 - 13
samples/02.sprites/sprites/square.sprite

@@ -1,13 +0,0 @@
-{
-	"width" : 256,
-	"height" : 256,
-	"frames" : [
-		{
-			"name" : "circle",
-			"region" : [0.5, 0.0, 0.5, 0.5],
-			"offset" : [0.0, 0.0],
-			"scale" : [1.0, 1.0],
-			"rotated" : false
-		}
-	]
-}

+ 0 - 13
samples/02.sprites/sprites/star.sprite

@@ -1,13 +0,0 @@
-{
-	"width" : 256,
-	"height" : 256,
-	"frames" : [
-		{
-			"name" : "circle",
-			"region" : [0.0, 0.5, 0.5, 0.5],
-			"offset" : [0.0, 0.0],
-			"scale" : [1.0, 1.0],
-			"rotated" : false
-		}
-	]
-}

BIN
samples/02.sprites/textures/shapes.texture


+ 0 - 8
samples/02.sprites/units/camera.unit

@@ -1,8 +0,0 @@
-{
-	"cameras" : {
-		"camera" : { "node" : "root" }
-	},
-	"nodes" : {
-		"root" : { "parent" : null, "position" : [0, 0, 0], "rotation" : [0, 0, 1, 0] }
-	}
-}

+ 0 - 5
samples/02.sprites/units/circle.material

@@ -1,5 +0,0 @@
-{
-	"texture_layers" : [
-		"textures/shapes"
-	]
-}

+ 0 - 8
samples/02.sprites/units/circle.unit

@@ -1,8 +0,0 @@
-{
-	"renderables" : {
-		"circle" : { "node" : "root", "type" : "sprite", "resource" : "sprites/circle", "visible" : true }
-	},
-	"nodes" : {
-		"root" : { "parent" : null, "position" : [0, 0, 0], "rotation" : [0, 0, 1, 0] }
-	}
-}

+ 0 - 5
samples/02.sprites/units/pentagon.material

@@ -1,5 +0,0 @@
-{
-	"texture_layers" : [
-		"textures/shapes"
-	]
-}

+ 0 - 13
samples/02.sprites/units/pentagon.unit

@@ -1,13 +0,0 @@
-{
-	"renderables" : {
-		"pentagon" : {
-			"node" : "root",
-			"type" : "sprite",
-			"resource" : "sprites/pentagon",
-			"visible" : true
-		}
-	},
-	"nodes" : {
-		"root" : { "parent" : null, "position" : [0, 0, 0], "rotation" : [0, 0, 1, 0] }
-	}
-}

+ 0 - 5
samples/02.sprites/units/square.material

@@ -1,5 +0,0 @@
-{
-	"texture_layers" : [
-		"textures/shapes"
-	]
-}

+ 0 - 8
samples/02.sprites/units/square.unit

@@ -1,8 +0,0 @@
-{
-	"renderables" : {
-		"square" : { "node" : "root", "type" : "sprite", "resource" : "sprites/square", "visible" : true }
-	},
-	"nodes" : {
-		"root" : { "parent" : null, "position" : [0, 0, 0], "rotation" : [0, 0, 1, 0] }
-	}
-}

+ 0 - 5
samples/02.sprites/units/star.material

@@ -1,5 +0,0 @@
-{
-	"texture_layers" : [
-		"textures/shapes"
-	]
-}

+ 0 - 8
samples/02.sprites/units/star.unit

@@ -1,8 +0,0 @@
-{
-	"renderables" : {
-		"star" : { "node" : "root", "type" : "sprite", "resource" : "sprites/star", "visible" : true }
-	},
-	"nodes" : {
-		"root" : { "parent" : null, "position" : [0, 0, 0], "rotation" : [0, 0, 1, 0] }
-	}
-}