From ef9cda068992e768d3e5c19e22dc2dbacda6aa9e Mon Sep 17 00:00:00 2001 From: William Date: Sun, 19 Apr 2020 12:39:31 -0400 Subject: [PATCH 1/3] fixed the transition --- docs/assets/js/index.js | 8 ++++---- docs/assets/js/transition/transition.js | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/assets/js/index.js b/docs/assets/js/index.js index 27ca176..13b33c3 100644 --- a/docs/assets/js/index.js +++ b/docs/assets/js/index.js @@ -21,7 +21,7 @@ var globalStates = { building: 5 }; var globalState = globalStates.titleScreen; - +debugger function update() { switch (globalState) { @@ -31,7 +31,7 @@ function update() { break; // level transition case globalStates.levelTransition: - + handleTransition(); break; // playing case globalStates.playing: @@ -68,7 +68,8 @@ function draw() { break; // level transition case globalStates.levelTransition: - handleTransition(); + + drawLevelTransitionUI(); break; // playing case globalStates.playing: @@ -101,7 +102,6 @@ function absoluteDraw() { break; // level transition case globalStates.levelTransition: - drawLevelTransitionUI(); break; // playing case globalStates.playing: diff --git a/docs/assets/js/transition/transition.js b/docs/assets/js/transition/transition.js index b1d566f..1665c56 100644 --- a/docs/assets/js/transition/transition.js +++ b/docs/assets/js/transition/transition.js @@ -39,4 +39,5 @@ function drawLevelTransitionUI() { // resets alpha for rest of drawing canvases.ctx.globalAlpha = 1; + } From b5275535ab732b9978adb6bb39f084199103f17f Mon Sep 17 00:00:00 2001 From: William Date: Sun, 19 Apr 2020 12:39:46 -0400 Subject: [PATCH 2/3] clean up --- docs/assets/js/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/assets/js/index.js b/docs/assets/js/index.js index 13b33c3..004ec4a 100644 --- a/docs/assets/js/index.js +++ b/docs/assets/js/index.js @@ -21,7 +21,7 @@ var globalStates = { building: 5 }; var globalState = globalStates.titleScreen; -debugger + function update() { switch (globalState) { From a6481e788c87dbd468a4e4566781f559c70ba460 Mon Sep 17 00:00:00 2001 From: William Date: Sun, 19 Apr 2020 12:47:30 -0400 Subject: [PATCH 3/3] Changed camera for transition --- docs/assets/js/transition/transition.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/assets/js/transition/transition.js b/docs/assets/js/transition/transition.js index 66093f3..b542f22 100644 --- a/docs/assets/js/transition/transition.js +++ b/docs/assets/js/transition/transition.js @@ -10,6 +10,20 @@ function handleTransition(){ } + centerCameraOn(constants.player.defaultX, constants.player.defaultY); + + if(camera.x > 898) { + camera.x = 898; + } + if(camera.x < -98) { + camera.x = -98; + } + if(camera.y < 245) { + camera.y = 245; + } + if(camera.y > 350) { + camera.y = 350; + } } @@ -17,7 +31,7 @@ function handleTransition(){ function drawLevelTransitionUI() { // centers camera on player - centerCameraOn(constants.player.defaultX, constants.player.defaultY); + // sets alpha for background drawing canvases.ctx.globalAlpha = 1;