-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKHR.java
More file actions
3085 lines (2882 loc) · 146 KB
/
KHR.java
File metadata and controls
3085 lines (2882 loc) · 146 KB
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
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//Imported for using images
import java.awt.*;
//Imported for using events such as Mouse, Key and Action Listener
import java.awt.event.*;
//Imported in order to use double buffering
import java.awt.Graphics;
//Imported in order to use array lists
import java.util.ArrayList;
//Imported in ordder to use text and audio files
import java.io.*;
//Imported in order to get audio in our algorythm
import sun.audio.*;
import javax.swing.*;
public class KHR extends Frame implements ActionListener, MouseListener, Runnable, KeyListener{
//To record what state the game is in
/* 0 = opening screen
* 1 = Main Menu
* 2 = Custom LEvel selection
* 3 = New/Load game
* 4 = difficulty Selection
* 5 = Character Selection
* 6 = Name Entering
* 7 = In game
* 8 = Level Creator
* 9 = User Selection
* 10 = Round Finished
* 11 = level up screen
* 12 = KO/Death Screen
* 13 = Pause Screen
* 14 = ending screen
* 15 = instructions
* 16 = Credits
*/
int state = 1;
boolean isRemovinglstHit = false, isRunning = false, isPainting = false, isPaused = false;
//The time for how much the thread will delay before runnning the next frame
long threadSleepTime = 15;
long threadSleepTimer = System.currentTimeMillis() + threadSleepTime;
Button slow = new Button("Slow"), moderate = new Button("Moderate"), fast = new Button("Fast");
String buttonClickName = "ButtonClick.wav";
String errorButtonClickName = "ErrorButton.wav";
//An array list which will hold an enemy of each type
ArrayList<Character> charsStore;
//Arraylist to store the ally characters
ArrayList<Character> hijk = new ArrayList<Character>();
//Items used in the double bufferring
Image dbi;
Graphics dbg;
//A seperate thread for the program to run in
Thread animeThread;
//Toolkit to use images
Toolkit tk = Toolkit.getDefaultToolkit();
//The constant occuring background in our program. This changes every state
Image background = tk.createImage("CelestialRed.jpg");
//The array containing the backgrounds for the ui
Image[] backgroundsArray = new Image[6];
//The background which will be drawn in the UI
Image UIBackground = tk.createImage("UI background.jpg");
//The ArrayList for all the current characters on screen
ArrayList<Character> chars = new ArrayList<Character>();
//setting the button pressing keys to an array of integers
ArrayList<Integer> keysUp, keysDown;
//initialise Objects
LevelAndUser lvl = new LevelAndUser(1344, 720, "Custom Level Users.txt", "Main Level Users.txt");
Menus m = new Menus(1344, 720);
LevelCreator lvlc;
LevelSelection ls;
CharacterSelection cs;
UserSelection us;
RoundFinish rf;
LevelUpScreen lus;
KOScreen kos;
PauseScreen ps;
SpecialisedSound ss = new SpecialisedSound();
SlideShow instructions;
SlideShow credits;
String battleMusic = "Ants.wav";
//Boolean to pause in the first few seconds before tarting the game
boolean pause = true;
//Boolean to see if sound may be played or not
boolean canPlaySound = true;
boolean canPlaySFX = true;
Button btnCanPlaySound = new Button("Music:");
Label lblCanPlaySound = new Label("On");
Button btnCanPlaySFX = new Button("SFX:");
Label lblCanPlaySFX = new Label("On");
//Static Character variables
Image pdamagedImage = tk.createImage("DamageStars.gif");
//Sora stats
//Movement images
Image SorapupMove = tk.createImage("SoraUpMove.gif"); Image SorapdownMove = tk.createImage("SoraDownMove.gif"); Image SoraprightMove = tk.createImage("SoraRightMove.gif"); Image SorapleftMove = tk.createImage("SoraLeftMove.gif");
Image SorapupLeftMove = tk.createImage("SoraUpLeftMove.gif"); Image SorapupRightMove = tk.createImage("SoraUpRightMove.gif"); Image SorapdownLeftMove = tk.createImage("SoraDownLeftMove.gif"); Image SorapdownRightMove = tk.createImage("SoraDownRightMove.gif");
//Attacking images
Image SorapupAttack = tk.createImage("SoraUpAttack1.gif"); Image SorapdownAttack = tk.createImage("SoraDownAttack1.gif"); Image SorapleftAttack = tk.createImage("SoraLeftAttack1.gif"); Image SoraprightAttack = tk.createImage("SoraRightAttack1.gif");
Image SorapupLeftAttack = tk.createImage("SoraUpLeftAttack1.gif"); Image SorapupRightAttack = tk.createImage("SoraUpRightAttack1.gif"); Image SorapdownLeftAttack = tk.createImage("SoraDownLeftAttack1.gif"); Image SorapdownRightAttack = tk.createImage("SoraDownRightAttack1.gif");
//Still images
Image SorapupStill = tk.createImage("SoraUpStill.png"); Image SorapdownStill = tk.createImage("SoraDownStill.png"); Image SoraprightStill = tk.createImage("SoraRightStill.png"); Image SorapleftStill = tk.createImage("SoraLeftStill.png");
Image SorapupLeftStill = tk.createImage("SoraUpLeftStill.png"); Image SorapupRightStill = tk.createImage("SoraUpRightStill.png"); Image SorapdownLeftStill = tk.createImage("SoraDownLeftStill.png"); Image SorapdownRightStill = tk.createImage("SoraDownRightStill.png");
//Ability Images
Image Sorapability1Left = tk.createImage("SoraLeftThrowKeyblade.gif"); Image Sorapability1Right = tk.createImage("SoraRightThrowKeyblade.gif"); Image Sorapability2Left = tk.createImage("SoraWindLeft.gif"); Image Sorapability2Right = tk.createImage("SoraWindRight.gif");
//Knocked out image
Image SorapkoImage = tk.createImage("SoraKO.gif");
//A full 3D image used to show the character
Image SorapbaseImage = tk.createImage("Sora.png");
//Length and height of rectangle bounds
int SorasideWidth = 30; int SoramidWidth = 25;
int SorasideHeight = 24; int SoramidHeight = 45;
//bullet radius
int SorapbulletRadius = 25; int SorapmyBulletSpeed = 12;
//bullet Image
Image SorapbulletImage = tk.createImage("RotatingKeyblade.gif");
//Timers to display animations
long SoraphittingAnimation = 400; long Sorapability1AnimationTimer = 300; long Sorapability2AnimationTimer = 300;
//Ability cooldown timers
long SorapabilityCooldown1 = 6000; long SorapabilityCooldown2 = 12000;
//Character stats
int SorapmaxHP = 200; int SorapbaseSpeed = 4; int Soraplevel = 1; int SorapbaseDamage = 30; int SorapmaxToHitTime = 1200;
//Images for UI
Image SorapHealthy = tk.createImage("SoraHealthy.png"); Image SorapHurt = tk.createImage("SoraHurt.png");
//Images for the ability icons
Image SorapabilityImage1 = tk.createImage("KeybladeIcon.jpg"); Image SorapabilityImage2 = tk.createImage("WindIcon.jpg");
//Images for this class
Image SorapleftAttack2 = tk.createImage("SoraLeftAttack2.gif"); Image SorapleftAttack3 = tk.createImage("SoraLeftAttack3.gif"); Image SoraprightAttack2 = tk.createImage("SoraRightAttack2.gif"); Image SoraprightAttack3 = tk.createImage("SoraRightAttack3.gif");
//Specific sprites
Image SorapimageWind = tk.createImage("Wind.gif");
Sprite Sorapwind;
//Timer for wind
long SorapwindDuration = 5000;
//Riku stats
//Movement images
Image RikupupMove = tk.createImage("RikuUpMove.gif"); Image RikupdownMove = tk.createImage("RikuDownMove.gif"); Image RikuprightMove = tk.createImage("RikuRightMove.gif"); Image RikupleftMove = tk.createImage("RikuLeftMove.gif");
Image RikupupLeftMove = tk.createImage("RikuUpLeftMove.gif"); Image RikupupRightMove = tk.createImage("RikuUpRightMove.gif"); Image RikupdownLeftMove = tk.createImage("RikuDownLeftMove.gif"); Image RikupdownRightMove = tk.createImage("RikuDownRightMove.gif");
//Attacking images
Image RikupupAttack = tk.createImage("RikuUpLeftAttack.gif"); Image RikupdownAttack = tk.createImage("RikuDownLeftAttack.gif"); Image RikupleftAttack = tk.createImage("RikuUpLeftAttack.gif"); Image RikuprightAttack = tk.createImage("RikuDownRightAttack.gif");
Image RikupupLeftAttack = tk.createImage("RikuUpLeftAttack.gif"); Image RikupupRightAttack = tk.createImage("RikuUpRightAttack.gif"); Image RikupdownLeftAttack = tk.createImage("RikuDownLeftAttack.gif"); Image RikupdownRightAttack = tk.createImage("RikuDownRightAttack.gif");
//Still images
Image RikupupStill = tk.createImage("RikuUpStill.png"); Image RikupdownStill = tk.createImage("RikuDownStill.png"); Image RikuprightStill = tk.createImage("RikuRightStill.png"); Image RikupleftStill = tk.createImage("RikuLeftStill.png");
Image RikupupLeftStill = tk.createImage("RikuUpLeftStill.png"); Image RikupupRightStill = tk.createImage("RikuUpRightStill.png"); Image RikupdownLeftStill = tk.createImage("RikuDownLeftStill.png"); Image RikupdownRightStill = tk.createImage("RikuDownRightStill.png");
//Ability Images
Image Rikupability1Left = null; Image Rikupability1Right = null; Image Rikupability2Left = tk.createImage("RikuDarkAuraLeft.gif"); Image Rikupability2Right = tk.createImage("RikuDarkAuraRight.gif");
//Knocked out image
Image RikupkoImage = tk.createImage("RikuKO.gif");
//A full 3D image used to show the character
Image RikupbaseImage = tk.createImage("Riku.png");
//Length and height of rectangle bounds
int RikusideWidth = 23; int RikumidWidth = 28;
int RikusideHeight = 30; int RikumidHeight = 55;
//bullet radius
int RikupbulletRadius = 15; int RikupmyBulletSpeed = 15;
//bullet Image
Image RikupbulletImage = tk.createImage("DarkAuraBullet.png");
//Timers to display animations
long RikuphittingAnimation = 400; long Rikupability1AnimationTimer = 200; long Rikupability2AnimationTimer = 200;
//Ability cooldown timers
long RikupabilityCooldown1 = 3500; long RikupabilityCooldown2 = 5750;
//Character stats
int RikupmaxHP = 200; int RikupbaseSpeed = 4; int Rikuplevel = 1; int RikupbaseDamage = 40; int RikupmaxToHitTime = 1200;
//Images for UI
Image RikupHealthy = tk.createImage("RikuHealthy.png"); Image RikupHurt = tk.createImage("RikuHurt.png");
//Images for the ability icons
Image RikupabilityImage1 = tk.createImage("DarknessCorridorIcon.jpg"); Image RikupabilityImage2 = tk.createImage("DarkAuraIcon.jpg");
//Specific Images
Image RikupteleportImage = tk.createImage("Teleport.gif");
//number of bullets for ability
int RikupbulletAmount = 5;
//Variables for Shadow Heartless
//Movement images
Image SHpupMove = tk.createImage("HeartlessUpLeftMove.gif"); Image SHpdownMove = tk.createImage("HeartlessDownRightMove.gif"); Image SHprightMove = tk.createImage("HeartlessUpRightMove.gif"); Image SHpleftMove = tk.createImage("HeartlessDownLeftMove.gif");
Image SHpupLeftMove = tk.createImage("HeartlessUpLeftMove.gif"); Image SHpupRightMove = tk.createImage("HeartlessUpRightMove.gif"); Image SHpdownLeftMove = tk.createImage("HeartlessDownLeftMove.gif"); Image SHpdownRightMove = tk.createImage("HeartlessDownRightMove.gif");
//Attacking images
Image SHpupAttack = tk.createImage("HeartlessLeftAttack.gif"); Image SHpdownAttack = tk.createImage("HeartlessRightAttack.gif"); Image SHpleftAttack = tk.createImage("HeartlessLeftAttack.gif"); Image SHprightAttack = tk.createImage("HeartlessRightAttack.gif");
Image SHpupLeftAttack = tk.createImage("HeartlessLeftAttack.gif"); Image SHpupRightAttack = tk.createImage("HeartlessRightAttack.gif"); Image SHpdownLeftAttack = tk.createImage("HeartlessLeftAttack.gif"); Image SHpdownRightAttack = tk.createImage("HeartlessRightAttack.gif");
//Still images
Image SHpupStill = tk.createImage("HeartlessUpLeftMove.gif"); Image SHpdownStill = tk.createImage("HeartlessDownRightMove.gif"); Image SHprightStill = tk.createImage("HeartlessUpRightMove.gif"); Image SHpleftStill = tk.createImage("HeartlessDownLeftMove.gif");
Image SHpupLeftStill = tk.createImage("HeartlessUpLeftMove.gif"); Image SHpupRightStill = tk.createImage("HeartlessUpRightMove.gif"); Image SHpdownLeftStill = tk.createImage("HeartlessDownLeftMove.gif"); Image SHpdownRightStill = tk.createImage("HeartlessDownRightMove.gif");
//Ability Images
Image SHpability1Left = tk.createImage("HeartlessLeftSlide.png"); Image SHpability1Right = tk.createImage("HeartlessRightSlide.png"); Image SHpability2Left = null; Image SHpability2Right = null;
//Knocked out image
Image SHpkoImage = tk.createImage("HeartlessKO.gif");
//A full 3D image used to show the character
Image SHpbaseImage = tk.createImage("Shadow Heartless.png");
//Length and height of rectangle bounds
int SHsideWidth = 1; int SHmidWidth = 76;
int SHsideHeight = 55; int SHmidHeight = 60;
//bullet radius
int SHpbulletRadius = 0; int SHpmyBulletSpeed = 0;
//bullet Image
Image SHpbulletImage = null;
//Timers to display animations
//Timer 2 is the duratio of the invulnerability
long SHphittingAnimation = 402; long SHpability1AnimationTimer = 600; long SHpability2AnimationTimer = 3500;
//Images for UI
Image SHpHealthy = tk.createImage("ShadowHeartlessHealthy.png"); Image SHpHurt = tk.createImage("ShadowHeartlessHurt.png");
//Images for the ability icons
Image SHpabilityImage1 = tk.createImage("FlyingKickIcon.jpg"); Image SHpabilityImage2 = tk.createImage("PuddleIcon.jpg");
//Ability cooldown timers
long SHpabilityCooldown1 = 3500; long SHpabilityCooldown2 = 11000;
//Character stats
int SHpmaxHP = 200; int SHpbaseSpeed = 4; int SHplevel = 1; int SHpbaseDamage = 35; int SHpmaxToHitTime = 1200;
//Images for this class
Image SHpinvUpLeftMove = tk.createImage("HeartlessUpLeftSink.gif"); Image SHpinvUpRightMove = tk.createImage("HeartlessUpRightSink.gif"); Image SHpinvDownLeftMove = tk.createImage("HeartlessDownLeftSink.gif"); Image SHpinvDownRightMove = tk.createImage("HeartlessDownRightSink.gif");
//Variables for Cloud
//Movement images
Image CloudpupMove = tk.createImage("CloudLeftMove.gif"); Image CloudpdownMove = tk.createImage("CloudRightMove.gif"); Image CloudprightMove = tk.createImage("CloudRightMove.gif"); Image CloudpleftMove = tk.createImage("CloudLeftMove.gif");
Image CloudpupLeftMove = tk.createImage("CloudLeftMove.gif"); Image CloudpupRightMove = tk.createImage("CloudRightMove.gif"); Image CloudpdownLeftMove = tk.createImage("CloudLeftMove.gif"); Image CloudpdownRightMove = tk.createImage("CloudRightMove.gif");
//Attacking images
Image CloudpupAttack = tk.createImage("CloudAttack1Left.gif"); Image CloudpdownAttack = tk.createImage("CloudAttack1Right.gif"); Image CloudpleftAttack = tk.createImage("CloudAttack1Left.gif"); Image CloudprightAttack = tk.createImage("CloudAttack1Right.gif");
Image CloudpupLeftAttack = tk.createImage("CloudAttack1Left.gif"); Image CloudpupRightAttack = tk.createImage("CloudAttack1Right.gif"); Image CloudpdownLeftAttack = tk.createImage("CloudAttack1Left.gif"); Image CloudpdownRightAttack = tk.createImage("CloudAttack1Right.gif");
//Still images
Image CloudpupStill = tk.createImage("CloudLeftMove.gif"); Image CloudpdownStill = tk.createImage("CloudRightMove.gif"); Image CloudprightStill = tk.createImage("CloudRightMove.gif"); Image CloudpleftStill = tk.createImage("CloudLeftMove.gif");
Image CloudpupLeftStill = tk.createImage("CloudLeftMove.gif"); Image CloudpupRightStill = tk.createImage("CloudRightMove.gif"); Image CloudpdownLeftStill = tk.createImage("CloudLeftMove.gif"); Image CloudpdownRightStill = tk.createImage("CloudRightMove.gif");
//Ability Images
Image Cloudpability1Left = tk.createImage("GreenBoostAnimation.gif"); Image Cloudpability1Right = tk.createImage("GreenBoostAnimation.gif"); Image Cloudpability2Left = tk.createImage("RedBoostAnimation.gif"); Image Cloudpability2Right = tk.createImage("RedBoostAnimation.gif");
//Knocked out image
Image CloudpkoImage = tk.createImage("CloudKO.gif");
//A full 3D image used to show the character
Image CloudpbaseImage = tk.createImage("Cloud Strife.png");
//Length and height of rectangle bounds
int CloudsideWidth = 30; int CloudmidWidth = 70;
int CloudsideHeight = 30; int CloudmidHeight = 40;
//bullet radius
int CloudpbulletRadius = 0; int CloudpmyBulletSpeed = 0;
//bullet Image
Image CloudpbulletImage = null;
//Timers to display animations
long CloudphittingAnimation = 360; long Cloudpability1AnimationTimer = 0; long Cloudpability2AnimationTimer = 0;
//Ability cooldown timers
long CloudpabilityCooldown1 = 12000; long CloudpabilityCooldown2 = 15000;
//Character stats
int CloudpmaxHP = 200; int CloudpbaseSpeed = 3; int Cloudplevel = 1; int CloudpbaseDamage = 35; int CloudpmaxToHitTime = 1200;
//Images for UI
Image CloudpHealthy = tk.createImage("CloudHealthy.png"); Image CloudpHurt = tk.createImage("CloudHurt.png");
//Images for the ability icons
Image CloudpabilityImage1 = tk.createImage("GreenRocketIcon.png"); Image CloudpabilityImage2 = tk.createImage("MusclesIcon.jpg");
//Images for 2nd and 3rd attack
Image CloudprightAttack2 = tk.createImage("CloudAttack2Right.gif"), CloudpleftAttack2 = tk.createImage("CloudAttack2Left.gif"), CloudprightAttack3 = tk.createImage("CloudAttack3Right.gif"), CloudpleftAttack3 = tk.createImage("CloudAttack3Left.gif");
//Duration for abilities
long CloudpabilityDuration1 = 4500, CloudpabilityDuration2 = 4500;
//Variables for Donald
//Movement images
Image DonaldpupMove = tk.createImage("DonaldUpLeftMove.gif"); Image DonaldpdownMove = tk.createImage("DonaldDownRightMove.gif"); Image DonaldprightMove = tk.createImage("DonaldUpRightMove.gif"); Image DonaldpleftMove = tk.createImage("DonaldDownLeftMove.gif");
Image DonaldpupLeftMove = tk.createImage("DonaldUpLeftMove.gif"); Image DonaldpupRightMove = tk.createImage("DonaldUpRightMove.gif"); Image DonaldpdownLeftMove = tk.createImage("DonaldDownLeftMove.gif"); Image DonaldpdownRightMove = tk.createImage("DonaldDownRightMove.gif");
//Attacking images
Image DonaldpupAttack = tk.createImage("DonaldAttackLeft.gif"); Image DonaldpdownAttack = tk.createImage("DonaldAttackRight.gif"); Image DonaldpleftAttack = tk.createImage("DonaldAttackLeft.gif"); Image DonaldprightAttack = tk.createImage("DonaldAttackRight.gif");
Image DonaldpupLeftAttack = tk.createImage("DonaldAttackLeft.gif"); Image DonaldpupRightAttack = tk.createImage("DonaldAttackRight.gif"); Image DonaldpdownLeftAttack = tk.createImage("DonaldAttackLeft.gif"); Image DonaldpdownRightAttack = tk.createImage("DonaldAttackRight.gif");
//Still images
Image DonaldpupStill = tk.createImage("DonaldUpLeftStill.png"); Image DonaldpdownStill = tk.createImage("DonaldDownRightStill.png"); Image DonaldprightStill = tk.createImage("DonaldUpRightStill.png"); Image DonaldpleftStill = tk.createImage("DonaldDownLeftStill.png");
Image DonaldpupLeftStill = tk.createImage("DonaldUpLeftStill.png"); Image DonaldpupRightStill = tk.createImage("DonaldUpRightStill.png"); Image DonaldpdownLeftStill = tk.createImage("DonaldDownLeftStill.png"); Image DonaldpdownRightStill = tk.createImage("DonaldDownRightStill.png");
//Ability Images
Image Donaldpability1Left = tk.createImage("DonaldThunderLeft.gif"); Image Donaldpability1Right = tk.createImage("DonaldThunderRight.gif"); Image Donaldpability2Left = tk.createImage("DonaldThunderLeft.gif"); Image Donaldpability2Right = tk.createImage("DonaldThunderRight.gif");
//Knocked out image
Image DonaldpkoImage = tk.createImage("DonaldKO.gif");
//A full 3D image used to show the character
Image DonaldpbaseImage = tk.createImage("Donald.png");
//Length and height of rectangle bounds
int DonaldsideWidth = 34; int DonaldmidWidth = 26;
int DonaldsideHeight = 17; int DonaldmidHeight = 45;
//bullet radius
int DonaldpbulletRadius = 0; int DonaldpmyBulletSpeed = 0;
//bullet Image
Image DonaldpbulletImage = null;
//Timers to display animations
long DonaldphittingAnimation = 400; long Donaldpability1AnimationTimer = 400; long Donaldpability2AnimationTimer = 400;
//Ability cooldown timers
long DonaldpabilityCooldown1 = 4500; long DonaldpabilityCooldown2 = 10000;
//Character stats
int DonaldpmaxHP = 150; int DonaldpbaseSpeed = 4; int Donaldplevel = 1; int DonaldpbaseDamage = 38; int DonaldpmaxToHitTime = 1200;
//Images for UI
Image DonaldpHealthy = tk.createImage("DonaldHealthy.png"); Image DonaldpHurt = tk.createImage("DonaldHurt.png");
//Images for the ability icons
Image DonaldpabilityImage1 = tk.createImage("LeafIcon.jpg"); Image DonaldpabilityImage2 = tk.createImage("LightningBoltIcon.jpg");
//Thunder and heal animation images
Image DonaldpthunderImage = tk.createImage("Thunder.gif"), DonaldphealImage = tk.createImage("Heal.gif");
int DonaldpthunderWidth = 135; int DonaldpThunderHeight = 156; int DonaldpthunderLength = 60;
//The duration for the thunder image animation
long DonaldpthunderDuration = 240;
//The durations for the heal image animation
long DonaldphealDuration = 1500;
//The amount of times damage is multiplied to heal
int DonaldphealToDamage = 1;
//Variables for Goofy
//Movement images
Image GoofypupMove = tk.createImage("GoofyUpLeftMove.gif"); Image GoofypdownMove = tk.createImage("GoofyDownRightMove.gif"); Image GoofyprightMove = tk.createImage("GoofyUpRightMove.gif"); Image GoofypleftMove = tk.createImage("GoofyDownLeftMove.gif");
Image GoofypupLeftMove = tk.createImage("GoofyUpLeftMove.gif"); Image GoofypupRightMove = tk.createImage("GoofyUpRightMove.gif"); Image GoofypdownLeftMove = tk.createImage("GoofyDownLeftMove.gif"); Image GoofypdownRightMove = tk.createImage("GoofyDownRightMove.gif");
//Attacking images
Image GoofypupAttack = tk.createImage("GoofyLeftSpin.gif"); Image GoofypdownAttack = tk.createImage("GoofyRightSpin.gif"); Image GoofypleftAttack = tk.createImage("GoofyLeftSpin.gif"); Image GoofyprightAttack = tk.createImage("GoofyRightSpin.gif");
Image GoofypupLeftAttack = tk.createImage("GoofyLeftSpin.gif"); Image GoofypupRightAttack = tk.createImage("GoofyRightSpin.gif"); Image GoofypdownLeftAttack = tk.createImage("GoofyLeftSpin.gif"); Image GoofypdownRightAttack = tk.createImage("GoofyRightSpin.gif");
//Still images
Image GoofypupStill = tk.createImage("GoofyUpLeftStill.png"); Image GoofypdownStill = tk.createImage("GoofyDownRightStill.png"); Image GoofyprightStill = tk.createImage("GoofyUpRightStill.png"); Image GoofypleftStill = tk.createImage("GoofyDownLeftStill.png");
Image GoofypupLeftStill = tk.createImage("GoofyUpLeftStill.png"); Image GoofypupRightStill = tk.createImage("GoofyUpRightStill.png"); Image GoofypdownLeftStill = tk.createImage("GoofyDownLeftStill.png"); Image GoofypdownRightStill = tk.createImage("GoofyDownRightStill.png");
//Ability Images
Image Goofypability1Left = tk.createImage("GoofySpin.gif"); Image Goofypability1Right = tk.createImage("GoofySpin.gif"); Image Goofypability2Left = tk.createImage("GoofyThrowShieldLeft.gif"); Image Goofypability2Right = tk.createImage("GoofyThrowShieldRight.gif");
//Knocked out image
Image GoofypkoImage = tk.createImage("GoofyKO.gif");
//A full 3D image used to show the character
Image GoofypbaseImage = tk.createImage("Goofy.png");
//Length and height of rectangle bounds
int GoofysideWidth = 28; int GoofymidWidth = 30;
int GoofysideHeight = 1; int GoofymidHeight = 63;
//bullet radius
int GoofypbulletRadius = 25; int GoofypmyBulletSpeed = 15;
//bullet Image
Image GoofypbulletImage = tk.createImage("GoofyShield.gif");
//Timers to display animations
//timer 1 is the duration of the spin move
long GoofyphittingAnimation = 396; long Goofypability1AnimationTimer = 5000; long Goofypability2AnimationTimer = 400;
//Ability cooldown timers
long GoofypabilityCooldown1 = 11500; long GoofypabilityCooldown2 = 5000;
//Character stats
int GoofypmaxHP = 270; int GoofypbaseSpeed = 4; int Goofyplevel = 1; int GoofypbaseDamage = 40; int GoofypmaxToHitTime = 1200;
//Images for UI
Image GoofypHealthy = tk.createImage("GoofyHealthy.png"); Image GoofypHurt = tk.createImage("GoofyHurt.png");
//Images for the ability icons
Image GoofypabilityImage1 = tk.createImage("SpiralIcon.jpg"); Image GoofypabilityImage2 = tk.createImage("ShieldIcon.jpg");
//Variables for Blue Rhapsody
//Movement images
Image BRpupMove = tk.createImage("BlueRhapsodyLeftMove.gif"); Image BRpdownMove = tk.createImage("BlueRhapsodyRightMove.gif"); Image BRprightMove = tk.createImage("BlueRhapsodyRightMove.gif"); Image BRpleftMove = tk.createImage("BlueRhapsodyLeftMove.gif");
Image BRpupLeftMove = tk.createImage("BlueRhapsodyLeftMove.gif"); Image BRpupRightMove = tk.createImage("BlueRhapsodyRightMove.gif"); Image BRpdownLeftMove = tk.createImage("BlueRhapsodyLeftMove.gif"); Image BRpdownRightMove = tk.createImage("BlueRhapsodyRightMove.gif");
//Attacking images
Image BRpupAttack = tk.createImage("BlueRhapsodyLeftAttack.gif"); Image BRpdownAttack = tk.createImage("BlueRhapsodyRightAttack.gif"); Image BRpleftAttack = tk.createImage("BlueRhapsodyLeftAttack.gif"); Image BRprightAttack = tk.createImage("BlueRhapsodyRightAttack.gif");
Image BRpupLeftAttack = tk.createImage("BlueRhapsodyLeftAttack.gif"); Image BRpupRightAttack = tk.createImage("BlueRhapsodyRightAttack.gif"); Image BRpdownLeftAttack = tk.createImage("BlueRhapsodyLeftAttack.gif"); Image BRpdownRightAttack = tk.createImage("BlueRhapsodyRightAttack.gif");
//Still images
Image BRpupStill = tk.createImage("BlueRhapsodyLeftMove.gif"); Image BRpdownStill = tk.createImage("BlueRhapsodyRightMove.gif"); Image BRprightStill = tk.createImage("BlueRhapsodyRightMove.gif"); Image BRpleftStill = tk.createImage("BlueRhapsodyLeftMove.gif");
Image BRpupLeftStill = tk.createImage("BlueRhapsodyLeftMove.gif"); Image BRpupRightStill = tk.createImage("BlueRhapsodyRightMove.gif"); Image BRpdownLeftStill = tk.createImage("BlueRhapsodyLeftMove.gif"); Image BRpdownRightStill = tk.createImage("BlueRhapsodyRightMove.gif");
//Ability Images
Image BRpability1Left = tk.createImage("BlueRhapsodyLeftShoot.gif"); Image BRpability1Right = tk.createImage("BlueRhapsodyRightShoot.gif"); Image BRpability2Left = tk.createImage("BlueRhapsodyLeftShoot.gif"); Image BRpability2Right = tk.createImage("BlueRhapsodyRightShoot.gif");
//Knocked out image
Image BRpkoImage = tk.createImage("BlueRhapsodyKO.gif");
//A full 3D image used to show the character
Image BRpbaseImage = tk.createImage("Blue Rhapsody.png");
//Length and height of rectangle bounds
int BRsideWidth = 21; int BRmidWidth = 16;
int BRsideHeight = 12; int BRmidHeight = 28;
//bullet radius
int BRpbulletRadius = 10; int BRpmyBulletSpeed = 5;
//bullet Image
Image BRpbulletImage = tk.createImage("BlizzardBullet.png");
//Timers to display animations
//Timer 1 is the duration of beingranged
long BRphittingAnimation = 360; long BRpability1AnimationTimer = 210 ; long BRpability2AnimationTimer = 210;
//Ability cooldown timers
long BRpabilityCooldown1 = 11000; long BRpabilityCooldown2 = 6000;
//Character stats
int BRpmaxHP = 200; int BRpbaseSpeed = 4; int BRplevel = 1; int BRpbaseDamage = 35; int BRpmaxToHitTime = 1200;
//Images for UI
Image BRpHealthy = tk.createImage("BlueRhapsodyHealthy.png"); Image BRpHurt = tk.createImage("BlueRhapsodyHurt.png");
//Images for the ability icons
Image BRpabilityImage1 = tk.createImage("GunIcon.jpg"); Image BRpabilityImage2 = tk.createImage("IceBoltIcon.jpg");
//Image to be displayed whenicy blast hits
Image BRpicyBlast = tk.createImage("Breaking Ice.gif");
//The timer for how long the animation should be displayed for
long BRpicyBlastDuration = 300;
//Snowball Image
Image BRpsnowballImage = tk.createImage("IcyBlastIceball.png");
//Speed for the icyblasts and radius
int BRpibSpeed = 6, BRpibRadius = 98, BRpsnowballRadius = 25;
//Timer for when the character is to shoot
long BRphittingFrequency = 350;
//The duration for being ranged
long BRprangedDuration = 6000;
//Variables for Leon
//Movement images
Image LeonpupMove = tk.createImage("LeonUpLeftMove.gif"); Image LeonpdownMove = tk.createImage("LeonDownRightMove.gif"); Image LeonprightMove = tk.createImage("LeonUpRightMove.gif"); Image LeonpleftMove = tk.createImage("LeonDownLeftMove.gif");
Image LeonpupLeftMove = tk.createImage("LeonUpLeftMove.gif"); Image LeonpupRightMove = tk.createImage("LeonUpRightMove.gif"); Image LeonpdownLeftMove = tk.createImage("LeonDownLeftMove.gif"); Image LeonpdownRightMove = tk.createImage("LeonDownRightMove.gif");
//Attacking images
Image LeonpupAttack = tk.createImage("LeonLeftAttack.gif"); Image LeonpdownAttack = tk.createImage("LeonRightAttack.gif"); Image LeonpleftAttack = tk.createImage("LeonLeftAttack.gif"); Image LeonprightAttack = tk.createImage("LeonRightAttack.gif");
Image LeonpupLeftAttack = tk.createImage("LeonLeftAttack.gif"); Image LeonpupRightAttack = tk.createImage("LeonRightAttack.gif"); Image LeonpdownLeftAttack = tk.createImage("LeonLeftAttack.gif"); Image LeonpdownRightAttack = tk.createImage("LeonRightAttack.gif");
//Still images
Image LeonpupStill = tk.createImage("LeonUpLeftStill.png"); Image LeonpdownStill = tk.createImage("LeonDownRightStill.png"); Image LeonprightStill = tk.createImage("LeonUpRightStill.png"); Image LeonpleftStill = tk.createImage("LeonDownLeftStill.png");
Image LeonpupLeftStill = tk.createImage("LeonUpLeftStill.png"); Image LeonpupRightStill = tk.createImage("LeonUpRightStill.png"); Image LeonpdownLeftStill = tk.createImage("LeonDownLeftStill.png"); Image LeonpdownRightStill = tk.createImage("LeonDownRightStill.png");
//Ability Images
Image Leonpability1Left = tk.createImage("LeonLeftShoot.gif"); Image Leonpability1Right = tk.createImage("LeonRightShoot.gif"); Image Leonpability2Left = tk.createImage("LeonLeftShoot.gif"); Image Leonpability2Right = tk.createImage("LeonRightShoot.gif");
//Knocked out image
Image LeonpkoImage = tk.createImage("LeonKO.gif");
//A full 3D image used to show the character
Image LeonpbaseImage = tk.createImage("Squall Leonhart.png");
//Length and height of rectangle bounds
int LeonsideWidth = 51; int LeonmidWidth = 26;
int LeonsideHeight = 10; int LeonmidHeight = 80;
//bullet radius
int LeonpbulletRadius = 23; int LeonpmyBulletSpeed = 10;
//bullet Image
Image LeonpbulletImage = tk.createImage("FlamingFireball.gif");
//Timers to display animations
long LeonphittingAnimation = 400; long Leonpability1AnimationTimer = 400; long Leonpability2AnimationTimer = 400;
//Ability cooldown timers
long LeonpabilityCooldown1 = 8000; long LeonpabilityCooldown2 = 8000;
//Character stats
int LeonpmaxHP = 200; int LeonpbaseSpeed = 4; int Leonplevel = 0; int LeonpbaseDamage = 40; int LeonpmaxToHitTime = 1200;
//Images for UI
Image LeonpHealthy = tk.createImage("LeonHealthy.png"); Image LeonpHurt = tk.createImage("LeonHurt.png");
//Images for the ability icons
Image LeonpabilityImage1 = tk.createImage("TargetIcon.jpg"); Image LeonpabilityImage2 = tk.createImage("FireballIcon.jpg");
//The duration that the bullet follows the other character
long LeonpbulletDuration = 1300;
//Duration of dot
int LeonpdotAmount = 4;
//Animation for the directed shot
Image LeonpdirShot = tk.createImage("Puff of Smoke.gif");
//Animation for the enemy taking dot
Image LeonpdotAnim = tk.createImage("Animated Fire.gif");
//Variables for Bob
//Movement images
Image BobpupMove = tk.createImage("BobUpMove.gif"); Image BobpdownMove = tk.createImage("BobDownMove.gif"); Image BobprightMove = tk.createImage("BobRightMove.gif"); Image BobpleftMove = tk.createImage("BobLeftMove.gif");
Image BobpupLeftMove = tk.createImage("BobUpLeftMove.gif"); Image BobpupRightMove = tk.createImage("BobUpRightMove.gif"); Image BobpdownLeftMove = tk.createImage("BobDownLeftMove.gif"); Image BobpdownRightMove = tk.createImage("BobDownRightMove.gif");
//Attacking images
Image BobpupAttack = tk.createImage("BobUpAttack.gif"); Image BobpdownAttack = tk.createImage("BobDownAttack.gif"); Image BobpleftAttack = tk.createImage("BobLeftAttack.gif"); Image BobprightAttack = tk.createImage("BobRightAttack.gif");
Image BobpupLeftAttack = tk.createImage("BobUpLeftAttack.gif"); Image BobpupRightAttack = tk.createImage("BobUpRightAttack.gif"); Image BobpdownLeftAttack = tk.createImage("BobDownLeftAttack.gif"); Image BobpdownRightAttack = tk.createImage("BobDownRightAttack.gif");
//Still images
Image BobpupStill = tk.createImage("BobUpStill.png"); Image BobpdownStill = tk.createImage("BobDownStill.png"); Image BobprightStill = tk.createImage("BobRightStill.png"); Image BobpleftStill = tk.createImage("BobLeftStill.png");
Image BobpupLeftStill = tk.createImage("BobUpLeftStill.png"); Image BobpupRightStill = tk.createImage("BobUpRightStill.png"); Image BobpdownLeftStill = tk.createImage("BobDownLeftStill.png"); Image BobpdownRightStill = tk.createImage("BobDownRightStill.png");
//Ability Images
Image Bobpability1Left = tk.createImage("BobStarAttack.gif"); Image Bobpability1Right = tk.createImage("BobStarAttack.gif"); Image Bobpability2Left = tk.createImage("BobAbility2Left.gif"); Image Bobpability2Right = tk.createImage("BobAbility2Right.gif");
//Knocked out image
Image BobpkoImage = tk.createImage("BobKO.gif");
//A full 3D image used to show the character
Image BobpbaseImage = tk.createImage("Bob.png");
//Length and height of rectangle bounds
int BobsideWidth = 33; int BobmidWidth = 33;
int BobsideHeight = 50; int BobmidHeight = 60;
//bullet radius
int BobpbulletRadius = 35; int BobpmyBulletSpeed = 10;
//bullet Image
Image BobpbulletImage = tk.createImage("3 Swords.gif");
//Timers to display animations
long BobphittingAnimation = 400; long Bobpability1AnimationTimer = 400; long Bobpability2AnimationTimer = 400;
//Ability cooldown timers
long BobpabilityCooldown1 = 6000; long BobpabilityCooldown2 = 12000;
//Character stats
int BobpmaxHP = 200; int BobpbaseSpeed = 4; int Bobplevel = 0; int BobpbaseDamage = 40; int BobpmaxToHitTime = 1200;
//Images for UI
Image BobpHealthy = tk.createImage("BobHealthy.png"); Image BobpHurt = tk.createImage("BobHurt.png");
//Images for the ability icons
Image BobpabilityImage1 = tk.createImage("StarAttackIcon.png"); Image BobpabilityImage2 = tk.createImage("FrisbeeIcon.png");
//The duration for how long the bullet will travel before returning to the character
long BobptravelTime = 1000;
void addSora(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Sora(
//Movement images
SorapupMove, SorapdownMove, SoraprightMove, SorapleftMove,
SorapupLeftMove, SorapupRightMove, SorapdownLeftMove, SorapdownRightMove,
//Attacking images
SorapupAttack, SorapdownAttack, SorapleftAttack, SoraprightAttack,
SorapupLeftAttack, SorapupRightAttack, SorapdownLeftAttack, SorapdownRightAttack,
//Still images
SorapupStill, SorapdownStill, SoraprightStill, SorapleftStill,
SorapupLeftStill, SorapupRightStill, SorapdownLeftStill, SorapdownRightStill,
//Ability Images
Sorapability1Left, Sorapability1Right, Sorapability2Left, Sorapability2Right,
//Knocked out image
SorapkoImage,
//A full 3D image used to show the character
SorapbaseImage,
//Length and height of rectangle bounds
SorasideWidth, SoramidWidth,
SorasideHeight, SoramidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
SorapbulletRadius, SorapmyBulletSpeed,
//bullet Image
SorapbulletImage,
//Timers to display animations
SoraphittingAnimation, Sorapability1AnimationTimer, Sorapability2AnimationTimer,
//Ability cooldown timers
SorapabilityCooldown1, SorapabilityCooldown2,
//Character stats
SorapmaxHP, SorapbaseSpeed, Soraplevel, SorapbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
SorapmaxToHitTime,
//Images for UI and their coordinates
SorapHealthy, SorapHurt,
1205, 642, 1198, 644,
//Images for the ability icons
SorapabilityImage1, SorapabilityImage2,
//Specific Images for this class
SorapleftAttack2, SorapleftAttack3, SoraprightAttack2, SoraprightAttack3,
//Specific sprites
SorapimageWind,
Sorapwind,
//Timer for wind
SorapwindDuration
));
((Sora)chars.get(chars.size()-1)).wind.setWidth(37);
((Sora)chars.get(chars.size()-1)).wind.setHeight(50);
}
void addRiku(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Riku(
//Movement images
RikupupMove, RikupdownMove, RikuprightMove, RikupleftMove,
RikupupLeftMove, RikupupRightMove, RikupdownLeftMove, RikupdownRightMove,
//Attacking images
RikupupAttack, RikupdownAttack, RikupleftAttack, RikuprightAttack,
RikupupLeftAttack, RikupupRightAttack, RikupdownLeftAttack, RikupdownRightAttack,
//Still images
RikupupStill, RikupdownStill, RikuprightStill, RikupleftStill,
RikupupLeftStill, RikupupRightStill, RikupdownLeftStill, RikupdownRightStill,
//Ability Images
Rikupability1Left, Rikupability1Left, Rikupability2Left, Rikupability2Right,
//Knocked out image
RikupkoImage,
//A full 3D image used to show the character
RikupbaseImage,
//Length and height of rectangle bounds
RikusideWidth, RikumidWidth,
RikusideHeight, RikumidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
RikupbulletRadius, RikupmyBulletSpeed,
//bullet Image
RikupbulletImage,
//Timers to display animations
RikuphittingAnimation, Rikupability1AnimationTimer, Rikupability2AnimationTimer,
//Ability cooldown timers
RikupabilityCooldown1, RikupabilityCooldown2,
//Character stats
RikupmaxHP, RikupbaseSpeed, Rikuplevel, RikupbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
RikupmaxToHitTime,
//Images for UI and their coordinates
RikupHealthy, RikupHurt,
1208, 656, 1210, 656,
//Images for the ability icons
RikupabilityImage1, RikupabilityImage2,
//Specific Images for this class
RikupteleportImage,
//Specific variables
RikupbulletAmount
));
}
void addSH(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new ShadowHeartless(
//Movement images
SHpupMove, SHpdownMove, SHprightMove, SHpleftMove,
SHpupLeftMove, SHpupRightMove, SHpdownLeftMove, SHpdownRightMove,
//Attacking images
SHpupAttack, SHpdownAttack, SHpleftAttack, SHprightAttack,
SHpupLeftAttack, SHpupRightAttack, SHpdownLeftAttack, SHpdownRightAttack,
//Still images
SHpupStill, SHpdownStill, SHprightStill, SHpleftStill,
SHpupLeftStill, SHpupRightStill, SHpdownLeftStill, SHpdownRightStill,
//Ability Images
SHpability1Left, SHpability1Right, SHpability2Left, SHpability2Right,
//Knocked out image
SHpkoImage,
//A full 3D image used to show the character
SHpbaseImage,
//Length and height of rectangle bounds
SHsideWidth, SHmidWidth,
SHsideHeight, SHmidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
SHpbulletRadius, SHpmyBulletSpeed,
//bullet Image
SHpbulletImage,
//Timers to display animations
SHphittingAnimation, SHpability1AnimationTimer, SHpability2AnimationTimer,
//Ability cooldown timers
SHpabilityCooldown1, SHpabilityCooldown2,
//Character stats
SHpmaxHP, SHpbaseSpeed, SHplevel, SHpbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
SHpmaxToHitTime,
//Images for UI and their coordinates
SHpHealthy, SHpHurt,
1200, 661, 1202, 661,
//Images for the ability icons
SHpabilityImage1, SHpabilityImage2,
//Images to be used when invulnerable
SHpinvUpLeftMove, SHpinvUpRightMove, SHpinvDownLeftMove , SHpinvDownRightMove
));
}
void addCloud(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Cloud(
//Movement images
CloudpupMove, CloudpdownMove, CloudprightMove, CloudpleftMove,
CloudpupLeftMove, CloudpupRightMove, CloudpdownLeftMove, CloudpdownRightMove,
//Attacking images
CloudpupAttack, CloudpdownAttack, CloudpleftAttack, CloudprightAttack,
CloudpupLeftAttack, CloudpupRightAttack, CloudpdownLeftAttack, CloudpdownRightAttack,
//Still images
CloudpupStill, CloudpdownStill, CloudprightStill, CloudpleftStill,
CloudpupLeftStill, CloudpupRightStill, CloudpdownLeftStill, CloudpdownRightStill,
//Ability Images
Cloudpability1Left, Cloudpability1Left, Cloudpability2Left, Cloudpability2Right,
//Knocked out image
CloudpkoImage,
//A full 3D image used to show the character
CloudpbaseImage,
//Length and height of rectangle bounds
CloudsideWidth, CloudmidWidth,
CloudsideHeight, CloudmidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
CloudpbulletRadius, CloudpmyBulletSpeed,
//bullet Image
CloudpbulletImage,
//Timers to display animations
CloudphittingAnimation, Cloudpability1AnimationTimer, Cloudpability2AnimationTimer,
//Ability cooldown timers
CloudpabilityCooldown1, CloudpabilityCooldown2,
//Character stats
CloudpmaxHP, CloudpbaseSpeed, Cloudplevel, CloudpbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
CloudpmaxToHitTime,
//Images for UI and their coordinates
CloudpHealthy, CloudpHurt,
1192, 643, 1203, 641,
//Images for the ability icons
CloudpabilityImage1, CloudpabilityImage2,
//Images for 2nd and 3rd attack
CloudprightAttack2, CloudpleftAttack2, CloudprightAttack3, CloudpleftAttack3,
//Duration for abilities
CloudpabilityDuration1, CloudpabilityDuration2
));
}
void addDonald(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Donald(
//Movement images
DonaldpupMove, DonaldpdownMove, DonaldprightMove, DonaldpleftMove,
DonaldpupLeftMove, DonaldpupRightMove, DonaldpdownLeftMove, DonaldpdownRightMove,
//Attacking images
DonaldpupAttack, DonaldpdownAttack, DonaldpleftAttack, DonaldprightAttack,
DonaldpupLeftAttack, DonaldpupRightAttack, DonaldpdownLeftAttack, DonaldpdownRightAttack,
//Still images
DonaldpupStill, DonaldpdownStill, DonaldprightStill, DonaldpleftStill,
DonaldpupLeftStill, DonaldpupRightStill, DonaldpdownLeftStill, DonaldpdownRightStill,
//Ability Images
Donaldpability1Left, Donaldpability1Left, Donaldpability2Left, Donaldpability2Right,
//Knocked out image
DonaldpkoImage,
//A full 3D image used to show the character
DonaldpbaseImage,
//Length and height of rectangle bounds
DonaldsideWidth, DonaldmidWidth,
DonaldsideHeight, DonaldmidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
DonaldpbulletRadius, DonaldpmyBulletSpeed,
//bullet Image
DonaldpbulletImage,
//Timers to display animations
DonaldphittingAnimation, Donaldpability1AnimationTimer, Donaldpability2AnimationTimer,
//Ability cooldown timers
DonaldpabilityCooldown1, DonaldpabilityCooldown2,
//Character stats
DonaldpmaxHP, DonaldpbaseSpeed, Donaldplevel, DonaldpbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
DonaldpmaxToHitTime,
//Images for UI and their coordinates
DonaldpHealthy, DonaldpHurt,
1205, 648, 1205, 648,
//Images for the ability icons
DonaldpabilityImage1, DonaldpabilityImage2,
//Thunder and heal animation images
DonaldpthunderImage, DonaldphealImage,
DonaldpthunderWidth, DonaldpThunderHeight, DonaldpthunderLength,
//The duration for the thunder image animation
DonaldpthunderDuration,
//The durations for the heal image animation
DonaldphealDuration,
//The amount of times damage is multiplied to heal
DonaldphealToDamage
));
}
void addGoofy(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Goofy(
//Movement images
GoofypupMove, GoofypdownMove, GoofyprightMove, GoofypleftMove,
GoofypupLeftMove, GoofypupRightMove, GoofypdownLeftMove, GoofypdownRightMove,
//Attacking images
GoofypupAttack, GoofypdownAttack, GoofypleftAttack, GoofyprightAttack,
GoofypupLeftAttack, GoofypupRightAttack, GoofypdownLeftAttack, GoofypdownRightAttack,
//Still images
GoofypupStill, GoofypdownStill, GoofyprightStill, GoofypleftStill,
GoofypupLeftStill, GoofypupRightStill, GoofypdownLeftStill, GoofypdownRightStill,
//Ability Images
Goofypability1Left, Goofypability1Right, Goofypability2Left, Goofypability2Right,
//Knocked out image
GoofypkoImage,
//A full 3D image used to show the character
GoofypbaseImage,
//Length and height of rectangle bounds
GoofysideWidth, GoofymidWidth,
GoofysideHeight, GoofymidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
GoofypbulletRadius, GoofypmyBulletSpeed,
//bullet Image
GoofypbulletImage,
//Timers to display animations
GoofyphittingAnimation, Goofypability1AnimationTimer, Goofypability2AnimationTimer,
//Ability cooldown timers
GoofypabilityCooldown1, GoofypabilityCooldown2,
//Character stats
GoofypmaxHP, GoofypbaseSpeed, Goofyplevel, GoofypbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
GoofypmaxToHitTime,
//Images for UI and their coordinates
GoofypHealthy, GoofypHurt,
1204, 643, 1208, 642,
//Images for the ability icons
GoofypabilityImage1, GoofypabilityImage2
));
}
void addBR(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new BlueRhapsody(
//Movement images
BRpupMove, BRpdownMove, BRprightMove, BRpleftMove,
BRpupLeftMove, BRpupRightMove, BRpdownLeftMove, BRpdownRightMove,
//Attacking images
BRpupAttack, BRpdownAttack, BRpleftAttack, BRprightAttack,
BRpupLeftAttack, BRpupRightAttack, BRpdownLeftAttack, BRpdownRightAttack,
//Still images
BRpupStill, BRpdownStill, BRprightStill, BRpleftStill,
BRpupLeftStill, BRpupRightStill, BRpdownLeftStill, BRpdownRightStill,
//Ability Images
BRpability1Left, BRpability1Right, BRpability2Left, BRpability2Right,
//Knocked out image
BRpkoImage,
//A full 3D image used to show the character
BRpbaseImage,
//Length and height of rectangle bounds
BRsideWidth, BRmidWidth,
BRsideHeight, BRmidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
BRpbulletRadius, BRpmyBulletSpeed,
//bullet Image
BRpbulletImage,
//Timers to display animations
BRphittingAnimation, BRpability1AnimationTimer, BRpability2AnimationTimer,
//Ability cooldown timers
BRpabilityCooldown1, BRpabilityCooldown2,
//Character stats
BRpmaxHP, BRpbaseSpeed, BRplevel, BRpbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
BRpmaxToHitTime,
//Images for UI and their coordinates
BRpHealthy, BRpHurt,
1203, 645, 1203, 649,
//Images for the ability icons
BRpabilityImage1, BRpabilityImage2,
//Image to be displayed when icy blast hits
BRpicyBlast,
//The timer for how long the animation should be displayed for
BRpicyBlastDuration,
//Snowball Image
BRpsnowballImage,
//Speed for the icy blast and radius
BRpibSpeed, BRpibRadius, BRpsnowballRadius,
//Timer for when the character is to shoot
BRphittingFrequency,
//The duration for being ranged
BRprangedDuration
));
}
void addLeon(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Leon(
//Movement images
LeonpupMove, LeonpdownMove, LeonprightMove, LeonpleftMove,
LeonpupLeftMove, LeonpupRightMove, LeonpdownLeftMove, LeonpdownRightMove,
//Attacking images
LeonpupAttack, LeonpdownAttack, LeonpleftAttack, LeonprightAttack,
LeonpupLeftAttack, LeonpupRightAttack, LeonpdownLeftAttack, LeonpdownRightAttack,
//Still images
LeonpupStill, LeonpdownStill, LeonprightStill, LeonpleftStill,
LeonpupLeftStill, LeonpupRightStill, LeonpdownLeftStill, LeonpdownRightStill,
//Ability Images
Leonpability1Left, Leonpability1Right, Leonpability2Left, Leonpability2Right,
//Knocked out image
LeonpkoImage,
//A full 3D image used to show the character
LeonpbaseImage,
//Length and height of rectangle bounds
LeonsideWidth, LeonmidWidth,
LeonsideHeight, LeonmidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
LeonpbulletRadius, LeonpmyBulletSpeed,
//bullet Image
LeonpbulletImage,
//Timers to display animations
LeonphittingAnimation, Leonpability1AnimationTimer, Leonpability2AnimationTimer,
//Ability cooldown timers
LeonpabilityCooldown1, LeonpabilityCooldown2,
//Character stats
LeonpmaxHP, LeonpbaseSpeed, Leonplevel, LeonpbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
LeonpmaxToHitTime,
//Images for UI and their coordinates
LeonpHealthy, LeonpHurt,
1208, 656, 1208, 656,
//Images for the ability icons
LeonpabilityImage1, LeonpabilityImage2,
//The duration that the bullet follows the other character
LeonpbulletDuration,
//Duration of dot
LeonpdotAmount,
//Animation for the directed shot
LeonpdirShot,
//Animation for the enemy taking dot
LeonpdotAnim
));
}
void addBob(int posX, int posY, boolean pisenemy, boolean pisProtagonist){
chars.add(new Bob(
//Movement images
BobpupMove, BobpdownMove, BobprightMove, BobpleftMove,
BobpupLeftMove, BobpupRightMove, BobpdownLeftMove, BobpdownRightMove,
//Attacking images
BobpupAttack, BobpdownAttack, BobpleftAttack, BobprightAttack,
BobpupLeftAttack, BobpupRightAttack, BobpdownLeftAttack, BobpdownRightAttack,
//Still images
BobpupStill, BobpdownStill, BobprightStill, BobpleftStill,
BobpupLeftStill, BobpupRightStill, BobpdownLeftStill, BobpdownRightStill,
//Ability Images
Bobpability1Left, Bobpability1Right, Bobpability2Left, Bobpability2Right,
//Knocked out image
BobpkoImage,
//A full 3D image used to show the character
BobpbaseImage,
//Length and height of rectangle bounds
BobsideWidth, BobmidWidth,
BobsideHeight, BobmidHeight,
//Enemy or ally
pisenemy,
//Protagonist or not
pisProtagonist,
//bullet radius
BobpbulletRadius, BobpmyBulletSpeed,
//bullet Image
BobpbulletImage,
//Timers to display animations
BobphittingAnimation, Bobpability1AnimationTimer, Bobpability2AnimationTimer,
//Ability cooldown timers
BobpabilityCooldown1, BobpabilityCooldown2,
//Character stats
BobpmaxHP, BobpbaseSpeed, Bobplevel, BobpbaseDamage,
//Sprite postitions
posX, posY,
//The time to hit the character
BobpmaxToHitTime,
//Images for UI and their coordinates
BobpHealthy, BobpHurt,
1204, 643, 1208, 642,
//Images for the ability icons
BobpabilityImage1, BobpabilityImage2,
//The duration for how long the bullet will travel before returning to the character
BobptravelTime
));
}
void levelUpEnemies(){
//Add 1 to level
Soraplevel += 1;
Rikuplevel += 1;
SHplevel += 1;
Cloudplevel += 1;
Donaldplevel += 1;
Goofyplevel += 1;
BRplevel += 1;
Leonplevel += 1;
Bobplevel += 1;
int hpIncrease = 30;
//Increase HP of each enemy
SorapmaxHP += hpIncrease*lvl.difficulty;
RikupmaxHP += hpIncrease*lvl.difficulty;
SHpmaxHP += hpIncrease*lvl.difficulty;
CloudpmaxHP += hpIncrease*lvl.difficulty;
DonaldpmaxHP += hpIncrease*lvl.difficulty;
GoofypmaxHP += hpIncrease*lvl.difficulty;
BRpmaxHP += hpIncrease*lvl.difficulty;
LeonpmaxHP += hpIncrease*lvl.difficulty;
BobpmaxHP += hpIncrease*lvl.difficulty;
int damageIncrease = 5;
//Increase damage of each enemy
SorapbaseDamage += damageIncrease*lvl.difficulty;
RikupbaseDamage += damageIncrease*lvl.difficulty;
SHpbaseDamage += damageIncrease*lvl.difficulty;
CloudpbaseDamage += damageIncrease*lvl.difficulty;
DonaldpbaseDamage += damageIncrease*lvl.difficulty;
GoofypbaseDamage += damageIncrease*lvl.difficulty;
BRpbaseDamage += damageIncrease*lvl.difficulty;
LeonpbaseDamage += damageIncrease*lvl.difficulty;
BobpbaseDamage += damageIncrease*lvl.difficulty;
//Decrease ability 1's cooldown of each enemy
SorapabilityCooldown1 -= (int)(SorapabilityCooldown1*0.05f*lvl.difficulty);
RikupabilityCooldown1 -= (int)(RikupabilityCooldown1*0.05f*lvl.difficulty);
SHpabilityCooldown1 -= (int)(SHpabilityCooldown1*0.05f*lvl.difficulty);
CloudpabilityCooldown1 -= (int)(CloudpabilityCooldown1*0.05f*lvl.difficulty);
DonaldpabilityCooldown1 -= (int)(DonaldpabilityCooldown1*0.05f*lvl.difficulty);
GoofypabilityCooldown1 -= (int)(GoofypabilityCooldown1*0.05f*lvl.difficulty);
BRpabilityCooldown1 -= (int)(BRpabilityCooldown1*0.05f*lvl.difficulty);
LeonpabilityCooldown1 -= (int)(LeonpabilityCooldown1*0.05f*lvl.difficulty);
BobpabilityCooldown1 -= (int)(BobpabilityCooldown1*0.05f*lvl.difficulty);
//Decrease ability 2's cooldown of each enemy
SorapabilityCooldown2 -= (int)(SorapabilityCooldown2*0.05f*lvl.difficulty);
RikupabilityCooldown2 -= (int)(RikupabilityCooldown2*0.05f*lvl.difficulty);
SHpabilityCooldown2 -= (int)(SHpabilityCooldown2*0.05f*lvl.difficulty);
CloudpabilityCooldown2 -= (int)(CloudpabilityCooldown2*0.05f*lvl.difficulty);
DonaldpabilityCooldown2 -= (int)(DonaldpabilityCooldown2*0.05f*lvl.difficulty);
GoofypabilityCooldown2 -= (int)(GoofypabilityCooldown2*0.05f*lvl.difficulty);
BRpabilityCooldown2 -= (int)(BRpabilityCooldown2*0.05f*lvl.difficulty);
LeonpabilityCooldown2 -= (int)(LeonpabilityCooldown2*0.05f*lvl.difficulty);
BobpabilityCooldown2 -= (int)(BobpabilityCooldown2*0.05f*lvl.difficulty);
//Decrease the time the enemies take to attack
SorapmaxToHitTime -= (int)(SorapmaxToHitTime*0.02f*lvl.difficulty);
RikupmaxToHitTime -= (int)(RikupmaxToHitTime*0.02f*lvl.difficulty);
SHpmaxToHitTime -= (int)(SHpmaxToHitTime*0.02f*lvl.difficulty);
CloudpmaxToHitTime -= (int)(CloudpmaxToHitTime*0.02f*lvl.difficulty);
DonaldpmaxToHitTime -= (int)(DonaldpmaxToHitTime*0.02f*lvl.difficulty);
GoofypmaxToHitTime -= (int)(GoofypmaxToHitTime*0.02f*lvl.difficulty);
BRpmaxToHitTime -= (int)(BRpmaxToHitTime*0.02f*lvl.difficulty);
LeonpmaxToHitTime -= (int)(LeonpmaxToHitTime*0.02f*lvl.difficulty);
BobpmaxToHitTime -= (int)(BobpmaxToHitTime*0.02f*lvl.difficulty);
//Special items level up which would make them overpowered if they were levelled up frequently