User prompt
Ersetze die hopps im Main Menu durch Basketbälle und füge noch ein paar hopps hinzu
User prompt
Ersetze die hopps im Main Menu durch Basketbälle und füge noch ein paar hopps hinzu
User prompt
Füge ein paar Basketbälle zum Main Menu hinzu
User prompt
Please fix the bug: 'TypeError: setInterval is not a function' in or related to this line: 'setInterval(function () {' Line Number: 210
User prompt
Das Main Menu sieht leer aus änder das ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Lösch den Tap to Play Text
User prompt
Mach den Play Button breiter
User prompt
Pass die Größe des Buttons an dem Text an
User prompt
Und mach ein extra asset für den Play Button
User prompt
Der Titel im Main Menu soll flappy dunk sein
User prompt
Please fix the bug: 'Cannot read properties of undefined (reading 'sineInOut')' in or related to this line: 'tween.to(playButton, {' Line Number: 97 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Füge ein Main Menu hinzu
User prompt
Füge skins hinzu
User prompt
Du sollst 10 Punkte pro Korb kriegen
User prompt
Und nur ein Mal
User prompt
Man soll nur 10 Punkte bekommen wenn man einen Korb berührt
User prompt
Top and bottom too
User prompt
If you toch the Edge you should die
User prompt
Ein bisschen kleiner
User prompt
Mach alles doppelt so groß
User prompt
Es soll immer nur ein Korb zu sehen sein und verdopple die Größe
Code edit (1 edits merged)
Please save this source code
User prompt
Flappy Dunk
Initial prompt
Make flappy dunk
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ var Basketball = Container.expand(function () { var self = Container.call(this); var ballGraphics = self.attachAsset('basketball', { anchorX: 0.5, anchorY: 0.5 }); self.speedY = 0; self.gravity = 0.5; self.bounce = -10; self.update = function () { self.speedY += self.gravity; self.y += self.speedY; if (self.y > 2732 - ballGraphics.height / 2) { self.y = 2732 - ballGraphics.height / 2; self.speedY = self.bounce; } }; self.tap = function () { self.speedY = self.bounce; }; return self; }); var Hoop = Container.expand(function () { var self = Container.call(this); var hoopGraphics = self.attachAsset('hoop', { anchorX: 0.5, anchorY: 0.5 }); self.speedX = -5; self.update = function () { self.x += self.speedX; if (self.x < -hoopGraphics.width / 2) { self.x = 2048 + hoopGraphics.width / 2; self.y = Math.random() * (2732 - 400) + 200; } }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ // Initialize assets used in this game. Scale them according to what is needed for the game. game.setBackgroundColor(0x000000); var basketball = game.addChild(new Basketball()); basketball.x = 2048 / 4; basketball.y = 2732 / 2; basketball.scaleX = 1.5; basketball.scaleY = 1.5; var hoops = []; var hoop = game.addChild(new Hoop()); hoop.x = 2048; hoop.y = Math.random() * (2732 - 800) + 400; hoop.scaleX = 3; hoop.scaleY = 3; hoops.push(hoop); var scoreTxt = new Text2('0', { size: 150, fill: 0xFFFFFF }); scoreTxt.anchor.set(0.5, 0); LK.gui.top.addChild(scoreTxt); var score = 0; game.down = function (x, y, obj) { basketball.tap(); }; game.update = function () { basketball.update(); for (var i = 0; i < hoops.length; i++) { hoops[i].update(); if (!hoops[i].scored && basketball.intersects(hoops[i])) { score += 10; scoreTxt.setText(score); LK.getSound('swish').play(); hoops[i].scored = true; } } if (basketball.y > 2732 - basketball.height / 2 || basketball.y < basketball.height / 2 || basketball.x < basketball.width / 2 || basketball.x > 2048 - basketball.width / 2) { LK.showGameOver(); } }; LK.playMusic('bgmusic');
===================================================================
--- original.js
+++ change.js
@@ -82,12 +82,13 @@
game.update = function () {
basketball.update();
for (var i = 0; i < hoops.length; i++) {
hoops[i].update();
- if (basketball.intersects(hoops[i])) {
+ if (!hoops[i].scored && basketball.intersects(hoops[i])) {
score += 10;
scoreTxt.setText(score);
LK.getSound('swish').play();
+ hoops[i].scored = true;
}
}
if (basketball.y > 2732 - basketball.height / 2 || basketball.y < basketball.height / 2 || basketball.x < basketball.width / 2 || basketball.x > 2048 - basketball.width / 2) {
LK.showGameOver();
A Basketball. Single Game Texture. In-Game asset. 2d. Blank background. High contrast. No shadows
A blue Basketball. In-Game asset. 2d. High contrast. No shadows
A pink Basketball. In-Game asset. 2d. High contrast. No shadows
A half blue and half pink Basketball. In-Game asset. 2d. High contrast. No shadows
A Play button. In-Game asset. 2d. High contrast. No shadows