diff --git a/js-web/KubeInvaders/archive/archive_files.json b/js-web/KubeInvaders/archive/archive_files.json index a111411..a5d9fb3 100644 --- a/js-web/KubeInvaders/archive/archive_files.json +++ b/js-web/KubeInvaders/archive/archive_files.json @@ -1 +1 @@ -{"content":[{"name":"game.projectc","size":2333,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":5328,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":286120,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":9435,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]} \ No newline at end of file +{"content":[{"name":"game.projectc","size":2333,"pieces":[{"name":"game.projectc0","offset":0}]},{"name":"game.arci","size":5328,"pieces":[{"name":"game.arci0","offset":0}]},{"name":"game.arcd","size":286144,"pieces":[{"name":"game.arcd0","offset":0}]},{"name":"game.dmanifest","size":9435,"pieces":[{"name":"game.dmanifest0","offset":0}]},{"name":"game.public.der","size":162,"pieces":[{"name":"game.public.der0","offset":0}]}]} \ No newline at end of file diff --git a/js-web/KubeInvaders/archive/game.arcd0 b/js-web/KubeInvaders/archive/game.arcd0 index 1c290a3..d9923be 100644 Binary files a/js-web/KubeInvaders/archive/game.arcd0 and b/js-web/KubeInvaders/archive/game.arcd0 differ diff --git a/js-web/KubeInvaders/archive/game.arci0 b/js-web/KubeInvaders/archive/game.arci0 index 0b9bbde..e71fc71 100644 Binary files a/js-web/KubeInvaders/archive/game.arci0 and b/js-web/KubeInvaders/archive/game.arci0 differ diff --git a/js-web/KubeInvaders/archive/game.dmanifest0 b/js-web/KubeInvaders/archive/game.dmanifest0 index 32918af..779d1aa 100644 Binary files a/js-web/KubeInvaders/archive/game.dmanifest0 and b/js-web/KubeInvaders/archive/game.dmanifest0 differ diff --git a/js-web/KubeInvaders/archive/game.public.der0 b/js-web/KubeInvaders/archive/game.public.der0 index 52c5038..0258e2f 100644 Binary files a/js-web/KubeInvaders/archive/game.public.der0 and b/js-web/KubeInvaders/archive/game.public.der0 differ diff --git a/js-web/report.html b/js-web/report.html index 6bbf3cd..2d59a3f 100644 --- a/js-web/report.html +++ b/js-web/report.html @@ -6,7 +6,7 @@ var report_data = { "report_version" : "1.0.0", "project_name" : "KubeInvaders", - "build_timestamp" : 1555876539, + "build_timestamp" : 1555918890, "build_options" : { "defoldsdk" : "47c9f8e03623ca3ac511b5a55e6cfcc7e51ce340", "bundle-output" : "/Users/eugenio/KubeInvaders/js-web", @@ -207,8 +207,8 @@ "encrypted" : false }, { "file" : "/main/spaceship.scriptc", - "size" : 20750, - "compressed_size" : 9201, + "size" : 20887, + "compressed_size" : 9238, "encrypted" : true }, { "file" : "/assets/untitled.texturesetc", @@ -260,16 +260,16 @@ "size" : 22628, "compressed_size" : 4053, "encrypted" : false - }, { - "file" : "/main/gui.guic", - "size" : 1410, - "compressed_size" : 490, - "encrypted" : false }, { "file" : "/main/untitled_generated_1.collisionobjectc", "size" : 98, "compressed_size" : 85, "encrypted" : false + }, { + "file" : "/main/gui.guic", + "size" : 1410, + "compressed_size" : 480, + "encrypted" : false }, { "file" : "/builtins/input/default.gamepadsc", "size" : 2826, diff --git a/main/gui.gui b/main/gui.gui index d030d33..aa93ae2 100644 --- a/main/gui.gui +++ b/main/gui.gui @@ -299,9 +299,9 @@ nodes { w: 1.0 } color { - x: 0.9019608 - y: 0.9019608 - z: 0.3019608 + x: 1.0 + y: 1.0 + z: 0.0 w: 1.0 } type: TYPE_TEXT diff --git a/main/spaceship.script b/main/spaceship.script index f7bbd91..6bb7e79 100644 --- a/main/spaceship.script +++ b/main/spaceship.script @@ -24,7 +24,6 @@ function swap_pod(items) for i,value in ipairs(items) do if value['status']['phase'] ~= "Running" or value['metadata']['deletionTimestamp'] ~= nil then kube_pod_not_running = kube_pod_not_running + 1 - --print ("[swap_pod]:" .. value['metadata']['name'] .. " is not running on Kubernetes cluster") else kube_pod_running = kube_pod_running + 1 end @@ -55,12 +54,14 @@ function swap_pod(items) print ("[swap_pod]: not running pods in KubeInvaders: " .. current_pod_not_running) if kube_pod_running < current_kubeinvaders_pod_size then - i = current_kubeinvaders_pod_size - while ( i > 0 ) do - if current_pods[i]["color"] == "white" then + i = current_kubeinvaders_pod_size - 1 + diff = current_kubeinvaders_pod_size - kube_pod_running + cleaned_pods = 0 + while ( i > current_kubeinvaders_pod_size or cleaned_pods < diff) do + if current_pods[i]["color"] == "red" then go.delete(current_pods[i]["id"]) table.remove(current_pods,i) - break + cleaned_pods = cleaned_pods + 1 end i = i - 1 end @@ -131,16 +132,15 @@ function ai() if automatic == false then return end - for i=1,2 do + for i=1,1 do rand_pod = math.random(100, 1000) end pos = go.get_position() pos.y = 220 go.set_position(pos) - pos.x = rand_pod - + pos.x = rand_pod go.animate(go.get_id(), "position.x", go.PLAYBACK_ONCE_FORWARD, pos.x, go.EASING_INQUAD, 1,0, function() - go.set_position(pos) + pos = go.get_position() bullet = factory.create("/bullet#bulletfactory", pos) go.animate(bullet, "position.y", go.PLAYBACK_ONCE_FORWARD, 700, go.EASING_INQUAD, 1,0,function() go.delete(bullet)