Forráskód Böngészése

remove 03.bounce sample

mikymod 12 éve
szülő
commit
e942f5220c

+ 0 - 5
samples/03.bounce/bounce.material

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

+ 0 - 10
samples/03.bounce/bounce.physics

@@ -1,10 +0,0 @@
-{
-	"controller" : {
-		"name" : "controller",
-		"height" : 0.01,
-		"radius" : 0.5,
-		"slope_limit" : 0.707,
-		"step_offset" : 0.1,
-		"contact_offset" : 0.01
-	}
-}

+ 0 - 19
samples/03.bounce/bounce.unit

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

+ 0 - 5
samples/03.bounce/box.material

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

+ 0 - 16
samples/03.bounce/box.physics

@@ -1,16 +0,0 @@
-{
-	"actors" : [
-		{
-			"name" : "actor_0",
-			"node" : "root",
-			"type" : "static",
-			"shapes" : [
-				{
-					"name" : "shape_0",
-					"type" : "sphere",
-					"radius" : 0.5
-				}
-			]
-		}
-	]
-}

+ 0 - 19
samples/03.bounce/box.unit

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

+ 0 - 16
samples/03.bounce/camera.unit

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

+ 0 - 5
samples/03.bounce/crown.config

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

+ 0 - 33
samples/03.bounce/level.package

@@ -1,33 +0,0 @@
-{
-	"texture" : [
-		"textures/bounce",
-		"textures/box",
-		"textures/sun"
-	],
-	"unit" : [
-		"camera",
-		"bounce",
-		"box",
-		"sun"
-	],
-	"sprite" : [
-		"sprites/bounce",
-		"sprites/box",
-		"sprites/sun"
-	],
-	"sound" : [
-		"sounds/beep",
-		"sounds/gunshoot",
-		"sounds/footsteps",
-		"sounds/jump"
-	],
-	"physics" : [
-		"bounce",
-		"box"
-	],
-	"material" : [
-		"bounce",
-		"box",
-		"sun"
-	]
-}

+ 0 - 153
samples/03.bounce/lua/game.lua

