/**** * Classes ****/ // Class for the camera var Camera = Container.expand(function () { var self = Container.call(this); var cameraGraphics = self.attachAsset('camera', { anchorX: 0.5, anchorY: 0.5 }); self.takePhoto = function () { var photo = new Photo(self.x, self.y); game.addChild(photo); return photo; }; }); //<Assets used in the game will automatically appear here> // Class for the moving target var MovingTarget = Container.expand(function () { var self = Container.call(this); var targetGraphics = self.attachAsset('target', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = 3; self.speedY = 2; self.update = function () { self.x += self.speedX; self.y += self.speedY; if (self.x > 2048 || self.y > 2732) { self.destroy(); } }; }); // Class for the photo var Photo = Container.expand(function (x, y) { var self = Container.call(this); var photoGraphics = self.attachAsset('photo', { anchorX: 0.5, anchorY: 0.5, x: x, y: y }); self.update = function () { // Photo logic, if any }; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 //Init game with black background }); /**** * Game Code ****/ // Initialize variables var score = 0; var scoreTxt = new Text2('Score: 0', { size: 100, fill: "#ffffff" }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var target = new MovingTarget(); target.x = 1024; target.y = 1366; game.addChild(target); var camera = new Camera(); camera.x = 1024; camera.y = 2500; game.addChild(camera); game.down = function (x, y, obj) { var photo = camera.takePhoto(); if (photo.intersects(target)) { score += 10; scoreTxt.setText('Score: ' + score); } }; game.update = function () { target.update(); };
===================================================================
--- original.js
+++ change.js
@@ -1,66 +1,67 @@
-/****
+/****
* Classes
-****/
+****/
// Class for the camera
var Camera = Container.expand(function () {
- var self = Container.call(this);
- var cameraGraphics = self.attachAsset('camera', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.takePhoto = function () {
- var photo = new Photo(self.x, self.y);
- game.addChild(photo);
- return photo;
- };
+ var self = Container.call(this);
+ var cameraGraphics = self.attachAsset('camera', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.takePhoto = function () {
+ var photo = new Photo(self.x, self.y);
+ game.addChild(photo);
+ return photo;
+ };
});
//<Assets used in the game will automatically appear here>
// Class for the moving target
var MovingTarget = Container.expand(function () {
- var self = Container.call(this);
- var targetGraphics = self.attachAsset('target', {
- anchorX: 0.5,
- anchorY: 0.5
- });
- self.speedX = 3;
- self.speedY = 2;
- self.update = function () {
- self.x += self.speedX;
- self.y += self.speedY;
- if (self.x < 0 || self.x > 2048) self.speedX *= -1;
- if (self.y < 0 || self.y > 2732) self.speedY *= -1;
- };
+ var self = Container.call(this);
+ var targetGraphics = self.attachAsset('target', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ self.speedX = 3;
+ self.speedY = 2;
+ self.update = function () {
+ self.x += self.speedX;
+ self.y += self.speedY;
+ if (self.x > 2048 || self.y > 2732) {
+ self.destroy();
+ }
+ };
});
// Class for the photo
var Photo = Container.expand(function (x, y) {
- var self = Container.call(this);
- var photoGraphics = self.attachAsset('photo', {
- anchorX: 0.5,
- anchorY: 0.5,
- x: x,
- y: y
- });
- self.update = function () {
- // Photo logic, if any
- };
+ var self = Container.call(this);
+ var photoGraphics = self.attachAsset('photo', {
+ anchorX: 0.5,
+ anchorY: 0.5,
+ x: x,
+ y: y
+ });
+ self.update = function () {
+ // Photo logic, if any
+ };
});
-/****
+/****
* Initialize Game
-****/
+****/
var game = new LK.Game({
- backgroundColor: 0x000000 //Init game with black background
+ backgroundColor: 0x000000 //Init game with black background
});
-/****
+/****
* Game Code
-****/
+****/
// Initialize variables
var score = 0;
var scoreTxt = new Text2('Score: 0', {
- size: 100,
- fill: "#ffffff"
+ size: 100,
+ fill: "#ffffff"
});
scoreTxt.anchor.set(0.5, 0);
LK.gui.top.addChild(scoreTxt);
var target = new MovingTarget();
@@ -71,13 +72,13 @@
camera.x = 1024;
camera.y = 2500;
game.addChild(camera);
game.down = function (x, y, obj) {
- var photo = camera.takePhoto();
- if (photo.intersects(target)) {
- score += 10;
- scoreTxt.setText('Score: ' + score);
- }
+ var photo = camera.takePhoto();
+ if (photo.intersects(target)) {
+ score += 10;
+ scoreTxt.setText('Score: ' + score);
+ }
};
game.update = function () {
- target.update();
+ target.update();
};
\ No newline at end of file
a forest.
flying Red-bellied Woodpecker.
flying Yellow-headed Blackbird.
flying Painted Bunting.
Underwater. only water and corals. NO animals
Countryside. 1 flower in foreground.
A Butterfly flying.
a fish swimming.
full dragonfly flying to the right.
full drone flying to the right.
a full hot air balloon with a basket flying to the right.
roofs of an empty modern city. day light
a satellite.
stary dark space. NO OBJECTS
a multitude of polaroids in bulk, with photos of birds, fishes, butterflies, planes, hot air baloons, satelites, dragonflies.....
A flying owl.
A flying parrot.
hippocampe.
shark. lateral view
diodon hystrix swimming. lateral view
fighting fish swimming. lateral view
a hang glider flying. full lateral view
un cerf-volant multicolore.
une coccinelle volante.
un scarabée vert irisé volant. side view
une gueppe volante. side view
un astronaute volant. full side view
une navette spaciale volante. full side view
un astéroïde volant dans l'espace. full side view
remove