Code edit (2 edits merged)
Please save this source code
User prompt
Here is the desired behaviour : Start : logo is out and enters to the center with elasticIn Tap : logo leaves with a rancom ...Out easing the, comes back with a random "...In" easing
Code edit (3 edits merged)
Please save this source code
User prompt
Please fix the code, too laggy
User prompt
at the end of tween(logo, { x: -logo.width, y: -logo.height }, { duration: 2000, easing: randomEasing }); call the easing in code
User prompt
refoactor the code to reduce duplication
User prompt
ok, now instead of logo.x = -logo.width; logo.y = -logo.height; use a rancom corner
User prompt
add a text "Easing" in bottom center
Code edit (9 edits merged)
Please save this source code
User prompt
text appears black, change it to white
Code edit (1 edits merged)
Please save this source code
User prompt
fill property has a problem; try something else to make text white
User prompt
add text to game instead of gui
User prompt
add a tint FFF to text
Code edit (1 edits merged)
Please save this source code
User prompt
never mind, change bg color to pastel dark blue
User prompt
change 0x5D92B1 to paster green
User prompt
Please fix the bug: 'tween is not defined' in or related to this line: 'var easingFunctionsIn = [tween.linear, tween.easeIn, tween.elasticIn, tween.bounceIn];' Line Number: 30 ↪💡 Consider importing and using the following plugins: @upit/tween.v1
User prompt
now at each logo move update the text with the name of current easing
User prompt
Please fix the bug: 'TypeError: randomEasing is undefined' in or related to this line: 'easingText.setText(randomEasing.name);' Line Number: 87
Code edit (1 edits merged)
Please save this source code
User prompt
create an array equivalent to easingFunctionsIn but with easing functions names as a strings
User prompt
create an new array equivalent to easingFunctionsIn but with easing functions names as strings
User prompt
Please fix the bug: 'TypeError: easing is not a function' in or related to this line: 'easingText.setText(randomEasing.name);' Line Number: 88
User prompt
Please fix the bug: 'TypeError: easing is not a function' in or related to this line: 'easingText.setText(randomEasing.name);' Line Number: 88
===================================================================
--- original.js
+++ change.js
@@ -34,10 +34,32 @@
function animateLogo(isLogoIn) {
var randomEasing;
if (!isLogoIn) {
// If logo is out, animate it in
- logo.x = -logo.width;
- logo.y = -logo.height;
+ // Randomly select a corner for the logo to appear
+ var corners = [{
+ x: -logo.width,
+ y: -logo.height
+ },
+ // Top left
+ {
+ x: 2048 + logo.width,
+ y: -logo.height
+ },
+ // Top right
+ {
+ x: -logo.width,
+ y: 2732 + logo.height
+ },
+ // Bottom left
+ {
+ x: 2048 + logo.width,
+ y: 2732 + logo.height
+ } // Bottom right
+ ];
+ var corner = corners[Math.floor(Math.random() * corners.length)];
+ logo.x = corner.x;
+ logo.y = corner.y;
randomEasing = easingFunctionsIn[Math.floor(Math.random() * easingFunctionsIn.length)];
} else {
// If logo is in, animate it out
randomEasing = easingFunctionsOut[Math.floor(Math.random() * easingFunctionsOut.length)];