@@ -1,153 +0,0 @@
-timer = 0.0
-cursor = false
-world = nil
-camera = nil
-up_pressed = false
-down_pressed = false
-left_pressed = false
-right_pressed = false
-camera_size = 1.0
-
-ovest = -10
-east = 10
-north = 10 / 1.6
-south = -10 / 1.6
-spd_x = 0
-spd_y = 0
-
-footsteps = nil
-speed = 3
-
-
-function spawn_terrain(x, y, dim)
-	for t = 0, dim, 2 do
-		World.spawn_unit(world, "box", Vector3(x + t, math.random(-3, 6) , 0))
-	end
-end
-
-function spawn_suns(x, y, dim)
-	for t=0, dim, 7 do
-		World.spawn_unit(world, "sun", Vector3(x + t, math.random(-3, 6) , 0))
-	end	
-end
-
-function update_player(world, unit, dt)
-
-	-- 3 m/s
-	speed = speed + 0.1 * dt;
-
-	if (Keyboard.button_pressed(Keyboard.w)) then up_pressed = true end
-	if (Keyboard.button_pressed(Keyboard.s)) then down_pressed = true end
-
-	if (Keyboard.button_released(Keyboard.w)) then up_pressed = false end
-	if (Keyboard.button_released(Keyboard.s)) then down_pressed = false end
-
-	if (Touch.pointer_down(1)) then up_pressed = true end
-	if (Touch.pointer_up(1)) then up_pressed = false end
-
-
-	contr = Unit.controller(unit)
-
-	if up_pressed then
-		spd_y = speed * dt
-	end
-
-	spd_x = speed * dt
-
-	Controller.move(contr, Vector3(spd_x, spd_y, 0.0))
-
-	spd_y = spd_y - 0.5 * dt
-
-	-- local k = 0
-	-- if spd_x > 0.0 then k = -1
-	-- elseif spd_x < 0.0 then k = 1 end
-
-	-- spd_x = spd_x + k * dt
-	-- if spd_x < 0.001 and spd_x > -0.001 then spd_x = 0.0 end
-end
-
-function update_camera(player_unit, camera_unit, camera)
-	local player_pos = Unit.world_position(player_unit, 0)
-	Camera.set_local_position(camera, camera_unit, Vector3(Vector3.x(player_pos), -south / 2.5, 1))
-end
-
-function init()
-	-- -- Set the title of the main window
-	Window.set_title("Hello world!")
-	-- Window.show_cursor(cursor)
-	-- -- Window.minimize();
-
-	package = Device.create_resource_package("level")
-	ResourcePackage.load(package)
-	ResourcePackage.flush(package)
-
-	world = Device.create_world()
-
-	-- Spawn camera
-	camera_unit = World.spawn_unit(world, "camera")
-	camera = Unit.camera(camera_unit, "camera")
-
-	-- Spawn dragon
-	dragon = World.spawn_unit(world, "bounce")
-
-	spawn_suns(15, -2, 400)
-	spawn_terrain(10, -3, 400)
-
-	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, ovest, east, south, north)
-	Camera.set_viewport_metrics(camera, 0, 0, 1000, 625)
-
-	Camera.set_local_position(camera, camera_unit, Vector3(0, 0, 1))
-end
-
-function frame(dt)
-	Device.update_world(world, dt)
-
-	-- Update window's viewport
-	win_w, win_h = Window.get_size()
-	Camera.set_viewport_metrics(camera, 0, 0, win_w, win_h)
-
-	-- Stop the engine when the 'ESC' key is released
-	if Keyboard.button_released(Keyboard.ESCAPE) then
-		Device.stop()
-	end
-
-	-- -- Spawn balls when SPACE pressed
-	-- if Keyboard.button_pressed(Keyboard.SPACE) then
-	-- 	World.spawn_unit(world, "b")
-	-- end
-
-	-- Play gunshoot on left click
-	if Mouse.button_pressed(Mouse.LEFT) then
-		World.play_sound(world, "sounds/gunshoot")
-	end
-
-	-- Print FPS on window title bar
-	timer = timer + Device.last_delta_time()
-		if (timer >= 5) then
-		Window.set_title(1.0 / Device.last_delta_time())
-		timer = 0.0
-	end
-
-	-- Update the player
-	update_player(world, dragon, dt)
-
-	-- Update the camera
-	update_camera(dragon, camera_unit, camera)
-
-	-- Render world
-	Device.render_world(world, camera)
-end
-
-function shutdown()
-
-	--World.destroy_unit(world, dragon)
-	--World.destroy_unit(world, button)
-	--World.destroy_unit(world, camera_unit)
-	
-	ResourcePackage.unload(package)
-	Device.destroy_resource_package(package)
-	Device.destroy_world(world)
-end

BIN
samples/03.bounce/sounds/beep.sound


BIN
samples/03.bounce/sounds/birds1.sound


BIN
samples/03.bounce/sounds/birds2.sound


BIN
samples/03.bounce/sounds/birds3.sound


BIN
samples/03.bounce/sounds/birds4.sound


BIN
samples/03.bounce/sounds/footsteps.sound


BIN
samples/03.bounce/sounds/gunshoot.sound


BIN
samples/03.bounce/sounds/jump.sound


BIN
samples/03.bounce/sounds/mario.sound


BIN
samples/03.bounce/sounds/mono.sound


BIN
samples/03.bounce/sounds/mono1.sound


BIN
samples/03.bounce/sounds/sweep.sound


BIN
samples/03.bounce/sounds/untrue.sound


+ 0 - 13
samples/03.bounce/sprites/bounce.sprite

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

+ 0 - 13
samples/03.bounce/sprites/box.sprite

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

+ 0 - 13
samples/03.bounce/sprites/sun.sprite

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

+ 0 - 5
samples/03.bounce/sun.material

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

+ 0 - 19
samples/03.bounce/sun.unit

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

BIN
samples/03.bounce/textures/bounce.texture


BIN
samples/03.bounce/textures/box.texture


BIN
samples/03.bounce/textures/sun.texture