-
Notifications
You must be signed in to change notification settings - Fork 6
/
index.html
848 lines (833 loc) · 50.4 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pocket Platformer</title>
<script>
window.onbeforeunload = function (e) {
e = e || window.event;
// For IE and Firefox prior to version 4
if (e) {
e.returnValue = 'Are you sure you want to close? Your progress will be lost.';
}
return 'Are you sure you want to close? Your progress will be lost.';
};
</script>
</head>
<body>
<div id="header" class="sectionContent flexGap8">
<img src="images/icons/pp.png" height="26px" />
<div class="topnav" id="myTopnav">
<div class="dropdown navElement">
<button class="dropbtn" onclick="navDropDownClick(event)">
File
<img src="images/icons/right.svg" alt="right" width="10" height="10" class="rotate90Degrees">
</button>
<ul class="dropdown-content" id="myDropdown">
<li class="dropdown-nav-item">
<label>
<input type="file" id="importButton" onChange="importGame(tileMapHandler)" />
<span>Import </span>
<img src="images/icons/import.svg" class="iconInButtonWithText" alt="import" width="12"
height="12">
</label>
</li>
<li class="dropdown-nav-item" onClick="exportGame()">
<div>
Export
<img src="images/icons/export.svg" alt="right" width="12" height="12">
</div>
</li>
</ul>
</div>
</div>
<div id="viewChangerWrapper" style="border-right: 1px solid lightgrey;">
<div class="dropdown navElement">
<button class="dropbtn" onclick="navDropDownClick(event, 'myDropdown2')">
View
<img src="images/icons/right.svg" alt="right" width="10" height="10" class="rotate90Degrees">
</button>
<ul class="dropdown-content" id="myDropdown2">
<li class="dropdown-nav-item" onClick="changeView('game')">
<div>Game-screen
<img src="images/icons/checkmark.svg" alt="right" width="12" height="12"
id="gameViewCheckmark">
</div>
</li>
<li class="dropdown-nav-item" onClick="changeView('sounds')">
<div>Sounds
<img src="images/icons/checkmark.svg" alt="right" width="12" height="12"
style="display: none;" id="soundViewCheckmark">
</div>
</li>
</ul>
</div>
</div>
<a href="https://discord.gg/g8QAW2VK5C" target="_blank" id="discordLinkWrapper">
<span class="linkWithIcon" id="discordLink">Join discord</span>
<img src="images/icons/discord.svg" alt="discord" width="24" height="24">
</a>
</div>
<div id="scrollMenu">
<div id="gameView">
<div class="section" id="buildTools">
<h2 class="sectionHeading">BUILD TOOLS</h2>
<div id="buildMenu" class="sectionContent">
<div id="tabWrapper">
<button class="levelNavigationButton tabButton active"
onclick="TabNavigation.changeTab(event, SpritePixelArrays.SPRITE_TYPES.tile)">
<img src="images/icons/tile.svg" alt="tile" width="16" height="16">
</button>
<button class="levelNavigationButton tabButton"
onclick="TabNavigation.changeTab(event, SpritePixelArrays.SPRITE_TYPES.object)">
<img src="images/icons/objects.svg" alt="object" width="16" height="16">
</button>
<button class="levelNavigationButton tabButton"
onclick="TabNavigation.changeTab(event, SpritePixelArrays.SPRITE_TYPES.deko)">
<img src="images/icons/deko.svg" alt="deko" width="16" height="16">
</button>
<button class="levelNavigationButton tabButton"
onclick="TabNavigation.changeTab(event, SpritePixelArrays.customType)">
<img src="images/icons/plus.svg" alt="custom" width="16" height="16" style="width: 55%;">
</button>
</div>
<div id="tabContent">
<div id="tabTitleContent">
<button id="tabPaginationLeft" class="tabPaginationIcon levelNavigationButton"
style="display: none;" class="levelNavigationButton tabButton"
onclick="TabPagination.changePage(-1)">
<img src="images/icons/left.svg" alt="left" width="14" height="14">
</button>
<button id="tabPaginationRight" class="tabPaginationIcon levelNavigationButton "
class="levelNavigationButton tabButton" onclick="TabPagination.changePage(1)">
<img src="images/icons/right.svg" alt="right" width="14" height="14">
</button>
<div class="spritesTitle">
<span id="spritesTitle" style="margin-left: 10px">TILES</span>
<span id="currentPage"></span>
</div>
</div>
<div id="buildSpritesCanvasWrapper">
<button id="createNewSpriteButton" class="levelNavigationButton"
onClick="CustomSpriteHandler.initializeModal()">
<img src="images/icons/plus.svg" alt="plus" width="14" height="14">
</button>
<canvas id="buildSpritesCanvas" width="180" height="304"
onclick="TabNavigation.selectSprite(event)"></canvas>
</div>
<div id="drawStyle" class="subSection">
<span>Draw-style:</span>
<label for="pencilDrawStyle" class="radioButtonAsSvg">
<input type="radio" checked="checked" id="pencilDrawStyle" name="drawStyleRadioGroup"
value="pencilDrawStyle" onclick="BuildMode.changeDrawStyle('pencil')">
<img src="images/icons/pencil.svg" class="iconInButtonWithText" alt="pencilDrawStyle"
width="16" height="16"></label>
<label for="rectangleDrawStyle" class="radioButtonAsSvg">
<input type="radio" id="rectangleDrawStyle" name="drawStyleRadioGroup"
value="rectangleDrawStyle" onclick="BuildMode.changeDrawStyle('rectangle')">
<img src="images/icons/rectangle.svg" class="iconInButtonWithText"
alt="rectangleDrawStyle" width="16" height="16"></label>
</label>
</div>
</div>
<button id="changeGameMode"
class="levelNavigationButton fullWidth buttonWithIconAndText marginTop16"
onclick="Game.changeGameMode()">
<div>
<img src="images/icons/right.svg" class="iconInButtonWithText" alt="play" width="14"
height="14">
<span id="playPauseText">Play</span>
</div>
</button>
</div>
</div>
<div class="section" id="gameScreen">
<h2 class="sectionHeading">GAME SCREEN</h2>
<div class="sectionContent">
<div class="menuSection">
<div class="levelNavigation">
<button class="levelNavigationButton" onClick="LevelNavigationHandler.incrementLevel(-1)">
<img src="images/icons/left.svg" alt="left" width="14" height="14">
</button>
<select id="levelListDropdown"
onchange="LevelNavigationHandler.selectLevel(parseInt(event.target.value))">
<option value="0">(Loading...)</option>
</select>
<button class="levelNavigationButton" onClick="LevelNavigationHandler.incrementLevel(1)">
<img src="images/icons/right.svg" alt="right" width="14" height="14">
</button>
<button id="createNewLevelButton" class="levelNavigationButton"
onClick="LevelNavigationHandler.createNewEmptyLevel()">
<img src="images/icons/plus.svg" alt="plus" width="14" height="14">
</button>
<button id="levelHelpersButton" class="levelNavigationButton"
onClick="LevelNavigationHandler.showLevelHelpersTooltip()">
<img src="images/icons/drawHelpers.svg" alt="levelHelpers" width="14" height="14">
<div id="levelHelpersTooltip"></div>
</button>
</div>
<div id="levelEditSection">
<button id="worldColorButton" class="levelNavigationButton"
onClick="WorldColorHandler.initializeModal();">
<img src="images/icons/multicolor.svg" alt="multicolor" width="16" height="16">
</button>
<button id="levelSizeButton" class="levelNavigationButton"
onClick="LevelNavigationHandler.initializeLevelSizeSection();">
<img src="images/icons/resize.svg" alt="resize" width="16" height="16">
</button>
</div>
</div>
<canvas id="myCanvas" onWheel="LevelSizeHandler.mouseWheelSizeChange(event)"></canvas>
<canvas id="tileCanvas" style="display: none;"></canvas>
<div id="canvasObjectToolTip" class="tooltipWithSpeechBubble">
</div>
<div id="dialogueAvatarTooltip">
</div>
<div class="cameraYSliderWrapper" style="display: none" id="cameraYSliderWrapper">
<img src="images/icons/camera.svg" alt="camera" width="18" height="18">
<input sliderOrientation="verticalInverted" class="cameraYSlider"
oninput="LevelSizeHandler.moveCamera(event)" type="range" min="1" max="100" value="0"
id="cameraYSlider">
</div>
<div class="marginTop8" style="display: none" id="cameraXSliderWrapper">
<img src="images/icons/camera.svg" alt="camera" width="18" height="18">
<input class="cameraXSlider" oninput="LevelSizeHandler.moveCamera(event)" type="range" min="1"
max="100" value="0" id="cameraXSlider">
</div>
</div>
</div>
<div class="section" id="drawSection">
<h2 class="sectionHeading">DRAW</h2>
<div class="sectionContent" id="drawSection">
<select name="spriteSelector" id="spriteSelectEl" class="fullWidth"
onChange="DrawSectionHandler.changeSelectedSprite(event)" onkeydown="event.preventDefault();">
</select>
<div class="subSection">
<div style="position: relative;">
<button id="pencilButton" class="color-button levelNavigationButton buttonWithIconAndText"
onClick="DrawSectionHandler.selectPencilTool()">
<img id="pencilIcon" src="images/icons/pencil.svg" class="iconInButtonWithText"
alt="colorpicker" width="16" height="16">
</button>
<button id="eyeDropperButton" class="levelNavigationButton buttonWithIconAndText"
onClick="DrawSectionHandler.selectEyeDropperTool()">
<img src="images/icons/colorpicker.svg" class="iconInButtonWithText" alt="colorpicker"
width="16" height="16">
</button>
<button id="drawHelpers" class="color-button levelNavigationButton buttonWithIconAndText"
onClick="DrawSectionHandler.showDrawHelpersToolTip()">
<img src="images/icons/drawHelpers.svg" class="iconInButtonWithText" alt="drawHelpers"
width="16" height="16">
<div id="transformTooltip"></div>
</button>
<button id="otherSpritesButton" class="levelNavigationButton buttonWithIconAndText"
onClick="DrawSectionHandler.showOtherSpritesTooltip(event)">
<img src="images/icons/otherSprites.svg" class="iconInButtonWithText" alt="otherSprites"
width="16" height="16">
<div id="otherSpriteTooltip">
</div>
</button>
<div id="example-picker"></div>
</div>
<canvas id="redrawSpriteCanvas" class="pencilCursor" width="192" height="192"></canvas>
</div>
<div id="spriteAnimationWrapper" class="subSection">
<span id="animationText">Animation: </span>
<div id="spriteAnimationEl"></div>
</div>
<div id="spriteDescriptionWrapper" class="subSection normalText">
</div>
</div>
</div>
<div class="section" id="settingsSection">
<h2 class="sectionHeading">SETTINGS</h2>
<div class="sectionContent">
<div id="importExportWrapper">
<label for="gamesname">Game's name </label>
<input id="gamesname" class="input" type="text" size="15" value="Example name"
oninput="changeTitleOrEnding(event, 'gamesName')" />
<div class="marginTop8">
<label for="endingmessage">Ending message</label>
<input id="endingmessage" class="input" type="text" size="15" value="Thx for playing!"
oninput="changeTitleOrEnding(event, 'endingMessage')" />
</div>
<div class="subSection">
<details>
<summary>Player attributes</summary>
<div class="marginTop8">
<div class="marginTop4">
<input type="checkbox" id="jumpChecked" checked>
<label for="jumpChecked" class="checkBoxText">Jump</label>
</div>
<div class="marginTop4">
<input type="checkbox" id="doubleJumpChecked" checked>
<label for="doubleJumpChecked" class="checkBoxText">Double-jump</label>
</div>
<div class="marginTop4">
<input type="checkbox" id="wallJumpChecked" checked>
<label for="wallJumpChecked" class="checkBoxText">Wall-jump</label>
</div>
<div class="marginTop8 subSection">Alternative action:</div>
<div class="marginTop8">
<input type="checkbox" id="dashChecked" checked>
<label for="dashChecked" class="checkBoxText">Dash</label>
</div>
<div class="marginTop8" style="display: none;">
<input type="checkbox" id="runChecked" checked>
<label for="runChecked" class="checkBoxText">Run</label>
</div>
<div class="playerAttributeWrapper subSection">
<label for="maxSpeed">max-speed: </label>
<input class="playerAttrSlider" type="range" min="1" max="6" value="1"
id="maxSpeed" step="0.1">
<span id="maxSpeedValue" class="playerAttrSliderValue">1</span>
</div>
<div class="playerAttributeWrapper">
<label for="groundAcceleration">acceleration: </label>
<input class="playerAttrSlider" type="range" min="0.01" max="1" value="0.6"
step="0.01" id="groundAcceleration">
<span id="groundAccelerationValue" class="playerAttrSliderValue">88</span>
</div>
<div class="playerAttributeWrapper">
<label for="air_acceleration">in-air acceleration: </label>
<input class="playerAttrSlider" type="range" min="0.01" max="1" value="0.6"
step="0.01" id="air_acceleration">
<span id="air_accelerationValue" class="playerAttrSliderValue">0.6</span>
</div>
<div class="playerAttributeWrapper">
<label for="groundFriction">slipperiness: </label>
<input class="playerAttrSlider" type="range" min="0" max="1" value="0.6"
step="0.03" id="groundFriction">
<span id="groundFrictionValue" class="playerAttrSliderValue">65</span>
</div>
<div class="playerAttributeWrapper">
<label for="air_friction">in air slipperiness: </label>
<input class="playerAttrSlider" type="range" min="0" max="1" value="0.6"
step="0.03" id="air_friction">
<span id="air_frictionValue" class="playerAttrSliderValue">0.6</span>
</div>
<div class="playerAttributeWrapper">
<label for="jumpSpeed">jump height: </label>
<input class="playerAttrSlider" type="range" min="1" max="10" value="3" step="1"
id="jumpSpeed">
<span id="jumpSpeedValue" class="playerAttrSliderValue">65</span>
</div>
<div class="playerAttributeWrapper">
<label for="maxFallSpeed">Max fall speed: </label>
<input class="playerAttrSlider" type="range" min="1" max="23" value="16"
step="1" id="maxFallSpeed">
<span id="maxFallSpeedValue" class="playerAttrSliderValue">16</span>
</div>
</div>
</details>
<details class="marginTop12" id="playerAnimationWrapper">
<summary>Player animation</summary>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'Player idle'} }, true)">
Player idle</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'Player jump'} }, true)">
Player jump</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'Player walk'} }, true)">
Player walk</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'SFX 1'} }, true)">
Jump SFX</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'SFX 10'} }, true)">
Run trail</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'SFX 3'} }, true)">
Death trail</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'SFX 13'} }, true)">
Dash trail</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'SFX 11'} }, true)">
Swimming trail</div>
<div class='textAsLink'
onclick="DrawSectionHandler.changeSelectedSprite({ target: { value: 'SFX 8'} }, true)">
Fixed speed trail</div>
<div class="subSection">
<div style="text-transform: none;">Death animation:</div>
<select name="deathType" id="deathType" class="marginTop8"
onchange="PlayerAttributesHandler.chnageDeathType(event)">
<option value="none">None</option>
<option value="upwardsAndRotate" selected="selected">Upwards and rotate</option>
<option value="explode">Explode</option>
</select>
</div>
</details>
</div>
</div>
</div>
</div>
</div>
<div class="section" style="display: none;" id="soundView">
<div class="soundSection">
<h2 class="sectionHeading">Sounds</h2>
<div class="sectionContent" id="soundContent"></div>
</div>
<div class="soundSection">
<h2 class="sectionHeading">Music</h2>
<div class="sectionContent" id="musicContent"></div>
</div>
</div>
<div id="protipSection" class="sectionContent">
<b>ProTip: </b><span id="proTip"></span>
<img src="images/icons/longArrowRight.svg" class="hoverableGreySvg" alt="discord" width="16" height="16"
style="vertical-align: bottom;" onclick="ProTipHandler.nextTip()">
</div>
<div class='modal' id='deleteLevelModal'>
<div class="headerWrapper">
<div class="tooltipHeading">Delete level</div>
</div>
<div class="marginTop8">Are you sure?</div>
<div class="marginTop8">
<button class="levelNavigationButton halfWidth" type="submit"
onclick="LevelNavigationHandler.deleteLevel();">Yes</button>
<button class="levelNavigationButton halfWidth secondaryButton"
onclick="event.preventDefault(); ModalHandler.closeModal('deleteLevelModal');">No</button>
</div>
</div>
<div class='modal' id='pasteLevelModal'>
<div class="headerWrapper">
<div class="tooltipHeading">Paste level</div>
</div>
<div class="marginTop8" style="text-wrap: wrap">
Are you sure?
<br /><br />
This will replace all objects from your current level with data from level
<span id="pasteLevelIndex">1</span>
</div>
<div class="marginTop12 subSection">
<button class="levelNavigationButton halfWidth" type="submit"
onclick="LevelNavigationHandler.pasteLevel(event);">Yes</button>
<button class="levelNavigationButton halfWidth secondaryButton"
onclick="event.preventDefault(); ModalHandler.closeModal('pasteLevelModal');">No</button>
</div>
</div>
<div class='modal' id='worldColorModal'>
<div class="headerWrapper">
<div class="tooltipHeading">Change world appearance</div>
</div>
<div id="worldColorModalColorSection">
<div style="display: flex;">
<button class="levelNavigationButton buttonWithIconAndText colorTabButton active"
id="colorModalColorsSectionButton"
onclick="TabNavigation.changeColorModalSectionVisibility(event, 'colorModalColorsSection')">Color</button>
<button class="levelNavigationButton buttonWithIconAndText colorTabButton"
id="colorModalTransitionSectionButton"
onclick="TabNavigation.changeColorModalSectionVisibility(event, 'colorModalTransitionSection')">Transitions</button>
<button class="levelNavigationButton buttonWithIconAndText colorTabButton"
id="colorModalEffectsSectionButton"
onclick="TabNavigation.changeColorModalSectionVisibility(event, 'colorModalEffectsSection')">Effects</button>
</div>
<div id="colorModalColorsSection" class="marginTop8 colorModalSection">
<div style="font-weight: bold;">General color settings</div>
<div class="marginTop12">
<span class="colorModalAttribute">Background-color:</span>
<button class="color-input-background buttonWithIconAndText">
Transparent
</button>
</div>
<div class="marginTop8">
<span class="colorModalAttribute">Text-color:</span>
<button class="color-input-text buttonWithIconAndText" value="#FFFFFF"
style="margin-left: 52px" />
</div>
<div class="subSection12Gap">
<div class="flexGap12">
<div style="margin: auto 0">Level background-color:</div>
<button class="color-input-level-background" value="transp" id="levelColorButton">
<img alt="plus" width="80" height="40" src="images/icons/transparentIcon.svg"
class="iconInButtonWithText">
</button>
<img id="deleteLevelColorButton" alt="delete" width="16" height="16"
src="images/icons/delete.svg" class="marginTop8 hovereableRedSvg" style="margin: auto 0"
onClick="WorldColorHandler.deleteLevelColor()">
</div>
</div>
</div>
<div class="marginTop8 colorModalSection" style="display: none;" id="colorModalTransitionSection">
<span class="colorModalAttribute">Level-transition:</span>
<select name="transitionType" id="transitionType"
onchange="TransitionAnimationHandler.changeAnimationType(event)">
<option value="none">None</option>
<option value="tiles" selected="selected">Fading tiles</option>
<option value="cutOutCircle">Cut out circle</option>
<option value="wholeScreen">Screen fade</option>
</select>
<div class="marginTop12 changeableAttributesWrapper">
<span class="colorModalAttribute">Transition-length:</span>
<input style="margin-right:12px" type="range" min="2" max="48" value="48" step="2"
class="slider" id="transitionDuration"
onchange="TransitionAnimationHandler.changeAnimationDuration(event)">
<span id="transitionDurationValue">48</span>
</div>
</div>
<div class="colorModalSection" id="colorModalEffectsSection" style="display: none">
<div id="existingEffects"></div>
<button id="addEffectButton" class="levelNavigationButton tertiaryButton marginTop8"
onclick="EffectsHandler.addEffectTemplate()">
Add<img alt="plus" width="14" height="14" src="images/icons/plus.svg"
class="iconInButtonWithText">
</button>
</div>
</div>
<div id="editingEffects"></div>
<div class="subSection" id="worldColorsSubmitButton">
<button class="levelNavigationButton fullWidth"
onclick="event.preventDefault(); ModalHandler.closeModal('worldColorModal');">Ok</button>
</div>
</div>
<div class='modal' id='deleteCustomSpriteConfirmation'>
<div class="headerWrapper">
<div class="tooltipHeading">Are you sure?</div>
</div>
<div class="normalText marginTop8 flexGap12">
<img src="images/icons/info.svg" alt="info" width="16" height="16">
<span>By deleting a custom sprite, all of it's instances in the game will be deleted as well.</span>
</div>
<div class="subSection">
<button class="levelNavigationButton halfWidth" onclick="event.preventDefault();
CustomSpriteHandler.deleteSpriteConfirmed();">Ok</button>
<button class="levelNavigationButton secondaryButton halfWidth"
onclick="event.preventDefault(); ModalHandler.closeModal('deleteCustomSpriteConfirmation');">Cancel</button>
</div>
</div>
<div class='modal' id='customSpriteModal'>
<div class="headerWrapper">
<div class="tooltipHeading">Create custom sprite</div>
</div>
<form onsubmit="CustomSpriteHandler.addSprite(event)">
<div class="marginTop12" style="text-transform: none;">
Copy behaviour of:
<select name="customSpriteSelector" id="customSpriteSelector" style="width: 59%;"
onkeydown="event.preventDefault();">
</select>
</div>
<div class="subSection">
<button class="levelNavigationButton halfWidth" type="submit">Ok</button>
<button class="levelNavigationButton secondaryButton halfWidth"
onclick="event.preventDefault(); ModalHandler.closeModal('customSpriteModal');">Cancel</button>
</div>
</form>
</div>
<div class='modal' id='levelSizeModal'>
<div class="headerWrapper">
<div class="tooltipHeading">Change level size</div>
</div>
<form class="marginTop16" onsubmit="LevelNavigationHandler.changeLevelSize(event)">
<div class="flexRows" style="padding-bottom: 8px">
<div style="flex: 1">
<label for="widthSize">Width <span class="secondaryText">(18-99)</span>:</label>
<input id="widthSize" required min="18" max="99" step="1" class="flexibleInput" type="number"
size="15" value="33" onchange="LevelSizeHandler.sizeChangedInUI()" />
</div>
<div style="flex: 1">
<label for="heightSize">Height <span class="secondaryText">(10-99)</span>:</label>
<input id="heightSize" required min="10" max="99" step="1" class="flexibleInput" type="number"
size="15" value="17" onchange="LevelSizeHandler.sizeChangedInUI()" />
</div>
<span style="padding: 10px 4px 0;" data-microtip-size="large" data-microtip-position="right"
aria-label="Be aware: if you make your level smaller than it is, all objects
outside the bounds will be deleted." data-microtip-position="top" role="tooltip"
class="marginTop8 smallTooltipIcon"><img src="images/icons/info.svg" alt="info" width="24"
height="24">
</span>
</div>
<div class="subSection">
<div>
<div style="display: inline-block;">
<div class="flexGap12" style="padding: 8px 0;">
<label for="speed">zoom factor</label>
<input type="range" min="1" max="2" value="1" name="speed" step="0.1" id="zoomFactor"
onchange="LevelSizeHandler.changeZoomHtmlValue(event)">
<span id="zoomFactorValue">1</span>
</div>
</div>
<span style="margin: 4px 4px 0; float: right" data-microtip-size="large"
data-microtip-position="right"
aria-label="If you make your level smaller than the default size, the zoom-factor will adapt automatically."
data-microtip-position="top" role="tooltip" class="marginTop8 smallTooltipIcon"><img
src="images/icons/info.svg" alt="info" width="24" height="24">
</span>
</div>
</div>
<div class="subSection">
<button class="levelNavigationButton halfWidth" type="submit">Ok</button>
<button class="levelNavigationButton secondaryButton halfWidth"
onclick="event.preventDefault(); ModalHandler.closeModal('levelSizeModal');">Cancel</button>
</div>
</form>
</div>
<div id="copyNotification" style="display: none;">
<img src="images/icons/checkmark.svg" id="checkmark" class="iconInButtonWithText" width="14" height="14"
style="margin-bottom: 3px;">
<span>Level <span id="copiedLevelIndex">1</span> copied</span>
</div>
<canvas id="noiseCanvas" width="900px" height="520px" style="display: none"></canvas>
<canvas id="sprites" width="200" height="2000"></canvas>
<script src="Game.js"></script>
<script src="BuildMode.js"></script>
<script src="Display.js"></script>
<script src="Camera.js"></script>
<script src="AnimationHelper.js"></script>
<script src="handlers/CustomSpriteHandler.js"></script>
<script src="utils/huebee.min.js"></script>
<script src="utils/FileSaver.js"></script>
<script src="Collision.js"></script>
<script src="CharacterCollision.js"></script>
<script src="handlers/WorldDataHandler.js"></script>
<script src="handlers/TileMapHandler.js"></script>
<script src="Controller.js"></script>
<script src="Player.js"></script>
<script src="PlayLoop/PlayMode.js"></script>
<script src="PlayLoop/WalkHandler.js"></script>
<script src="PlayLoop/FallHandler.js"></script>
<script src="PlayLoop/AlternativeActionHandler.js"></script>
<script src="PlayLoop/JumpHandler.js"></script>
<script src="objects/LevelObject.js"></script>
<script src="objects/InteractiveLevelObject.js"></script>
<script src="objects/Spike.js"></script>
<script src="objects/FinishFlag.js"></script>
<script src="objects/Checkpoint.js"></script>
<script src="objects/StartFlag.js"></script>
<script src="objects/Trampoline.js"></script>
<script src="objects/Npc.js"></script>
<script src="objects/ShootingObject.js"></script>
<script src="objects/Canon.js"></script>
<script src="objects/CanonBall.js"></script>
<script src="objects/LaserCanon.js"></script>
<script src="objects/Laser.js"></script>
<script src="objects/BarrelCannon.js"></script>
<script src="objects/Stomper.js"></script>
<script src="objects/ToggleMine.js"></script>
<script src="objects/RocketLauncher.js"></script>
<script src="objects/Rocket.js"></script>
<script src="objects/SwitchableBlock.js"></script>
<script src="objects/RedBlueSwitch.js"></script>
<script src="objects/RedBlock.js"></script>
<script src="objects/BlueBlock.js"></script>
<script src="objects/VioletBlock.js"></script>
<script src="objects/PinkBlock.js"></script>
<script src="objects/DisappearingBlock.js"></script>
<script src="objects/ConnectedDisappearingBlock.js"></script>
<script src="objects/Treadmill.js"></script>
<script src="objects/IceBlock.js"></script>
<script src="objects/DisappearingForegroundTile.js"></script>
<script src="objects/ForegroundTile.js"></script>
<script src="objects/Portal.js"></script>
<script src="objects/Collectible.js"></script>
<script src="objects/JumpReset.js"></script>
<script src="objects/FixedSpeedRight.js"></script>
<script src="objects/FixedSpeedStopper.js"></script>
<script src="objects/RotatingFireballCenter.js"></script>
<script src="objects/PowerUp.js"></script>
<script src="objects/Water.js"></script>
<script src="objects/Deko.js"></script>
<script src="objects/SFX.js"></script>
<script src="SpriteSheetCreator.js"></script>
<script src="utils/ObjectTypes.js"></script>
<script src="ImportExport.js"></script>
<script src="utils/SpritePixelArrays.js"></script>
<script src="handlers/LevelNavigationHandler.js"></script>
<script src="Sounds/Base64Sounds.js"></script>
<script src="images/icons/Base64Images.js"></script>
<script src="Sound.js"></script>
<script src="handlers/SoundHandler.js"></script>
<script src="handlers/EffectsHandler.js"></script>
<script src="EffectsRenderer.js"></script>
<script src="handlers/DialogueHandler.js"></script>
<script src="handlers/SFXHandler.js"></script>
<script src="TabNavigation.js"></script>
<script src="TabPagination.js"></script>
<script src="handlers/DrawSectionHandler.js"></script>
<script src="handlers/ProTipHandler.js"></script>
<script src="handlers/TooltipHandler.js"></script>
<script src="handlers/ModalHandler.js"></script>
<script src="handlers/LevelSizeHandler.js"></script>
<script src="handlers/PlayerAttributesHandler.js"></script>
<script src="handlers/PathBuildHandler.js"></script>
<script src="MathHelpers.js"></script>
<script src="DrawHelpers.js"></script>
<script src="objects/Path.js"></script>
<script src="objects/PathPoint.js"></script>
<script src="GameStatistics.js"></script>
<script src="handlers/WorldColorHandler.js"></script>
<script src="handlers/WorldColorChanger.js"></script>
<script src="handlers/PauseHandler.js"></script>
<script src="TilemapHelpers.js"></script>
<script src="HeaderNavigationHandler.js"></script>
<script src="TransitionAnimationHandler.js"></script>
<script src="ExportedGameInitializer.js"></script>
<script src="LegacyImporter.js"></script>
<script src="utils/helpers.js"></script>
<script src="htmlRenderers/ObjectsTooltipElementsRenderer.js"></script>
<script src="htmlRenderers/EffectHtmlRenderer.js"></script>
<script src="htmlRenderers/CustomSpritesElementsRenderer.js"></script>
<script src="htmlRenderers/SoundHandlerRenderer.js"></script>
<link rel="stylesheet" type="text/css" href="styles/gameScreen.css">
<link rel="stylesheet" type="text/css" href="styles/buildMenu.css">
<link rel="stylesheet" type="text/css" href="styles/drawSection.css">
<link rel="stylesheet" type="text/css" href="styles/tooltip.css">
<link rel="stylesheet" type="text/css" href="styles/modal.css">
<link rel="stylesheet" type="text/css" href="styles/huebee.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=DotGothic16">
<script>
//startRemoval
WorldDataHandler.insideTool = true;
//endRemoval
const canvas = document.getElementById("myCanvas");
const tileCanvas = document.getElementById("tileCanvas");
WorldDataHandler.staticConstructor();
const spriteCanvas = document.getElementById("sprites");
SoundHandler.staticConstructor();
AnimationHelper.staticConstructor();
SpritePixelArrays.staticConstructor();
const player = new Player(WorldDataHandler.initialPlayerPosition.x,
WorldDataHandler.initialPlayerPosition.y, WorldDataHandler.tileSize, spriteCanvas);
Game.staticConstructor();
TransitionAnimationHandler.staticConstructor();
let startLevel = 0;
//putAllDataHere
if (WorldDataHandler.insideTool) {
startLevel = 1;
}
else {
ExportedGameInitializer.initializeExportedGame(allData);
}
const canvasSize = WorldDataHandler.calucalteCanvasSize();
canvas.width = canvasSize.width;
canvas.height = canvasSize.height;
tileCanvas.width = canvasSize.width;
tileCanvas.height = canvasSize.height;
const canvasWidth = canvasSize.width;
const canvasHeight = canvasSize.height;
canvas.style.backgroundColor = WorldDataHandler.backgroundColor;
var canvasOffsetLeft = canvas.offsetLeft;
var canvasOffsetTop = canvas.offsetTop;
const ctx = canvas.getContext("2d");
const tileCtx = tileCanvas.getContext("2d");
Camera.staticConstructor(ctx, canvasWidth, canvasHeight, WorldDataHandler.levels[startLevel].tileData[0].length * WorldDataHandler.tileSize,
WorldDataHandler.levels[startLevel].tileData.length * WorldDataHandler.tileSize);
EffectsHandler.staticConstructor();
let tileMapHandler = new TileMapHandler(WorldDataHandler.tileSize, startLevel, spriteCanvas, player);
DialogueHandler.staticConstructor(tileMapHandler, spriteCanvas);
Display.staticConstructor(ctx, canvasWidth, canvasHeight, tileCtx);
Controller.staticConstructor();
Collision.staticConstructor(tileMapHandler);
const spriteSheetCreator = new SpriteSheetCreator(tileMapHandler, spriteCanvas);
CharacterCollision.staticConstructor(tileMapHandler);
PlayMode.staticConstructor(player, tileMapHandler);
SFXHandler.staticConstructor(tileMapHandler.tileSize, spriteCanvas);
GameStatistics.staticConstructor();
PauseHandler.staticConstructor();
EffectsRenderer.staticConstructor(tileMapHandler);
tileMapHandler.resetLevel(startLevel)
//startRemoval
BuildMode.staticConstructor(tileMapHandler, player);
PathBuildHandler.staticConstructor(tileMapHandler);
LevelNavigationHandler.staticConstructor();
WorldColorHandler.staticConstructor();
DrawSectionHandler.staticConstructor(tileMapHandler);
TabPagination.staticConstructor();
TabNavigation.staticConstructor(spriteCanvas);
ProTipHandler.staticConstructor();
TooltipHandler.staticConstructor();
LevelSizeHandler.staticConstructor(tileMapHandler);
PlayerAttributesHandler.staticConstructor(player);
CustomSpriteHandler.staticConstructor();
canvas.addEventListener("mouseenter", (e) => { Controller.mouseEnter(e) });
canvas.addEventListener("mouseleave", (e) => { Controller.mouseLeave(e) });
function build() {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
Camera.begin();
tileMapHandler.drawGrid();
tileMapHandler.displayLevel();
if (tileMapHandler.currentLevel === 0) {
PlayMode.runStartScreenLogic();
Display.displayStartScreen(tileMapHandler.currentGeneralFrameCounter, tileMapHandler.generalFrameCounterMax);
}
else if (tileMapHandler.currentLevel === WorldDataHandler.levels.length - 1) {
player.x = 0;
player.y = 0;
Display.displayEndingScreen(spriteCanvas, tileMapHandler.currentGeneralFrameCounter, tileMapHandler.generalFrameCounterMax);
}
else {
player.draw();
}
//foreground objects
tileMapHandler.displayObjects(tileMapHandler.layers[4]);
DrawSectionHandler.draw();
BuildMode.runBuildLogic();
SFXHandler.updateSfxAnimations();
Camera.end();
if (Game.playMode === Game.BUILD_MODE) {
window.requestAnimationFrame(build);
}
}
//endRemoval
function play(timestamp) {
Game.updateFPSInterval(timestamp);
// if enough time has elapsed, draw the next frame
if (!Game.refreshRateHigher60 || Game.elapsed > Game.fpsInterval) {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
Camera.begin();
tileMapHandler.displayLevel();
Controller.handleGamepadInput();
if (tileMapHandler.currentLevel === 0) {
PlayMode.runStartScreenLogic();
Display.displayStartScreen(tileMapHandler.currentGeneralFrameCounter, tileMapHandler.generalFrameCounterMax);
EffectsRenderer.displayEffects(1);
}
else if (tileMapHandler.currentLevel === WorldDataHandler.levels.length - 1) {
Display.displayEndingScreen(spriteCanvas, tileMapHandler.currentGeneralFrameCounter, tileMapHandler.generalFrameCounterMax);
EffectsRenderer.displayEffects(1);
}
else {
PlayMode.runPlayLogic();
SFXHandler.updateSfxAnimations();
player.draw();
//foreground objects
tileMapHandler.displayObjects(tileMapHandler.layers[4]);
EffectsRenderer.displayEffects(1);
DialogueHandler.handleDialogue();
PlayMode.pauseFramesHandler();
EffectsRenderer.displayEffects(2);
Camera.followObject(player.x, player.y);
}
//startRemoval
DrawSectionHandler.draw();
//endRemoval
Camera.end();
Game.resetFpsInterval();
}
if (Game.playMode === Game.PLAY_MODE) {
window.requestAnimationFrame(play);
}
}
function loading() {
let loadedAssets = 0;
SoundHandler.sounds.forEach(soundRawData => {
const sound = SoundHandler[soundRawData.key];
if (sound.loaded || sound.errorWhileLoading) {
loadedAssets++;
}
})
if (loadedAssets === SoundHandler.sounds.length) {
Game.startAnimating(60);
WorldDataHandler.insideTool ? Game.changeGameMode(true) : Game.executeGameMode();
}
else {
ctx.clearRect(0, 0, canvasWidth, canvasHeight);
Display.displayLoadingScreen(loadedAssets, SoundHandler.sounds.length);
window.requestAnimationFrame(loading);
}
}
window.requestAnimationFrame(loading);
</script>
</body>
</html>