demo reset
This commit is contained in:
@@ -38,6 +38,7 @@ import Layout from "../../layouts/Layout.astro";
|
||||
const customHeight = window.innerHeight;
|
||||
let firstLayer, secondLayer, thirdLayer;
|
||||
let graphics;
|
||||
let animatedLetter;
|
||||
let isDrawing = false;
|
||||
let formattedDateTime;
|
||||
let gameStartTime = "start time here";
|
||||
@@ -230,6 +231,7 @@ import Layout from "../../layouts/Layout.astro";
|
||||
}
|
||||
});
|
||||
hideButton.setInteractive().on('pointerdown', () => {
|
||||
animatedLetter.stop();
|
||||
isDemoButtonClicked = false;
|
||||
firstScreen.setVisible(false);
|
||||
hideButton.setVisible(false); // Hide the "Hide" button
|
||||
@@ -254,6 +256,8 @@ import Layout from "../../layouts/Layout.astro";
|
||||
});
|
||||
|
||||
demoButton.setInteractive().on('pointerdown', () => {
|
||||
animatedLetter.setCurrentTime(0);
|
||||
animatedLetter.play(true);
|
||||
graphics.setVisible(false);
|
||||
firstScreen.setVisible(true);
|
||||
demoButton.setVisible(false); // Hide the "Demo" button
|
||||
@@ -266,10 +270,10 @@ import Layout from "../../layouts/Layout.astro";
|
||||
const baseFontSize = 20;
|
||||
const responsiveFontSize = (window.innerWidth / 480) * baseFontSize;
|
||||
const descrptText = this.add.text(screenCenterX, 90, 'Let`s learn how to write letter : O', { font: `${responsiveFontSize}px quicksand`, fill: '#7c4c23', fontWeight : 'bold'}).setOrigin(0.5);
|
||||
const animatedLetter = this.add.video(customWidth / 2 , customHeight / 2 + animatedOHeight, 'animatedO').setDepth(2).setScale(animatedVideoScale);
|
||||
animatedLetter = this.add.video(customWidth / 2 , customHeight / 2 + animatedOHeight, 'animatedO').setDepth(2).setScale(animatedVideoScale);
|
||||
|
||||
// Play the video
|
||||
animatedLetter.play();
|
||||
// animatedLetter.play();
|
||||
animatedLetter.setVisible(false);
|
||||
|
||||
// You can set additional properties for the video, such as loop and mute:
|
||||
@@ -297,7 +301,6 @@ import Layout from "../../layouts/Layout.astro";
|
||||
// Add these variables to keep track of start points
|
||||
let firstDragStartPoint = { x: 0, y: 0 };
|
||||
|
||||
// ...
|
||||
|
||||
// Add this code for firstLayer
|
||||
firstLayer.on('dragstart', (pointer) => {
|
||||
|
||||
Reference in New Issue
Block a user