Code edit (1 edits merged)
Please save this source code
User prompt
Los textos no son visibles
User prompt
agrega textos en la esquina inferior derecha para visualizar el acurracy
User prompt
crea variables para contar cuantos perfect, marvelous, bad, etc lleva el jugador
Code edit (3 edits merged)
Please save this source code
User prompt
Agrega un contador para llevar cuantos marvelous, perfect, bad, etc lleva el jugador (en forma de torre del mejor al peor, en la esquina inferior derecha)
User prompt
Agrega un contador para llevar cuantos marvelous, perfect, bad, etc lleva el jugador (en forma de torre del mejor al peor)
User prompt
Agrega un sonido al tocar
User prompt
agrega un sonido al tocar perfecto
User prompt
si se toca muy tarde el ms sera -ms si se toca muy despues ms
User prompt
haz que los textos de hit esten en la parte superior
User prompt
agrega al lado del texto de resultado el ms (ej: good / 20ms)
User prompt
crea un sistema de fail, bad, good, perfect, marvelous dependiendo de ms del hit (ms = milisegundos) si hit acurracy esta en la misma posicion de hit zone es marvelous y agrega segun los ms (negativo y positivo), si se pasa mucho tiempo = fail, si se toca muy per muy antes = fail
User prompt
Elimina una duración de minima y maxima de hitacurracy y haz que sea lineal dependiente de la velocidad
User prompt
elimina el hit acurracy duration
Code edit (1 edits merged)
Please save this source code
User prompt
crea una variable speed para modificar la velocidad en la que cae la hit acurracy
User prompt
Please fix the bug: 'tween.to is not a function' in or related to this line: 'tween.to(hitAccuracy, {' Line Number: 41 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
Please fix the bug: 'tween is not defined' in or related to this line: 'tween.to(hitAccuracy, {' Line Number: 36 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
crea un segundo aro para note llamada hit acurracy, este esta muy separado y se acerca a hit zone
User prompt
crea una variable llamada ms
User prompt
haz que note sea tocable y al tocarlo este se se destruye y se crea otro en un lugar random
Code edit (1 edits merged)
Please save this source code
Code edit (2 edits merged)
Please save this source code
User prompt
agrega a note un aro externo llamado hit zone separado a unos pixeles de el con una transparencia de 0.6
/**** * Plugins ****/ var tween = LK.import("@upit/tween.v1"); /**** * Classes ****/ // Note class: creates a note at a random (x, y) position var Note = Container.expand(function () { var self = Container.call(this); var hitZone = self.attachAsset('hit', { anchorX: 0.5, anchorY: 0.5, scaleX: 1.6, scaleY: 1.6 }); hitZone.alpha = 0.4; // Add hitAccuracy ring, starts much further out var hitAccuracy = self.attachAsset('hit', { anchorX: 0.5, anchorY: 0.5, scaleX: 2.5, scaleY: 2.5 }); hitAccuracy.alpha = 0.25; // Animate hitAccuracy ring moving toward hitZone var hitAccuracyTargetScale = 1.6; var hitAccuracyStartScale = 2.5; var hitAccuracyDuration = 900 / speed; // ms, adjust for speed hitAccuracy.scaleX = hitAccuracyStartScale; hitAccuracy.scaleY = hitAccuracyStartScale; // Use tween plugin for smooth animation tween(hitAccuracy, { scaleX: hitAccuracyTargetScale, scaleY: hitAccuracyTargetScale }, { duration: hitAccuracyDuration }); var noteAsset = self.attachAsset('note', { anchorX: 0.5, anchorY: 0.5 }); var margin = 100; self.x = margin + Math.random() * (2048 - 2 * margin); self.y = margin + Math.random() * (2732 - 2 * margin); self.down = function (x, y, obj) { self.destroy(); note = new Note(); game.addChild(note); }; return self; }); /**** * Initialize Game ****/ var game = new LK.Game({ backgroundColor: 0x000000 }); /**** * Game Code ****/ var ms; var speed = 1; var note; /* * Initializations */ note = new Note(); game.addChild(note);
===================================================================
--- original.js
+++ change.js
@@ -43,13 +43,10 @@
});
var margin = 100;
self.x = margin + Math.random() * (2048 - 2 * margin);
self.y = margin + Math.random() * (2732 - 2 * margin);
- // Make note touchable
self.down = function (x, y, obj) {
- // Remove current note from game
self.destroy();
- // Create and add a new note at a random position
note = new Note();
game.addChild(note);
};
return self;
@@ -64,11 +61,10 @@
/****
* Game Code
****/
-//Minimalistic tween library which should be used for animations over time, including tinting / colouring an object, scaling, rotating, or changing any game object property.
var ms;
-var speed = 1; // Default speed multiplier for hitAccuracy ring (1 = normal, >1 = faster, <1 = slower)
+var speed = 1;
var note;
/*
* Initializations
*/