Code edit (5 edits merged)
Please save this source code
User prompt
Agrega interfaz a lo largo de ancho y en la parte superior de BGMenu
User prompt
crea una clase llamada slime y colocalo al centro de BG
Code edit (1 edits merged)
Please save this source code
User prompt
Agrega a la escena BG en la mitad superior y BGMenu a la mitad inferior
User prompt
Bubble Bounce Blitz
Initial prompt
nothing
/**** * Classes ****/ var Slime = Container.expand(function () { var self = Container.call(this); // Create and attach the slime asset var slimeGraphics = self.attachAsset('Slime', { anchorX: 0.5, anchorY: 0.5 }); // Initialize tracking variables for position self.lastX = 0; self.lastY = 0; // Update method called every frame self.update = function () { // Track last position self.lastX = self.x; self.lastY = self.y; }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Create BGMenu for bottom half of screen var bgMenu = LK.getAsset('BGMenu', { anchorX: 0, anchorY: 0, x: 0, y: 2032 / 2, width: 2048, height: 3532 / 2 }); game.addChild(bgMenu); // Create BG for top half of screen var bg = LK.getAsset('BG', { anchorX: 0, anchorY: 0, x: 0, y: 0, width: 2048, height: 2032 / 2 }); game.addChild(bg); // Create a slime and add it to the scene var slime = new Slime(); // Position slime at the center of BG slime.x = bg.width / 2; slime.y = bg.height / 2; game.addChild(slime);
===================================================================
--- original.js
+++ change.js
@@ -1,5 +1,27 @@
/****
+* Classes
+****/
+var Slime = Container.expand(function () {
+ var self = Container.call(this);
+ // Create and attach the slime asset
+ var slimeGraphics = self.attachAsset('Slime', {
+ anchorX: 0.5,
+ anchorY: 0.5
+ });
+ // Initialize tracking variables for position
+ self.lastX = 0;
+ self.lastY = 0;
+ // Update method called every frame
+ self.update = function () {
+ // Track last position
+ self.lastX = self.x;
+ self.lastY = self.y;
+ };
+ return self;
+});
+
+/****
* Initialize Game
****/
var game = new LK.Game({
backgroundColor: 0x000000
@@ -7,24 +29,30 @@
/****
* Game Code
****/
-// Create BG for top half of screen
-var bg = LK.getAsset('BG', {
+// Create BGMenu for bottom half of screen
+var bgMenu = LK.getAsset('BGMenu', {
anchorX: 0,
anchorY: 0,
x: 0,
- y: 0,
+ y: 2032 / 2,
width: 2048,
- height: 2432 / 2
+ height: 3532 / 2
});
-game.addChild(bg);
-// Create BGMenu for bottom half of screen
-var bgMenu = LK.getAsset('BGMenu', {
+game.addChild(bgMenu);
+// Create BG for top half of screen
+var bg = LK.getAsset('BG', {
anchorX: 0,
anchorY: 0,
x: 0,
- y: 2732 / 2,
+ y: 0,
width: 2048,
- height: 3132 / 2
+ height: 2032 / 2
});
-game.addChild(bgMenu);
\ No newline at end of file
+game.addChild(bg);
+// Create a slime and add it to the scene
+var slime = new Slime();
+// Position slime at the center of BG
+slime.x = bg.width / 2;
+slime.y = bg.height / 2;
+game.addChild(slime);
\ No newline at end of file
Star cartoon. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime verde RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime rojo prendido fuego RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime RPG amarillo y divino con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime fantasmal RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime blanco con una moneda brillante en la frente RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime gris RPG con rocas en su espalda. Estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime RPG nevado con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime de agua RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime bestia peludo RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime morado con runas magicas RPG. Estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Un slime angelical RPG con estilo suave y simple. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
Fullscreen medieval landscape banner, 16:9, high definition, for a game titled "Slime Bestiary". Medieval forest with multiple colored slimes. No text on banner!