5 |
6 | Everyone is permitted to copy and distribute verbatim or modified
7 | copies of this license document, and changing it is allowed as long
8 | as the name is changed.
9 |
10 | DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
11 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
12 |
13 | 0. You just DO WHAT THE FUCK YOU WANT TO.
14 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Nokia Bounce Decomp
2 |
3 | ## Building
4 |
5 | It builds with `gradlew build` but there is no point in that at the moment since I didn't implement any wrappers for MIDlet and Nokia APIs.
6 |
7 | ## Tools
8 |
9 | ### extract_locales
10 |
11 | `extract_locales.py` -- extracts locales from `lang.***` files.
12 |
13 | #### Requirements
14 |
15 | * Python 3 with PIP
16 |
17 | #### Usage
18 |
19 | ```
20 | pip install -r requirements.txt
21 | python extract_locales.py
22 | ```
23 |
24 | Replace `pip` and `python` with `pip3` and `python3` if your system has Python 2 installed.
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/d.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | public class d {
4 | public static final int[] a = new int[]{
5 | 35, 36, 17, 19, 43, 44, 25, 27, 31, 32,
6 | 13, 15, 39, 40, 21, 23};
7 |
8 | public static final int[] b = new int[]{
9 | 33, 34, 18, 20, 41, 42, 26, 28, 29, 30,
10 | 14, 16, 37, 38, 22, 24};
11 | }
12 |
13 |
14 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\d.class
15 | * Java compiler version: 1 (45.3)
16 | * JD-Core Version: 1.1.3
17 | */
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | build/
3 | !gradle/wrapper/gradle-wrapper.jar
4 | !**/src/main/**/build/
5 | !**/src/test/**/build/
6 |
7 | ### IntelliJ IDEA ###
8 | .idea/modules.xml
9 | .idea/jarRepositories.xml
10 | .idea/compiler.xml
11 | .idea/libraries/
12 | *.iws
13 | *.iml
14 | *.ipr
15 | out/
16 | !**/src/main/**/out/
17 | !**/src/test/**/out/
18 |
19 | ### Eclipse ###
20 | .apt_generated
21 | .classpath
22 | .factorypath
23 | .project
24 | .settings
25 | .springBeans
26 | .sts4-cache
27 | bin/
28 | !**/src/main/**/bin/
29 | !**/src/test/**/bin/
30 |
31 | ### NetBeans ###
32 | /nbproject/private/
33 | /nbbuild/
34 | /dist/
35 | /nbdist/
36 | /.nb-gradle/
37 |
38 | ### VS Code ###
39 | .vscode/
40 |
41 | ### Mac OS ###
42 | .DS_Store
--------------------------------------------------------------------------------
/.idea/gradle.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
17 |
18 |
--------------------------------------------------------------------------------
/extract_locales.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env python3
2 |
3 | import os
4 | from mutf8 import decode_modified_utf8
5 |
6 | TRANSLATED_STRINGS = 14
7 | TRANSLATION_FILE_PATH = "src/main/resources/lang.xx"
8 |
9 | def read_short(f):
10 | b = f.read(2)
11 | return int.from_bytes(b, byteorder='big')
12 |
13 | file_size = os.path.getsize(TRANSLATION_FILE_PATH)
14 | with open(TRANSLATION_FILE_PATH, "rb") as locale_file:
15 | offsets = []
16 | for _ in range(TRANSLATED_STRINGS):
17 | offsets.append(read_short(locale_file))
18 |
19 | count = 0
20 | for offset in offsets:
21 | locale_file.seek(offset)
22 |
23 | length = read_short(locale_file)
24 |
25 | string = decode_modified_utf8(locale_file.read(length))
26 | print(f"Locale #{count}: \"{string}\"")
27 | count += 1
--------------------------------------------------------------------------------
/src/main/resources/levels/J2MElvl.001:
--------------------------------------------------------------------------------
1 | np
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/BounceTimer.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import java.util.Timer;
4 | import java.util.TimerTask;
5 |
6 | public class BounceTimer extends TimerTask {
7 | b a;
8 |
9 | Timer timer;
10 |
11 | private final b b;
12 |
13 | public BounceTimer(b paramb1, b paramb2) {
14 | this.b = paramb1;
15 | this.a = paramb2;
16 | this.timer = new Timer();
17 | this.timer.schedule(this, 0L, 40L); // ~25 Ticks per second
18 | }
19 |
20 | public void run() {
21 | this.a.GameTimerTick();
22 | }
23 |
24 | void stop() {
25 | if (this.timer == null)
26 | return;
27 | cancel();
28 | this.timer.cancel();
29 | this.timer = null;
30 | }
31 | }
32 |
33 |
34 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\g.class
35 | * Java compiler version: 1 (45.3)
36 | * JD-Core Version: 1.1.3
37 | */
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/TileIDs.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | public final class TileIDs {
4 | public static final int EMPTY = 0;
5 | public static final int BRICK_WALL = 1;
6 | public static final int RUBBER_WALL = 2;
7 | public static final int THORNS_UP = 3;
8 | public static final int THORNS_RIGHT = 4;
9 | public static final int THORNS_DOWN = 5;
10 | public static final int THORNS_LEFT = 6;
11 | public static final int CRYSTAL = 7;
12 | public static final int CRYSTAL_ACTIVE = 8;
13 |
14 | public static final int PUMPER_UP = 43;
15 | public static final int PUMPER_RIGHT = 44;
16 | public static final int PUMPER_DOWN = 45;
17 | public static final int PUMPER_LEFT = 46;
18 |
19 | public static final int POWER_UP_GRAVITY_UP = 47;
20 | public static final int POWER_UP_GRAVITY_RIGHT = 48;
21 | public static final int POWER_UP_GRAVITY_DOWN = 49;
22 | public static final int POWER_UP_GRAVITY_LEFT = 50;
23 | }
24 |
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/Bounce.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import com.nokia.mid.ui.DeviceControl;
4 |
5 | import javax.microedition.lcdui.Display;
6 | import javax.microedition.midlet.MIDlet;
7 |
8 | public class Bounce extends MIDlet {
9 | private BounceGame BounceGame;
10 |
11 | public Bounce() {
12 | if (this.BounceGame == null)
13 | this.BounceGame = new BounceGame(this);
14 | }
15 |
16 | protected void startApp() {
17 | DeviceControl.setLights(0, 100);
18 | }
19 |
20 | protected void pauseApp() {
21 | }
22 |
23 | public void destroyApp(boolean paramBoolean) {
24 | if (this.BounceGame != null && this.BounceGame.v != null) {
25 | this.BounceGame.WriteToStore(3);
26 | this.BounceGame.v.StopGameTimer();
27 | }
28 | Display.getDisplay(this).setCurrent(null);
29 | this.BounceGame = null;
30 | }
31 | }
32 |
33 |
34 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\Bounce.class
35 | * Java compiler version: 1 (45.3)
36 | * JD-Core Version: 1.1.3
37 | */
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%"=="" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%"=="" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if %ERRORLEVEL% equ 0 goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if %ERRORLEVEL% equ 0 goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | set EXIT_CODE=%ERRORLEVEL%
84 | if %EXIT_CODE% equ 0 set EXIT_CODE=1
85 | if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
86 | exit /b %EXIT_CODE%
87 |
88 | :mainEnd
89 | if "%OS%"=="Windows_NT" endlocal
90 |
91 | :omega
92 |
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/Translation.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import java.io.DataInputStream;
4 | import java.io.IOException;
5 | import java.io.InputStream;
6 |
7 | public class Translation {
8 | public static final int BOUNCE = 0;
9 | public static final int MORE_INSTRUCTIONS = 1;
10 | public static final int BACK = 2;
11 | public static final int CONGRATS = 3;
12 | public static final int CONTINUE = 4;
13 | public static final int EXIT = 5;
14 | public static final int GAME_OVER = 6;
15 | public static final int HIGH_SCORE = 7;
16 | public static final int INSTRUCTIONS = 8;
17 | public static final int LEVEL = 9;
18 | public static final int LEVEL_COMPLETED = 10;
19 | public static final int NEW_GAME = 11;
20 | public static final int NEW_HIGH_SCORE = 12;
21 | public static final int OK = 13;
22 |
23 | private static Translation instance = null;
24 |
25 | /**
26 | * Structure of the file:
27 | *
28 | * short offsets[14] -- offsets of individual strings
29 | *
30 | * Each string is:
31 | *
32 | * short length;
33 | * char *string;
34 | *
35 | * Where string is MUTF-8 encoded
36 | */
37 | private static DataInputStream tStream = null;
38 |
39 | public static final String locale = System.getProperty("microedition.locale");
40 |
41 | private static String sprintf_translated(String input, String replace, String replacement) {
42 | int i = input.indexOf(replace);
43 | return (i >= 0) ? (input.substring(0, i) + replacement + input.substring(i + replace.length())) : input;
44 | }
45 |
46 | public static synchronized String sprintf_translated(int translationId) {
47 | return sprintf_translated(translationId, null);
48 | }
49 |
50 | public static synchronized String sprintf_translated(int translationId, String[] format) {
51 | try {
52 | if (instance == null)
53 | instance = new Translation();
54 | if (tStream == null) {
55 | InputStream translationFile = instance.getClass().getResourceAsStream("/lang." + locale);
56 | if (translationFile == null)
57 | translationFile = instance.getClass().getResourceAsStream("/lang.xx");
58 | if (translationFile == null)
59 | return "NoLang";
60 | tStream = new DataInputStream(translationFile);
61 | tStream.mark(512);
62 | }
63 | tStream.skipBytes(translationId * Short.BYTES);
64 | short stringOffset = tStream.readShort();
65 | tStream.skipBytes(stringOffset - translationId * 2 - Short.BYTES);
66 | String str = tStream.readUTF();
67 | try {
68 | tStream.reset();
69 | } catch (IOException iOException) {
70 | tStream.close();
71 | tStream = null;
72 | }
73 | if (format != null)
74 | if (format.length == 1) {
75 | // Replace %U with the first format argument
76 | str = sprintf_translated(str, "%U", format[0]);
77 | } else {
78 | for (byte b = 0; b < format.length; b++)
79 | str = sprintf_translated(str, "%" + b + "U", format[b]);
80 | }
81 | return str;
82 | } catch (IOException iOException) {
83 | return "Err";
84 | }
85 | }
86 | }
87 |
88 |
89 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\c.class
90 | * Java compiler version: 1 (45.3)
91 | * JD-Core Version: 1.1.3
92 | */
--------------------------------------------------------------------------------
/src/main/resources/levels/J2MElvl.005:
--------------------------------------------------------------------------------
1 | X
2 | Z+ a@@ @@ @@@@@@@@@@@@@ @@@@@@@@@@@@@ @@ @@
@@ @@@@@@@@@@@@@@@@@@ii ! @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
2@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@OP@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@OP@@@@@@@@@@OP@@@@ @@@@@@@@@@@@@@@@@@@@ )) @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@` @@@@@@@@@@@@@@@@@@@@@@@@` * !@@k@@@@@@@@@@@@@@C@@@@@` * a@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`a@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 3 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ ! @@@@@@C@@@@@C@@@@@C@@@@@C@@@@@C@@@@@k@@@@@@@@@@@@@@@@@@@@@@@@@
--------------------------------------------------------------------------------
/src/main/resources/levels/J2MElvl.006:
--------------------------------------------------------------------------------
1 | 7 p$ ! ! ! ! ! ! ! ! '' ,
2 |
3 |
4 |
5 | ,
6 |
7 |
8 |
9 | ., !
10 |
11 | a@@@@@@` a@@@@@@`!
12 |
13 | . !
14 |
15 | a@@@@@ @@@@@`! ! !
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 | )) FM OV 8 ce "
--------------------------------------------------------------------------------
/src/main/resources/levels/J2MElvl.010:
--------------------------------------------------------------------------------
1 | Bp#
! + ! a@@@@@@@@ @@@@@@@@@@@@@` @@@@@@@@ @@@@@@@@@@@@@ @@@@@@@@ C@C@C@C@C@C@C @@@@@@@@ @@@@@@@@ @@@@@@@@ ''''''''@@@@@@@@ @@@@@@@@ @@@@@@@@ @@@@@@@@ D@@@@@@F * *
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | )) )) )) )) )) /
6
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 | 6 !
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 | 3 ce ^` ac _a eg \^ dn
--------------------------------------------------------------------------------
/.idea/workspace.xml:
--------------------------------------------------------------------------------
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 | "keyToString": {
69 | "ASKED_ADD_EXTERNAL_FILES": "true",
70 | "RunOnceActivity.OpenProjectViewOnStart": "true",
71 | "RunOnceActivity.ShowReadmeOnStart": "true",
72 | "SHARE_PROJECT_CONFIGURATION_FILES": "true",
73 | "git-widget-placeholder": "master",
74 | "ignore.virus.scanning.warn.message": "true",
75 | "jdk.selected.JAVA_MODULE": "17",
76 | "last_opened_file_path": "C:/dev/nokia-bounce-decomp",
77 | "project.structure.last.edited": "Artifacts",
78 | "project.structure.proportion": "0.15",
79 | "project.structure.side.proportion": "0.2",
80 | "run.code.analysis.last.selected.profile": "pProject Default"
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 | true
120 | true
121 | false
122 | false
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 | 1675333845682
148 |
149 |
150 | 1675333845682
151 |
152 |
153 |
154 |
--------------------------------------------------------------------------------
/.idea/uiDesigner.xml:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #
4 | # Copyright © 2015-2021 the original authors.
5 | #
6 | # Licensed under the Apache License, Version 2.0 (the "License");
7 | # you may not use this file except in compliance with the License.
8 | # You may obtain a copy of the License at
9 | #
10 | # https://www.apache.org/licenses/LICENSE-2.0
11 | #
12 | # Unless required by applicable law or agreed to in writing, software
13 | # distributed under the License is distributed on an "AS IS" BASIS,
14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 | # See the License for the specific language governing permissions and
16 | # limitations under the License.
17 | #
18 |
19 | ##############################################################################
20 | #
21 | # Gradle start up script for POSIX generated by Gradle.
22 | #
23 | # Important for running:
24 | #
25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
26 | # noncompliant, but you have some other compliant shell such as ksh or
27 | # bash, then to run this script, type that shell name before the whole
28 | # command line, like:
29 | #
30 | # ksh Gradle
31 | #
32 | # Busybox and similar reduced shells will NOT work, because this script
33 | # requires all of these POSIX shell features:
34 | # * functions;
35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»;
37 | # * compound commands having a testable exit status, especially «case»;
38 | # * various built-in commands including «command», «set», and «ulimit».
39 | #
40 | # Important for patching:
41 | #
42 | # (2) This script targets any POSIX shell, so it avoids extensions provided
43 | # by Bash, Ksh, etc; in particular arrays are avoided.
44 | #
45 | # The "traditional" practice of packing multiple parameters into a
46 | # space-separated string is a well documented source of bugs and security
47 | # problems, so this is (mostly) avoided, by progressively accumulating
48 | # options in "$@", and eventually passing that to Java.
49 | #
50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
52 | # see the in-line comments for details.
53 | #
54 | # There are tweaks for specific operating systems such as AIX, CygWin,
55 | # Darwin, MinGW, and NonStop.
56 | #
57 | # (3) This script is generated from the Groovy template
58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59 | # within the Gradle project.
60 | #
61 | # You can find Gradle at https://github.com/gradle/gradle/.
62 | #
63 | ##############################################################################
64 |
65 | # Attempt to set APP_HOME
66 |
67 | # Resolve links: $0 may be a link
68 | app_path=$0
69 |
70 | # Need this for daisy-chained symlinks.
71 | while
72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
73 | [ -h "$app_path" ]
74 | do
75 | ls=$( ls -ld "$app_path" )
76 | link=${ls#*' -> '}
77 | case $link in #(
78 | /*) app_path=$link ;; #(
79 | *) app_path=$APP_HOME$link ;;
80 | esac
81 | done
82 |
83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84 |
85 | APP_NAME="Gradle"
86 | APP_BASE_NAME=${0##*/}
87 |
88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
90 |
91 | # Use the maximum available, or set MAX_FD != -1 to use that value.
92 | MAX_FD=maximum
93 |
94 | warn () {
95 | echo "$*"
96 | } >&2
97 |
98 | die () {
99 | echo
100 | echo "$*"
101 | echo
102 | exit 1
103 | } >&2
104 |
105 | # OS specific support (must be 'true' or 'false').
106 | cygwin=false
107 | msys=false
108 | darwin=false
109 | nonstop=false
110 | case "$( uname )" in #(
111 | CYGWIN* ) cygwin=true ;; #(
112 | Darwin* ) darwin=true ;; #(
113 | MSYS* | MINGW* ) msys=true ;; #(
114 | NONSTOP* ) nonstop=true ;;
115 | esac
116 |
117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
118 |
119 |
120 | # Determine the Java command to use to start the JVM.
121 | if [ -n "$JAVA_HOME" ] ; then
122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
123 | # IBM's JDK on AIX uses strange locations for the executables
124 | JAVACMD=$JAVA_HOME/jre/sh/java
125 | else
126 | JAVACMD=$JAVA_HOME/bin/java
127 | fi
128 | if [ ! -x "$JAVACMD" ] ; then
129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
130 |
131 | Please set the JAVA_HOME variable in your environment to match the
132 | location of your Java installation."
133 | fi
134 | else
135 | JAVACMD=java
136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137 |
138 | Please set the JAVA_HOME variable in your environment to match the
139 | location of your Java installation."
140 | fi
141 |
142 | # Increase the maximum file descriptors if we can.
143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144 | case $MAX_FD in #(
145 | max*)
146 | MAX_FD=$( ulimit -H -n ) ||
147 | warn "Could not query maximum file descriptor limit"
148 | esac
149 | case $MAX_FD in #(
150 | '' | soft) :;; #(
151 | *)
152 | ulimit -n "$MAX_FD" ||
153 | warn "Could not set maximum file descriptor limit to $MAX_FD"
154 | esac
155 | fi
156 |
157 | # Collect all arguments for the java command, stacking in reverse order:
158 | # * args from the command line
159 | # * the main class name
160 | # * -classpath
161 | # * -D...appname settings
162 | # * --module-path (only if needed)
163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
164 |
165 | # For Cygwin or MSYS, switch paths to Windows format before running java
166 | if "$cygwin" || "$msys" ; then
167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
169 |
170 | JAVACMD=$( cygpath --unix "$JAVACMD" )
171 |
172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
173 | for arg do
174 | if
175 | case $arg in #(
176 | -*) false ;; # don't mess with options #(
177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
178 | [ -e "$t" ] ;; #(
179 | *) false ;;
180 | esac
181 | then
182 | arg=$( cygpath --path --ignore --mixed "$arg" )
183 | fi
184 | # Roll the args list around exactly as many times as the number of
185 | # args, so each arg winds up back in the position where it started, but
186 | # possibly modified.
187 | #
188 | # NB: a `for` loop captures its iteration list before it begins, so
189 | # changing the positional parameters here affects neither the number of
190 | # iterations, nor the values presented in `arg`.
191 | shift # remove old arg
192 | set -- "$@" "$arg" # push replacement arg
193 | done
194 | fi
195 |
196 | # Collect all arguments for the java command;
197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198 | # shell script including quotes and variable substitutions, so put them in
199 | # double quotes to make sure that they get re-expanded; and
200 | # * put everything else in single quotes, so that it's not re-expanded.
201 |
202 | set -- \
203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \
204 | -classpath "$CLASSPATH" \
205 | org.gradle.wrapper.GradleWrapperMain \
206 | "$@"
207 |
208 | # Stop when "xargs" is not available.
209 | if ! command -v xargs >/dev/null 2>&1
210 | then
211 | die "xargs is not available"
212 | fi
213 |
214 | # Use "xargs" to parse quoted args.
215 | #
216 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
217 | #
218 | # In Bash we could simply go:
219 | #
220 | # readarray ARGS < <( xargs -n1 <<<"$var" ) &&
221 | # set -- "${ARGS[@]}" "$@"
222 | #
223 | # but POSIX shell has neither arrays nor command substitution, so instead we
224 | # post-process each arg (as a line of input to sed) to backslash-escape any
225 | # character that might be a shell metacharacter, then use eval to reverse
226 | # that process (while maintaining the separation between arguments), and wrap
227 | # the whole thing up as a single "set" statement.
228 | #
229 | # This will of course break if any of these variables contains a newline or
230 | # an unmatched quote.
231 | #
232 |
233 | eval "set -- $(
234 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
235 | xargs -n1 |
236 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
237 | tr '\n' ' '
238 | )" '"$@"'
239 |
240 | exec "$JAVACMD" "$@"
241 |
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/BounceGame.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import javax.microedition.lcdui.*;
4 | import javax.microedition.rms.RecordStore;
5 | import java.io.ByteArrayInputStream;
6 | import java.io.ByteArrayOutputStream;
7 | import java.io.DataInputStream;
8 | import java.io.DataOutputStream;
9 |
10 | public class BounceGame implements CommandListener {
11 | static final long RECORD_STORE_MAGIC = -559038737L;
12 |
13 | public Bounce s;
14 |
15 | public Display display;
16 |
17 | public e v;
18 |
19 | public int K = 2;
20 |
21 | public int MaxLevels;
22 |
23 | public int HighScore;
24 |
25 | public boolean q;
26 |
27 | public int E;
28 |
29 | public byte J = 0;
30 |
31 | public byte RecordLives;
32 |
33 | public byte RecordHoopsScored;
34 |
35 | public byte RecordLevel;
36 |
37 | public byte A;
38 |
39 | public int RecordScore;
40 |
41 | public int I;
42 |
43 | public int H;
44 |
45 | public int a;
46 |
47 | public int g;
48 |
49 | public int y;
50 |
51 | public int M;
52 |
53 | public int e;
54 |
55 | public int b;
56 |
57 | public int w;
58 |
59 | public int z;
60 |
61 | public int n;
62 |
63 | public int p;
64 |
65 | public int[][] u;
66 |
67 | public int r;
68 |
69 | public Vec2S[] D;
70 |
71 | public short[][] l;
72 |
73 | public long LastRecordTimestampMillis;
74 |
75 | private Command i;
76 |
77 | private Command commandBack;
78 |
79 | private Command commandExit;
80 |
81 | private Command commandContinue;
82 |
83 | private List c;
84 |
85 | private List currentList;
86 |
87 | private Form form;
88 |
89 | private int N;
90 |
91 | private final String[] menuStrings = new String[4];
92 |
93 | public BounceGame(Bounce paramBounce) {
94 | this.s = paramBounce;
95 | LoadRecords();
96 | this.v = new e(this, 1);
97 | this.v.StartGameTimer();
98 | this.display = Display.getDisplay(this.s);
99 | this.display.setCurrent(this.v);
100 | LoadMenuStrings();
101 | }
102 |
103 | public synchronized void LoadMenuStrings() {
104 | this.menuStrings[0] = Translation.sprintf_translated(Translation.CONTINUE);
105 | this.menuStrings[1] = Translation.sprintf_translated(Translation.NEW_GAME);
106 | this.menuStrings[2] = Translation.sprintf_translated(Translation.HIGH_SCORE);
107 | this.menuStrings[3] = Translation.sprintf_translated(Translation.INSTRUCTIONS);
108 | }
109 |
110 | public synchronized void ShowMainMenu() {
111 | this.c = new List(Translation.sprintf_translated(Translation.BOUNCE), List.IMPLICIT);
112 | if (this.commandBack == null) {
113 | this.commandBack = new Command(Translation.sprintf_translated(Translation.BACK), Command.BACK, 1);
114 | this.commandExit = new Command(Translation.sprintf_translated(Translation.EXIT), Command.EXIT, 1);
115 | }
116 | if (this.K == 1 || this.J == 1 || this.J == 2)
117 | this.c.append(this.menuStrings[0], null);
118 | for (byte b = 1; b < this.menuStrings.length; b++)
119 | this.c.append(this.menuStrings[b], null);
120 | this.c.addCommand(this.commandExit);
121 | this.c.setCommandListener(this);
122 | if (this.v.SplashId != -1) {
123 | this.v.SplashId = -1;
124 | this.v.ImageSplash = null;
125 | }
126 | if (this.K == 1 || this.J == 1 || this.J == 2) {
127 | this.c.setSelectedIndex(0, true);
128 | } else {
129 | this.c.setSelectedIndex(this.N, true);
130 | }
131 | this.v.StopGameTimer();
132 | this.display.setCurrent(this.c);
133 | }
134 |
135 | public void LevelSelect() {
136 | String[] levelStrings = new String[this.MaxLevels];
137 | String[] levelStringFormat = new String[1];
138 | for (byte b = 0; b < this.MaxLevels; b++) {
139 | levelStringFormat[0] = String.valueOf(b + 1);
140 | levelStrings[b] = Translation.sprintf_translated(Translation.LEVEL, levelStringFormat);
141 | }
142 | this.currentList = new List(Translation.sprintf_translated(Translation.NEW_GAME), List.IMPLICIT, levelStrings, null);
143 | this.currentList.addCommand(this.commandBack);
144 | this.currentList.setCommandListener(this);
145 | this.display.setCurrent(this.currentList);
146 | }
147 |
148 | public void a(boolean paramBoolean, int paramInt) {
149 | if (paramBoolean) {
150 | this.q = false;
151 | this.v.a(paramInt, 0, 3);
152 | }
153 | this.v.StartGameTimer();
154 | this.v.aq.a();
155 | this.display.setCurrent(this.v);
156 | this.K = 1;
157 | }
158 |
159 | public void ShowHighScore() {
160 | this.form = new Form(Translation.sprintf_translated(Translation.HIGH_SCORE));
161 | this.form.append(String.valueOf(this.HighScore));
162 | this.form.addCommand(this.commandBack);
163 | this.form.setCommandListener(this);
164 | this.display.setCurrent(this.form);
165 | }
166 |
167 | public void ShowInstructions() {
168 | this.form = new Form(Translation.sprintf_translated(Translation.INSTRUCTIONS));
169 | String[] arrayOfString = {this.v.getKeyName(this.v.getKeyCode(2)), this.v.getKeyName(this.v.getKeyCode(5)), this.v.getKeyName(this.v.getKeyCode(1))};
170 | this.form.append(Translation.sprintf_translated(Translation.MORE_INSTRUCTIONS, arrayOfString));
171 | this.form.addCommand(this.commandBack);
172 | this.form.setCommandListener(this);
173 | this.display.setCurrent(this.form);
174 | this.form = null;
175 | }
176 |
177 | public void ShowGameEnd(boolean won) {
178 | this.v.StopGameTimer();
179 | if (this.i == null)
180 | this.i = new Command(Translation.sprintf_translated(Translation.OK), Command.OK, 1);
181 | this.form = new Form(Translation.sprintf_translated(Translation.GAME_OVER));
182 | if (won) {
183 | this.form.append(Translation.sprintf_translated(Translation.CONGRATS));
184 | } else {
185 | this.form.append(Translation.sprintf_translated(Translation.GAME_OVER));
186 | }
187 | this.form.append("\n\n");
188 | if (this.q) {
189 | this.form.append(Translation.sprintf_translated(Translation.NEW_HIGH_SCORE));
190 | this.form.append("\n\n");
191 | }
192 | this.form.append(String.valueOf(this.E));
193 | this.form.addCommand(this.i);
194 | this.form.setCommandListener(this);
195 | this.display.setCurrent(this.form);
196 | this.form = null;
197 | }
198 |
199 | public void ShowLevelComplete() {
200 | this.v.StopGameTimer();
201 | a(false, 0);
202 | this.K = 5;
203 | if (this.commandContinue == null)
204 | this.commandContinue = new Command(Translation.sprintf_translated(Translation.CONTINUE), Command.OK, 1);
205 | this.form = new Form("");
206 | this.form.append(this.v.LevelCompletedString);
207 | this.form.append("\n\n");
208 | this.form.append("" + this.E + "\n");
209 | this.form.addCommand(this.commandContinue);
210 | this.form.setCommandListener(this);
211 | this.display.setCurrent(this.form);
212 | this.form = null;
213 | }
214 |
215 | public void commandAction(Command cmd, Displayable displayable) {
216 | if (cmd == List.SELECT_COMMAND) {
217 | if (displayable == this.currentList) {
218 | a(true, this.currentList.getSelectedIndex() + 1);
219 | } else {
220 | String str = this.c.getString(this.c.getSelectedIndex());
221 | this.N = this.c.getSelectedIndex();
222 | if (str.equals(this.menuStrings[0])) {
223 | if (this.K == 1) {
224 | a(false, this.v.level);
225 | } else if (this.J != 0) {
226 | this.display.setCurrent(this.v);
227 | if (this.J == 1) {
228 | this.v.a(this.y, this.M);
229 | } else {
230 | this.v.a(this.RecordLevel, this.RecordScore, this.RecordLives);
231 | }
232 | this.u = null;
233 | this.v.StartGameTimer();
234 | this.K = 1;
235 | }
236 | } else if (str.equals(this.menuStrings[1])) {
237 | if (this.K != 4)
238 | if (this.MaxLevels > 1) {
239 | LevelSelect();
240 | } else {
241 | this.K = 4;
242 | a(true, 1);
243 | }
244 | } else if (str.equals(this.menuStrings[2])) {
245 | ShowHighScore();
246 | } else if (str.equals(this.menuStrings[3])) {
247 | ShowInstructions();
248 | } else if (str.equals("Read RMS")) {
249 | LoadRecords();
250 | } else if (str.equals("Write RMS")) {
251 | WriteToStore(1);
252 | WriteToStore(2);
253 | WriteToStore(3);
254 | }
255 | }
256 | } else if (cmd == this.commandBack || cmd == this.commandExit || cmd == this.i) {
257 | if (this.display.getCurrent() == this.c) {
258 | this.s.destroyApp(true);
259 | this.s.notifyDestroyed();
260 | } else {
261 | ShowMainMenu();
262 | }
263 | } else if (cmd == this.commandContinue) {
264 | this.K = 1;
265 | this.display.setCurrent(this.v);
266 | }
267 | }
268 |
269 | public void LoadRecords() {
270 | byte[] maxLevelsArray = new byte[1];
271 | byte[] highScoreArray = new byte[4];
272 | byte[] arrayOfByte3 = new byte[255];
273 | Object object = null;
274 | try {
275 | RecordStore recordStore = RecordStore.openRecordStore("bounceRMS", true);
276 | if (recordStore.getNumRecords() != 3) {
277 | recordStore.addRecord(maxLevelsArray, 0, maxLevelsArray.length);
278 | recordStore.addRecord(highScoreArray, 0, highScoreArray.length);
279 | recordStore.addRecord(arrayOfByte3, 0, arrayOfByte3.length);
280 | } else {
281 | maxLevelsArray = recordStore.getRecord(1);
282 | highScoreArray = recordStore.getRecord(2);
283 | arrayOfByte3 = recordStore.getRecord(3);
284 | ByteArrayInputStream recordBAIS = new ByteArrayInputStream(maxLevelsArray);
285 | DataInputStream recordDIS = new DataInputStream(recordBAIS);
286 | this.MaxLevels = recordDIS.readByte();
287 | recordBAIS = new ByteArrayInputStream(highScoreArray);
288 | recordDIS = new DataInputStream(recordBAIS);
289 | this.HighScore = recordDIS.readInt();
290 | recordBAIS = new ByteArrayInputStream(arrayOfByte3);
291 | recordDIS = new DataInputStream(recordBAIS);
292 | this.LastRecordTimestampMillis = recordDIS.readLong();
293 | this.J = recordDIS.readByte();
294 | this.RecordLives = recordDIS.readByte();
295 | this.RecordHoopsScored = recordDIS.readByte();
296 | this.RecordLevel = recordDIS.readByte();
297 | this.A = recordDIS.readByte();
298 | this.RecordScore = recordDIS.readInt();
299 | this.I = recordDIS.readInt();
300 | this.H = recordDIS.readInt();
301 | this.y = recordDIS.readInt();
302 | this.M = recordDIS.readInt();
303 | this.a = recordDIS.readInt();
304 | this.g = recordDIS.readInt();
305 | recordDIS.readInt();
306 | recordDIS.readInt();
307 | this.e = recordDIS.readInt();
308 | this.b = recordDIS.readInt();
309 | this.w = recordDIS.readInt();
310 | this.z = recordDIS.readInt();
311 | this.n = recordDIS.readInt();
312 | this.p = recordDIS.readByte();
313 | this.u = new int[this.p][3];
314 | for (byte b1 = 0; b1 < this.p; b1++) {
315 | this.u[b1][0] = recordDIS.readShort();
316 | this.u[b1][1] = recordDIS.readShort();
317 | this.u[b1][2] = recordDIS.readByte();
318 | }
319 | this.r = recordDIS.readByte();
320 | this.D = new Vec2S[this.r];
321 | this.l = new short[this.r][2];
322 | for (byte b2 = 0; b2 < this.r; b2++) {
323 | this.D[b2].x = recordDIS.readShort();
324 | this.D[b2].y = recordDIS.readShort();
325 | this.l[b2][0] = recordDIS.readShort();
326 | this.l[b2][1] = recordDIS.readShort();
327 | }
328 | if (recordDIS.readLong() != RECORD_STORE_MAGIC)
329 | this.J = 0;
330 | }
331 | recordStore.closeRecordStore();
332 | } catch (Exception exception) {
333 | this.J = 0;
334 | }
335 | }
336 |
337 | public void WriteToStore(int what) {
338 | ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
339 | DataOutputStream dataOutputStream = new DataOutputStream(byteArrayOutputStream);
340 | Object object = null;
341 | try {
342 | byte b1;
343 | int[][] arrayOfInt;
344 | byte b2;
345 | byte b3;
346 | byte b4;
347 | byte thorn;
348 | switch (what) {
349 | case 1 -> dataOutputStream.writeByte(this.MaxLevels);
350 | case 2 -> dataOutputStream.writeInt(this.HighScore);
351 | case 3 -> {
352 | if (this.v == null || this.v.aq == null)
353 | return;
354 | b1 = 0;
355 | if (this.K == 1) {
356 | b1 = 1;
357 | } else if (this.K == 5) {
358 | b1 = 2;
359 | }
360 | dataOutputStream.writeLong(System.currentTimeMillis());
361 | dataOutputStream.writeByte(b1);
362 | dataOutputStream.writeByte(this.v.lives);
363 | dataOutputStream.writeByte(this.v.HoopsScored);
364 | dataOutputStream.writeByte(this.v.level);
365 | dataOutputStream.writeByte(this.v.aq.ballSize);
366 | dataOutputStream.writeInt(this.v.score);
367 | dataOutputStream.writeInt(this.v.l);
368 | dataOutputStream.writeInt(this.v.k);
369 | dataOutputStream.writeInt(this.v.aq.TODO_unkX);
370 | dataOutputStream.writeInt(this.v.aq.TODO_unkY);
371 | dataOutputStream.writeInt(this.v.aq.l);
372 | dataOutputStream.writeInt(this.v.aq.o);
373 | dataOutputStream.writeInt(0);
374 | dataOutputStream.writeInt(0);
375 | dataOutputStream.writeInt(this.v.aq.d);
376 | dataOutputStream.writeInt(this.v.aq.c);
377 | dataOutputStream.writeInt(this.v.aq.TODO_somePowerUp1);
378 | dataOutputStream.writeInt(this.v.aq.powerUpGravity);
379 | dataOutputStream.writeInt(this.v.aq.TODO_somePowerUp3);
380 | arrayOfInt = new int[50][3];
381 | b2 = 0;
382 | for (b3 = 0; b3 < this.v.TODO_height; b3++) {
383 | for (byte b = 0; b < this.v.TODO_width; b++) {
384 | byte b6 = (byte) (this.v.LevelTiles[b3][b] & 0xFF7F & (~0x40));
385 | if (b6 == 7 || b6 == 29 || b6 == 13 || b6 == 14 || b6 == 21 || b6 == 22 || b6 == 15 || b6 == 16 || b6 == 23 || b6 == 24) {
386 | arrayOfInt[b2][0] = b3;
387 | arrayOfInt[b2][1] = b;
388 | arrayOfInt[b2][2] = b6;
389 | b2++;
390 | }
391 | }
392 | }
393 | dataOutputStream.writeByte(b2);
394 | for (b4 = 0; b4 < b2; b4++) {
395 | dataOutputStream.writeShort(arrayOfInt[b4][0]);
396 | dataOutputStream.writeShort(arrayOfInt[b4][1]);
397 | dataOutputStream.writeByte(arrayOfInt[b4][2]);
398 | }
399 | arrayOfInt = null;
400 | dataOutputStream.writeByte(this.v.DynThornsCount);
401 | for (thorn = 0; thorn < this.v.DynThornsCount; thorn++) {
402 | dataOutputStream.writeShort(this.v.w[thorn].x);
403 | dataOutputStream.writeShort(this.v.w[thorn].y);
404 | dataOutputStream.writeShort(this.v.ae[thorn].x);
405 | dataOutputStream.writeShort(this.v.ae[thorn].y);
406 | }
407 | dataOutputStream.writeLong(RECORD_STORE_MAGIC);
408 | }
409 | }
410 | RecordStore recordStore = RecordStore.openRecordStore("bounceRMS", true);
411 | recordStore.setRecord(what, byteArrayOutputStream.toByteArray(), 0, byteArrayOutputStream.size());
412 | recordStore.closeRecordStore();
413 | } catch (Exception exception) {
414 | }
415 | }
416 |
417 | public void WriteToStore() {
418 | if (this.v.level > this.MaxLevels) {
419 | this.MaxLevels = Math.min(this.v.level, 11);
420 | WriteToStore(1);
421 | }
422 | if (this.v.score > this.HighScore) {
423 | this.HighScore = this.v.score;
424 | this.q = true;
425 | WriteToStore(2);
426 | }
427 | this.E = this.v.score;
428 | }
429 |
430 | public void TODO_ShowInstructions(boolean paramBoolean) {
431 | this.K = 3;
432 | this.J = 0;
433 | this.v.H = false;
434 | ShowGameEnd(paramBoolean);
435 | }
436 | }
437 |
438 |
439 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\a.class
440 | * Java compiler version: 1 (45.3)
441 | * JD-Core Version: 1.1.3
442 | */
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/e.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import com.nokia.mid.sound.Sound;
4 |
5 | import javax.microedition.lcdui.Font;
6 | import javax.microedition.lcdui.Graphics;
7 | import javax.microedition.lcdui.Image;
8 | import java.io.DataInputStream;
9 | import java.io.IOException;
10 | import java.util.Objects;
11 |
12 | public class e extends b {
13 | public int SplashId;
14 |
15 | public Image ImageSplash;
16 |
17 | private int splashTimer;
18 |
19 | public Sound soundUp;
20 |
21 | public Sound soundPickup;
22 |
23 | public Sound soundPop;
24 |
25 | public BounceGame game;
26 |
27 | public f aq;
28 |
29 | public int HoopsScored;
30 |
31 | public int lives;
32 |
33 | public int score;
34 |
35 | public int boostTimer;
36 |
37 | public int p;
38 |
39 | public boolean e;
40 |
41 | public boolean TODO_ExitUnlocked;
42 |
43 | public boolean y;
44 |
45 | public final Font font = Font.getFont(32, 0, 8);
46 |
47 | public Image imageFullscreen;
48 |
49 | public Graphics X = null;
50 |
51 | public boolean T;
52 |
53 | private boolean af = false;
54 |
55 | public boolean GodMode = false;
56 |
57 | private int g = 0;
58 |
59 | private static final String[] SPLASHES = new String[]{"/icons/nokiagames.png", "/icons/bouncesplash.png"};
60 |
61 | public boolean H = true;
62 |
63 | private long K = System.currentTimeMillis();
64 |
65 | public e(BounceGame game, int paramInt) {
66 | super(game.display);
67 | this.game = game;
68 | this.soundUp = LoadSound("/sounds/up.ott");
69 | this.soundPickup = LoadSound("/sounds/pickup.ott");
70 | this.soundPop = LoadSound("/sounds/pop.ott");
71 | this.imageFullscreen = Image.createImage(128, 128);
72 | this.SplashId = 1;
73 | try {
74 | this.ImageSplash = Image.createImage(SPLASHES[this.SplashId]);
75 | } catch (IOException iOException) {
76 | this.ImageSplash = Image.createImage(1, 1);
77 | }
78 | StartGameTimer();
79 | }
80 |
81 | public void a(int level, int paramInt2, int paramInt3) {
82 | this.level = level;
83 | this.HoopsScored = 0;
84 | this.lives = paramInt3;
85 | this.score = paramInt2;
86 | this.e = false;
87 | this.TODO_ExitUnlocked = false;
88 | InitializeGame();
89 | this.T = true;
90 | }
91 |
92 | public void a(int paramInt1, int paramInt2) {
93 | this.level = this.game.RecordLevel;
94 | this.HoopsScored = this.game.RecordHoopsScored;
95 | this.lives = this.game.RecordLives;
96 | this.score = this.game.RecordScore;
97 | RunGarbageCollector();
98 | LoadLevelId(this.level);
99 | k();
100 | AddScore();
101 | this.p = 120;
102 | this.y = true;
103 | if (this.game.e != this.TODO_ballInitialX && this.game.b != this.TODO_ballInitialY)
104 | this.LevelTiles[this.game.b][this.game.e] = (short) (0x8 | this.LevelTiles[this.game.b][this.game.e] & 0x40);
105 | a(paramInt1, paramInt2, this.game.A, this.game.a, this.game.g);
106 | synchronized (this.aq) {
107 | this.aq.a(this.game.e, this.game.b);
108 | this.aq.TODO_somePowerUp1 = this.game.w;
109 | this.aq.powerUpGravity = this.game.z;
110 | this.aq.TODO_somePowerUp3 = this.game.n;
111 | this.T = true;
112 | }
113 | }
114 |
115 | private void InitializeGame() {
116 | RunGarbageCollector();
117 | LoadLevelId(this.level);
118 | this.HoopsScored = 0;
119 | this.p = 120;
120 | this.y = true;
121 | a(this.TODO_ballInitialX * 12 + 6, this.TODO_ballInitialY * 12 + 6, this.BallSize, 0, 0);
122 | this.aq.a(this.TODO_ballInitialX, this.TODO_ballInitialY);
123 | this.T = true;
124 | }
125 |
126 | public void a(int paramInt1, int paramInt2, int ballSize, int paramInt4, int paramInt5) {
127 | this.aq = new f(paramInt1, paramInt2, ballSize, this);
128 | this.aq.l = paramInt4;
129 | this.aq.o = paramInt5;
130 | this.l = 0;
131 | this.k = 0;
132 | e();
133 | }
134 |
135 | public void e() {
136 | int i = this.aq.TODO_unkX - 64;
137 | if (i < 0) {
138 | i = 0;
139 | } else if (i > this.TODO_width * 12 - 156) {
140 | i = this.TODO_width * 12 - 156;
141 | }
142 | this.l = i / 12;
143 | this.v = this.l * 12 - i;
144 | this.Z = 156;
145 | this.G = this.l + 13;
146 | while (this.aq.TODO_unkY - 6 < this.k * 12)
147 | this.k -= 7;
148 | while (this.aq.TODO_unkY + 6 > this.k * 12 + 96)
149 | this.k += 7;
150 | f();
151 | }
152 |
153 | public void AddScore(int paramInt) {
154 | this.score += paramInt;
155 | this.y = true;
156 | }
157 |
158 | public void q() {
159 | if (this.X == null)
160 | this.X = this.imageFullscreen.getGraphics();
161 | this.X.setClip(0, 0, 128, 96);
162 | if (this.E != null) {
163 | i();
164 | if (this.v <= 0) {
165 | this.X.drawImage(this.E, this.v, 0, 20);
166 | } else {
167 | this.X.drawImage(this.E, this.v, 0, 20);
168 | this.X.drawImage(this.E, this.v - 156, 0, 20);
169 | }
170 | }
171 | a(this.X, this.v);
172 | CreateTiles(this.X, this.aq.TODO_unkX, this.aq.TODO_unkY, this.aq.p, this.v);
173 | this.X.setClip(0, 0, 128, 128);
174 | if (this.y) {
175 | this.X.setColor(0x0853aa); // Blue background
176 | this.X.fillRect(0, 97, 128, 32);
177 | for (byte b1 = 0; b1 < this.lives; b1++)
178 | this.X.drawImage(this.imageBall, 5 + b1 * (this.imageBall.getWidth() - 1), 99, Graphics.TOP | Graphics.LEFT);
179 | for (byte b2 = 0; b2 < this.HoopsTotal - this.HoopsScored; b2++)
180 | this.X.drawImage(this.imageHoop, 5 + b2 * (this.imageHoop.getWidth() - 4), 112, Graphics.TOP | Graphics.LEFT);
181 | this.X.setColor(0xfffffe);
182 | this.X.setFont(this.font);
183 | this.X.drawString(PadZeroes(this.score), 64, 100, Graphics.TOP | Graphics.LEFT);
184 | if (this.boostTimer != 0) {
185 | this.X.setColor(0xff9813);
186 | this.X.fillRect(1, 128 - 3 * this.boostTimer / 30, 5, 128);
187 | }
188 | this.y = false;
189 | }
190 | }
191 |
192 | public void paint(Graphics paramGraphics) {
193 | if (this.SplashId != -1) {
194 | if (this.ImageSplash != null) {
195 | paramGraphics.setColor(0x000000);
196 | paramGraphics.fillRect(0, 0, this.displayWidth, this.displayHeight);
197 | paramGraphics.drawImage(this.ImageSplash, this.displayWidth >> 1, this.displayHeight >> 1, Graphics.HCENTER | Graphics.VCENTER);
198 | }
199 | } else {
200 | paramGraphics.drawImage(this.imageFullscreen, 0, 0, 20);
201 | if (this.p != 0) {
202 | paramGraphics.setColor(0xfffffe);
203 | paramGraphics.setFont(this.font);
204 | paramGraphics.drawString(this.LevelString, 44, 84, 20);
205 | }
206 | }
207 | }
208 |
209 | public void a(Graphics paramGraphics, int paramInt) {
210 | if (this.aq == null)
211 | return;
212 | int i = this.aq.TODO_unkX - this.l * 12;
213 | int j = this.aq.TODO_unkY - this.k * 12;
214 | if (this.aq.z == 2) {
215 | paramGraphics.drawImage(this.aq.spritePoppedBall, i - 6 + paramInt, j - 6, 20);
216 | } else {
217 | paramGraphics.drawImage(this.aq.spriteCurrentBall, i - this.aq.p + paramInt, j - this.aq.p, 20);
218 | }
219 | }
220 |
221 | public void Tick() {
222 | if (this.d) {
223 | InitializeGame();
224 | repaint();
225 | return;
226 | }
227 | if (this.SplashId != -1) {
228 | if (this.ImageSplash == null/* || this.t == null*/) { // TODO: this is what I got from JD-GUI. I wonder why...
229 | this.H = false;
230 | this.game.ShowMainMenu();
231 | } else if (this.splashTimer > 30) {
232 | this.ImageSplash = null;
233 | Runtime.getRuntime().gc();
234 | switch (this.SplashId) {
235 | case 0 -> { // Switch to the next splash
236 | this.SplashId = 1;
237 | try {
238 | this.ImageSplash = Image.createImage(SPLASHES[this.SplashId]);
239 | } catch (IOException iOException) {
240 | this.ImageSplash = Image.createImage(1, 1);
241 | }
242 | repaint();
243 | }
244 | case 1 -> { // Open the main menu
245 | this.SplashId = -1;
246 | this.H = false;
247 | this.game.ShowMainMenu();
248 | }
249 | }
250 | this.splashTimer = 0;
251 | } else {
252 | this.splashTimer++;
253 | }
254 | repaint();
255 | return;
256 | }
257 |
258 | if (this.p != 0)
259 | this.p--;
260 |
261 | synchronized (this.aq) {
262 | if (this.aq.TODO_unkY - 6 < this.k * 12 || this.aq.TODO_unkY + 6 > this.k * 12 + 96) {
263 | e();
264 | } else {
265 | this.aq.b();
266 | }
267 | if (this.aq.z == 1) {
268 | if (this.lives < 0) {
269 | this.game.WriteToStore();
270 | StopGameTimer();
271 | this.game.TODO_ShowInstructions(false);
272 | return;
273 | }
274 | int i = this.aq.d;
275 | int j = this.aq.c;
276 | int k = this.aq.b;
277 | a(this.aq.d * 12 + 6, this.aq.c * 12 + 6, this.aq.b, 0, 0);
278 | this.aq.d = i;
279 | this.aq.c = j;
280 | this.aq.b = k;
281 | }
282 | if (this.DynThornsCount != 0)
283 | UpdateDynThorns();
284 | if (this.HoopsScored == this.HoopsTotal)
285 | this.TODO_ExitUnlocked = true;
286 | if (this.TODO_ExitUnlocked && this.z && (this.exitX + 1) * 12 > m() && this.exitX * 12 < g()) {
287 | if (this.M) {
288 | this.z = false;
289 | this.TODO_ExitUnlocked = false;
290 | } else {
291 | h();
292 | }
293 | this.LevelTiles[this.tileY][this.tileX] = (short) (this.LevelTiles[this.tileY][this.tileX] | 0x80);
294 | this.LevelTiles[this.tileY][this.tileX + 1] = (short) (this.LevelTiles[this.tileY][this.tileX + 1] | 0x80);
295 | this.LevelTiles[this.tileY + 1][this.tileX] = (short) (this.LevelTiles[this.tileY + 1][this.tileX] | 0x80);
296 | this.LevelTiles[this.tileY + 1][this.tileX + 1] = (short) (this.LevelTiles[this.tileY + 1][this.tileX + 1] | 0x80);
297 | }
298 | this.boostTimer = 0;
299 | if (this.aq.TODO_somePowerUp1 != 0 || this.aq.powerUpGravity != 0 || this.aq.TODO_somePowerUp3 != 0) {
300 | if (this.aq.TODO_somePowerUp1 > this.boostTimer)
301 | this.boostTimer = this.aq.TODO_somePowerUp1;
302 | if (this.aq.powerUpGravity > this.boostTimer)
303 | this.boostTimer = this.aq.powerUpGravity;
304 | if (this.aq.TODO_somePowerUp3 > this.boostTimer)
305 | this.boostTimer = this.aq.TODO_somePowerUp3;
306 | if (this.boostTimer % 30 == 0 || this.boostTimer == 1)
307 | this.y = true;
308 | }
309 | }
310 | LoadSpriteSheet(this.aq.TODO_unkX);
311 | q();
312 | repaint();
313 | if (this.e) {
314 | this.e = false;
315 | this.TODO_ExitUnlocked = false;
316 | this.d = true;
317 | this.level++;
318 | AddScore(5000);
319 | this.game.WriteToStore();
320 | if (this.level > 11) {
321 | this.game.TODO_ShowInstructions(true);
322 | } else {
323 | this.H = false;
324 | this.game.ShowLevelComplete();
325 | repaint();
326 | }
327 | }
328 | }
329 |
330 | public void keyPressed(int paramInt) {
331 | if (this.SplashId != -1) { // Skip the splash screen
332 | this.splashTimer = 31;
333 | return;
334 | }
335 | if (this.aq == null)
336 | return;
337 | synchronized (this.aq) {
338 | switch (paramInt) {
339 | case 49:
340 | this.d = true;
341 | if (this.af && --this.level < 1)
342 | this.level = 11;
343 | break;
344 | case 51:
345 | this.d = true;
346 | if (this.af && ++this.level > 11)
347 | this.level = 1;
348 | break;
349 | case 55:
350 | if (this.g == 0 || this.g == 2) {
351 | this.g++;
352 | break;
353 | }
354 | this.g = 0;
355 | break;
356 | case 56:
357 | if (this.g == 1 || this.g == 3) {
358 | this.g++;
359 | break;
360 | }
361 | if (this.g == 5) {
362 | this.soundUp.play(1);
363 | this.GodMode = true;
364 | this.g = 0;
365 | break;
366 | }
367 | this.g = 0;
368 | break;
369 | case 57:
370 | if (this.g == 4) {
371 | this.g++;
372 | break;
373 | }
374 | if (this.g == 5) {
375 | this.soundPop.play(1);
376 | this.af = true;
377 | this.g = 0;
378 | break;
379 | }
380 | this.g = 0;
381 | break;
382 | case 35:
383 | if (this.af)
384 | this.aq.powerUpGravity = 300;
385 | break;
386 | case -7:
387 | case -6:
388 | this.H = false;
389 | this.game.ShowMainMenu();
390 | break;
391 | default:
392 | switch (getGameAction(paramInt)) {
393 | case 1:
394 | this.aq.c(8);
395 | break;
396 | case 6:
397 | this.aq.c(4);
398 | break;
399 | case 2:
400 | this.aq.c(1);
401 | break;
402 | case 5:
403 | this.aq.c(2);
404 | break;
405 | case 8:
406 | if (this.af)
407 | this.e = true;
408 | break;
409 | }
410 | break;
411 | }
412 | }
413 | }
414 |
415 | public void keyReleased(int paramInt) {
416 | if (this.aq == null)
417 | return;
418 | synchronized (this.aq) {
419 | switch (getGameAction(paramInt)) {
420 | case 1:
421 | this.aq.a(8);
422 | break;
423 | case 6:
424 | this.aq.a(4);
425 | break;
426 | case 2:
427 | this.aq.a(1);
428 | break;
429 | case 5:
430 | this.aq.a(2);
431 | break;
432 | }
433 | }
434 | }
435 |
436 | public static String PadZeroes(int number) {
437 | String str;
438 | if (number < 100) {
439 | str = "0000000";
440 | } else if (number < 1000) {
441 | str = "00000";
442 | } else if (number < 10000) {
443 | str = "0000";
444 | } else if (number < 100000) {
445 | str = "000";
446 | } else if (number < 1000000) {
447 | str = "00";
448 | } else if (number < 10000000) {
449 | str = "0";
450 | } else {
451 | str = "";
452 | }
453 | return str + number;
454 | }
455 |
456 | protected Sound LoadSound(String path) {
457 | byte[] buffer = new byte[100];
458 | Sound sound = null;
459 | DataInputStream dataInputStream = new DataInputStream(Objects.requireNonNull(getClass().getResourceAsStream(path)));
460 | try {
461 | int i = dataInputStream.read(buffer);
462 | dataInputStream.close();
463 | byte[] bufferExactSize = new byte[i];
464 | System.arraycopy(buffer, 0, bufferExactSize, 0, i);
465 | sound = new Sound(bufferExactSize, Sound.FORMAT_TONE);
466 | } catch (IOException iOException) {
467 | sound = new Sound(1000, 500L); // Fallback, play a 1000Hz tone 3 times
468 | sound.play(3);
469 | }
470 | return sound;
471 | }
472 |
473 | public void hideNotify() {
474 | if (this.H) {
475 | if (this.aq != null)
476 | this.aq.a();
477 | this.game.ShowMainMenu();
478 | }
479 | this.H = true;
480 | }
481 |
482 | public void AddScore() {
483 | for (byte b1 = 0; b1 < this.game.r; b1++) {
484 | this.ae[b1].x = this.game.l[b1][0];
485 | this.ae[b1].y = this.game.l[b1][1];
486 | this.w[b1].x = this.game.D[b1].x;
487 | this.w[b1].y = this.game.D[b1].y;
488 | }
489 | this.game.D = null;
490 | this.game.l = null;
491 | this.game.r = 0;
492 | }
493 |
494 | public void k() {
495 | for (byte b1 = 0; b1 < this.TODO_height; b1++) {
496 | for (byte b2 = 0; b2 < this.TODO_width; b2++) {
497 | byte b3 = (byte) (this.LevelTiles[b1][b2] & 0xFF7F & (~0x40));
498 | switch (b3) {
499 | case 7, 29 -> {
500 | if (a(b1, b2, b3))
501 | this.LevelTiles[b1][b2] = (short) (0x0 | this.LevelTiles[b1][b2] & 0x40);
502 | }
503 | case 13 -> {
504 | if (a(b1, b2, b3))
505 | this.LevelTiles[b1][b2] = (short) (0x11 | this.LevelTiles[b1][b2] & 0x40);
506 | }
507 | case 14 -> {
508 | if (a(b1, b2, b3))
509 | this.LevelTiles[b1][b2] = (short) (0x12 | this.LevelTiles[b1][b2] & 0x40);
510 | }
511 | case 21 -> {
512 | if (a(b1, b2, b3))
513 | this.LevelTiles[b1][b2] = (short) (0x19 | this.LevelTiles[b1][b2] & 0x40);
514 | }
515 | case 22 -> {
516 | if (a(b1, b2, b3))
517 | this.LevelTiles[b1][b2] = (short) (0x1A | this.LevelTiles[b1][b2] & 0x40);
518 | }
519 | case 15 -> {
520 | if (a(b1, b2, b3))
521 | this.LevelTiles[b1][b2] = (short) (0x13 | this.LevelTiles[b1][b2] & 0x40);
522 | }
523 | case 16 -> {
524 | if (a(b1, b2, b3))
525 | this.LevelTiles[b1][b2] = (short) (0x14 | this.LevelTiles[b1][b2] & 0x40);
526 | }
527 | case 23 -> {
528 | if (a(b1, b2, b3))
529 | this.LevelTiles[b1][b2] = (short) (0x1B | this.LevelTiles[b1][b2] & 0x40);
530 | }
531 | case 24 -> {
532 | if (a(b1, b2, b3))
533 | this.LevelTiles[b1][b2] = (short) (0x1C | this.LevelTiles[b1][b2] & 0x40);
534 | }
535 | }
536 | }
537 | }
538 | this.game.u = null;
539 | this.game.p = 0;
540 | }
541 |
542 | public boolean a(int paramInt1, int paramInt2, byte paramByte) {
543 | for (byte b1 = 0; b1 < this.game.p; b1++) {
544 | if (this.game.u[b1][0] == paramInt1 && this.game.u[b1][1] == paramInt2)
545 | return false;
546 | }
547 | return true;
548 | }
549 | }
550 |
551 |
552 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\e.class
553 | * Java compiler version: 1 (45.3)
554 | * JD-Core Version: 1.1.3
555 | */
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/f.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import com.nokia.mid.sound.Sound;
4 |
5 | import javax.microedition.lcdui.Image;
6 |
7 | public class f {
8 | private boolean j = true;
9 |
10 | public int TODO_unkX;
11 |
12 | public int TODO_unkY;
13 |
14 | public int l;
15 |
16 | public int o;
17 |
18 | public int w;
19 |
20 | public int ballSize;
21 |
22 | public int p;
23 |
24 | public int d;
25 |
26 | public int c;
27 |
28 | public int b;
29 |
30 | public int z;
31 |
32 | public int t;
33 |
34 | public int TODO_somePowerUp1;
35 |
36 | public int powerUpGravity;
37 |
38 | public int TODO_somePowerUp3;
39 |
40 | public boolean m;
41 |
42 | public boolean v;
43 |
44 | public boolean u;
45 |
46 | public int C;
47 |
48 | public static final byte[][] SLOPE_COLLISION = new byte[][] {
49 | {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1},
50 | {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1},
51 | {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1},
52 | {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1},
53 | {0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1},
54 | {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1},
55 | {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1},
56 | {0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1},
57 | {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1},
58 | {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
59 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
60 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}
61 | };
62 |
63 | public static final byte[][] BALL_COLLISION = new byte[][] {
64 | {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0},
65 | {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
66 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
67 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
68 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
69 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
70 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
71 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
72 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
73 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
74 | {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
75 | {0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0}
76 | };
77 |
78 | public static final byte[][] BIG_BALL_COLLISION = new byte[][] {
79 | {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0},
80 | {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
81 | {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
82 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
83 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
84 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
85 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
86 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
87 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
88 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
89 | {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},
90 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
91 | {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0},
92 | {0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0},
93 | {0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0},
94 | {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0}
95 | };
96 |
97 | public e n;
98 |
99 | public Image spriteCurrentBall;
100 |
101 | public Image spritePoppedBall;
102 |
103 | public Image spriteBigBall;
104 |
105 | public Image spriteBall;
106 |
107 | private int q;
108 |
109 | public f(int paramInt1, int paramInt2, int ballSize, e parame) {
110 | this.TODO_unkX = paramInt1;
111 | this.TODO_unkY = paramInt2;
112 | this.l = 0;
113 | this.o = 0;
114 | this.n = parame;
115 | this.t = 0;
116 | this.m = false;
117 | this.v = false;
118 | this.u = false;
119 | this.q = 0;
120 | this.TODO_somePowerUp1 = 0;
121 | this.powerUpGravity = 0;
122 | this.TODO_somePowerUp3 = 0;
123 | this.C = 0;
124 | this.z = 0;
125 | this.w = 0;
126 | this.n.CreateTiles(this);
127 | if (ballSize == 12) {
128 | UseRegularBall();
129 | } else {
130 | UseBigBall();
131 | }
132 | }
133 |
134 | public void a(int tileX, int tileY) {
135 | this.d = tileX;
136 | this.c = tileY;
137 | this.b = this.ballSize;
138 | }
139 |
140 | public void c(int paramInt) {
141 | if (paramInt == 8 || paramInt == 4 || paramInt == 2 || paramInt == 1)
142 | this.w |= paramInt;
143 | }
144 |
145 | public void a(int paramInt) {
146 | if (paramInt == 8 || paramInt == 4 || paramInt == 2 || paramInt == 1)
147 | this.w &= ~paramInt;
148 | }
149 |
150 | public void a() {
151 | this.w &= 0xFFFFFFF0;
152 | }
153 |
154 | public boolean TODO_CheckBallCollision(int x, int y) {
155 | int i = (x - this.p) / 12;
156 | int j = (y - this.p) / 12;
157 | int k = (x - 1 + this.p) / 12 + 1;
158 | int m = (y - 1 + this.p) / 12 + 1;
159 | for (int tileX = i; tileX < k; tileX++) {
160 | for (int tileY = j; tileY < m; tileY++) {
161 | if (!a(x, y, tileY, tileX))
162 | return false;
163 | }
164 | }
165 | return true;
166 | }
167 |
168 | public void UseBigBall() {
169 | this.ballSize = 16;
170 | this.p = 8;
171 | this.spriteCurrentBall = this.spriteBigBall;
172 |
173 | // Try to solve any collisions with the world
174 | boolean TODO_collidesWithLevel = false;
175 | for (byte offset = 1; !TODO_collidesWithLevel; offset++) {
176 | TODO_collidesWithLevel = true;
177 | if (TODO_CheckBallCollision(this.TODO_unkX, this.TODO_unkY - offset)) {
178 | this.TODO_unkY -= offset;
179 | continue;
180 | }
181 | if (TODO_CheckBallCollision(this.TODO_unkX - offset, this.TODO_unkY - offset)) {
182 | this.TODO_unkX -= offset;
183 | this.TODO_unkY -= offset;
184 | continue;
185 | }
186 | if (TODO_CheckBallCollision(this.TODO_unkX + offset, this.TODO_unkY - offset)) {
187 | this.TODO_unkX += offset;
188 | this.TODO_unkY -= offset;
189 | continue;
190 | }
191 | if (TODO_CheckBallCollision(this.TODO_unkX, this.TODO_unkY + offset)) {
192 | this.TODO_unkY += offset;
193 | continue;
194 | }
195 | if (TODO_CheckBallCollision(this.TODO_unkX - offset, this.TODO_unkY + offset)) {
196 | this.TODO_unkX -= offset;
197 | this.TODO_unkY += offset;
198 | continue;
199 | }
200 | if (TODO_CheckBallCollision(this.TODO_unkX + offset, this.TODO_unkY + offset)) {
201 | this.TODO_unkX += offset;
202 | this.TODO_unkY += offset;
203 | continue;
204 | }
205 | TODO_collidesWithLevel = false;
206 | }
207 | }
208 |
209 | public void UseRegularBall() {
210 | this.ballSize = 12;
211 | this.p = 6;
212 | this.spriteCurrentBall = this.spriteBall;
213 | }
214 |
215 | public void KillBall() {
216 | if (!this.n.GodMode) {
217 | this.q = 7;
218 | this.z = 2;
219 | this.n.lives--;
220 | this.TODO_somePowerUp1 = 0;
221 | this.powerUpGravity = 0;
222 | this.TODO_somePowerUp3 = 0;
223 | this.n.y = true;
224 | this.n.soundPop.play(1);
225 | }
226 | }
227 |
228 | public void OnTouchHoop() {
229 | this.n.AddScore(500);
230 | this.n.HoopsScored++;
231 | this.n.y = true;
232 | }
233 |
234 | public void b(int paramInt) {
235 | int i = this.l;
236 | switch (paramInt) {
237 | case 35 -> {
238 | this.l = (this.l > -this.o) ? this.l : this.o;
239 | this.o = i;
240 | }
241 | case 37 -> {
242 | this.l = (-this.l > this.o) ? this.l : this.o;
243 | this.o = i;
244 | }
245 | case 34 -> {
246 | this.l = (this.l < this.o) ? this.l : -this.o;
247 | this.o = -i;
248 | }
249 | case 36 -> {
250 | this.l = (this.l > this.o) ? this.l : -this.o;
251 | this.o = -i;
252 | }
253 | case 31 -> {
254 | this.l = (this.l > -this.o) ? this.l : (this.o >> 1);
255 | this.o = i;
256 | }
257 | case 33 -> {
258 | this.l = (-this.l > this.o) ? this.l : (this.o >> 1);
259 | this.o = i;
260 | }
261 | case 30 -> {
262 | this.l = (this.l < this.o) ? this.l : -(this.o >> 1);
263 | this.o = -i;
264 | }
265 | case 32 -> {
266 | this.l = (this.l > this.o) ? this.l : -(this.o >> 1);
267 | this.o = -i;
268 | }
269 | }
270 | }
271 |
272 | public boolean TODO_CheckWallCollision(int paramInt1, int paramInt2, int tileY, int tileX) {
273 | byte b1;
274 | int n;
275 | byte b2;
276 | int i1;
277 | byte[][] ballCollision;
278 | int i = tileX * 12;
279 | int j = tileY * 12;
280 | int k = paramInt1 - this.p - i;
281 | int m = paramInt2 - this.p - j;
282 | if (k >= 0) {
283 | b1 = (byte) k;
284 | n = 12;
285 | } else {
286 | b1 = 0;
287 | n = this.ballSize + k;
288 | }
289 | if (m >= 0) {
290 | b2 = (byte) m;
291 | i1 = 12;
292 | } else {
293 | b2 = 0;
294 | i1 = this.ballSize + m;
295 | }
296 | if (this.ballSize == 16) {
297 | ballCollision = BIG_BALL_COLLISION;
298 | } else {
299 | ballCollision = BALL_COLLISION;
300 | }
301 | if (n > 12)
302 | n = 12;
303 | if (i1 > 12)
304 | i1 = 12;
305 | for (byte b3 = b1; b3 < n; b3++) {
306 | for (byte b = b2; b < i1; b++) {
307 | if (ballCollision[b - m][b3 - k] != 0)
308 | return true;
309 | }
310 | }
311 | return false;
312 | }
313 |
314 | public boolean c(int paramInt1, int paramInt2, int y, int x, int tileId) {
315 | byte b3;
316 | int n;
317 | byte b4;
318 | int i1;
319 | byte[][] ballCollision;
320 | int i = x * 12;
321 | int j = y * 12;
322 | int k = paramInt1 - this.p - i;
323 | int m = paramInt2 - this.p - j;
324 | byte b1 = 0;
325 | byte b2 = 0;
326 | switch (tileId) {
327 | case 30, 34 -> {
328 | b2 = 11;
329 | b1 = 11;
330 | }
331 | case 31, 35 -> b2 = 11;
332 | case 33, 37 -> b1 = 11;
333 | }
334 | if (k >= 0) {
335 | b3 = (byte) k;
336 | n = 12;
337 | } else {
338 | b3 = 0;
339 | n = this.ballSize + k;
340 | }
341 | if (m >= 0) {
342 | b4 = (byte) m;
343 | i1 = 12;
344 | } else {
345 | b4 = 0;
346 | i1 = this.ballSize + m;
347 | }
348 | if (this.ballSize == 16) {
349 | ballCollision = BIG_BALL_COLLISION;
350 | } else {
351 | ballCollision = BALL_COLLISION;
352 | }
353 | if (n > 12)
354 | n = 12;
355 | if (i1 > 12)
356 | i1 = 12;
357 | for (byte b5 = b3; b5 < n; b5++) {
358 | for (byte b = b4; b < i1; b++) {
359 | if ((SLOPE_COLLISION[Math.abs(b - b2)][Math.abs(b5 - b1)] & ballCollision[b - m][b5 - k]) != 0) {
360 | if (!this.m)
361 | b(tileId);
362 | return true;
363 | }
364 | }
365 | }
366 | return false;
367 | }
368 |
369 | public boolean b(int paramInt1, int paramInt2, int tileY, int tileX, int tileId) {
370 | int i = tileX * 12;
371 | int j = tileY * 12;
372 | int k = i + 12;
373 | int m = j + 12;
374 | switch (tileId) {
375 | case TileIDs.THORNS_UP, TileIDs.THORNS_DOWN, 9, 13, 14, 17, 18, 21, 22, 43, 45 -> {
376 | i += 4;
377 | k -= 4;
378 | }
379 | case TileIDs.THORNS_RIGHT, TileIDs.THORNS_LEFT, 15, 16, 19, 20, 23, 24, 44, 46 -> {
380 | j += 4;
381 | m -= 4;
382 | }
383 | }
384 | return a(paramInt1 - this.p, paramInt2 - this.p, paramInt1 + this.p - 1, paramInt2 + this.p - 1, i, j, k - 1, m - 1);
385 | }
386 |
387 | public boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5) {
388 | int i = paramInt4 * 12;
389 | int j = paramInt3 * 12;
390 | int k = i + 12;
391 | int m = j + 12;
392 | switch (paramInt5) {
393 | case 15, 19, 23, 27 -> {
394 | j += 6;
395 | m -= 6;
396 | k -= 11;
397 | }
398 | case 16, 20, 24, 28 -> {
399 | j += 6;
400 | m -= 6;
401 | i += 11;
402 | }
403 | case 13, 17 -> {
404 | i += 6;
405 | k -= 6;
406 | m -= 11;
407 | }
408 | case 21, 25 -> {
409 | m = j;
410 | j--;
411 | i += 6;
412 | k -= 6;
413 | }
414 | case 14, 18, 22, 26 -> {
415 | i += 6;
416 | k -= 6;
417 | j += 11;
418 | }
419 | }
420 | return a(paramInt1 - this.p, paramInt2 - this.p, paramInt1 + this.p, paramInt2 + this.p, i, j, k, m);
421 | }
422 |
423 | public boolean a(int x, int y, int tileY, int tileX) {
424 | int k;
425 | if (tileY >= this.n.TODO_height || tileY < 0 || tileX >= this.n.TODO_width || tileX < 0)
426 | return false;
427 | if (this.z == 2)
428 | return false;
429 | boolean bool = true;
430 | int isInWater = this.n.LevelTiles[tileY][tileX] & 0x40;
431 | int tileId = this.n.LevelTiles[tileY][tileX] & (~0x40) & (~0x80);
432 | Sound sound = null;
433 | switch (tileId) {
434 | case TileIDs.BRICK_WALL -> {
435 | if (TODO_CheckWallCollision(x, y, tileY, tileX)) {
436 | bool = false;
437 | this.u = true;
438 | break;
439 | }
440 | this.u = true;
441 | }
442 | case TileIDs.RUBBER_WALL -> {
443 | if (TODO_CheckWallCollision(x, y, tileY, tileX)) {
444 | this.v = true;
445 | bool = false;
446 | break;
447 | }
448 | this.u = true;
449 | }
450 | case 34, 35, 36, 37 -> {
451 | if (c(x, y, tileY, tileX, tileId)) {
452 | this.v = true;
453 | bool = false;
454 | this.u = true;
455 | }
456 | }
457 | case 30, 31, 32, 33 -> {
458 | if (c(x, y, tileY, tileX, tileId)) {
459 | bool = false;
460 | this.u = true;
461 | }
462 | }
463 | case 10 -> {
464 | k = this.n.TestPointInsideDynThorns(tileX, tileY);
465 | if (k != -1) {
466 | int m = this.n.DynThornsBottomLeft[k].x * 12 + this.n.w[k].x;
467 | int n = this.n.DynThornsBottomLeft[k].y * 12 + this.n.w[k].y;
468 | if (a(x - this.p + 1, y - this.p + 1, x + this.p - 1, y + this.p - 1, m + 1, n + 1, m + 24 - 1, n + 24 - 1)) {
469 | bool = false;
470 | KillBall();
471 | }
472 | }
473 | }
474 | case TileIDs.THORNS_UP, TileIDs.THORNS_RIGHT, TileIDs.THORNS_DOWN, TileIDs.THORNS_LEFT -> {
475 | if (b(x, y, tileY, tileX, tileId)) {
476 | bool = false;
477 | KillBall();
478 | }
479 | }
480 | case TileIDs.CRYSTAL -> {
481 | this.n.AddScore(200);
482 | this.n.LevelTiles[this.c][this.d] = 0x80 | TileIDs.EMPTY;
483 | a(tileX, tileY);
484 | this.n.LevelTiles[tileY][tileX] = 0x80 | TileIDs.CRYSTAL_ACTIVE;
485 | sound = this.n.soundPickup;
486 | }
487 | case 23 -> {
488 | if (b(x, y, tileY, tileX, tileId)) {
489 | if (a(x, y, tileY, tileX, tileId)) {
490 | bool = false;
491 | break;
492 | }
493 | OnTouchHoop();
494 | this.n.LevelTiles[tileY][tileX] = (short) (0x80 | 27 | isInWater);
495 | this.n.LevelTiles[tileY][tileX + 1] = (short) (0x80 | 28 | isInWater);
496 | sound = this.n.soundUp;
497 | }
498 | }
499 | case 15 -> {
500 | if (b(x, y, tileY, tileX, tileId)) {
501 | if (this.ballSize == 16) {
502 | bool = false;
503 | break;
504 | }
505 | if (a(x, y, tileY, tileX, tileId))
506 | bool = false;
507 | OnTouchHoop();
508 | this.n.LevelTiles[tileY][tileX] = (short) (0x93 | isInWater);
509 | this.n.LevelTiles[tileY][tileX + 1] = (short) (0x94 | isInWater);
510 | sound = this.n.soundUp;
511 | }
512 | }
513 | case 24 -> {
514 | if (b(x, y, tileY, tileX, tileId)) {
515 | if (a(x, y, tileY, tileX, tileId))
516 | bool = false;
517 | OnTouchHoop();
518 | this.n.LevelTiles[tileY][tileX] = (short) (0x9C | isInWater);
519 | this.n.LevelTiles[tileY][tileX - 1] = (short) (0x9B | isInWater);
520 | sound = this.n.soundUp;
521 | }
522 | }
523 | case 16 -> {
524 | if (b(x, y, tileY, tileX, tileId)) {
525 | if (this.ballSize == 16) {
526 | bool = false;
527 | break;
528 | }
529 | if (a(x, y, tileY, tileX, tileId))
530 | bool = false;
531 | OnTouchHoop();
532 | this.n.LevelTiles[tileY][tileX] = (short) (0x94 | isInWater);
533 | this.n.LevelTiles[tileY][tileX - 1] = (short) (0x93 | isInWater);
534 | sound = this.n.soundUp;
535 | }
536 | }
537 | case 21 -> {
538 | if (b(x, y, tileY, tileX, tileId)) {
539 | if (a(x, y, tileY, tileX, tileId))
540 | bool = false;
541 | OnTouchHoop();
542 | this.n.LevelTiles[tileY][tileX] = (short) (0x99 | isInWater);
543 | this.n.LevelTiles[tileY + 1][tileX] = (short) (0x9A | isInWater);
544 | sound = this.n.soundUp;
545 | }
546 | }
547 | case 13 -> {
548 | if (b(x, y, tileY, tileX, tileId)) {
549 | if (this.ballSize == 16) {
550 | bool = false;
551 | break;
552 | }
553 | if (a(x, y, tileY, tileX, tileId))
554 | bool = false;
555 | OnTouchHoop();
556 | this.n.LevelTiles[tileY][tileX] = (short) (0x91 | isInWater);
557 | this.n.LevelTiles[tileY + 1][tileX] = (short) (0x92 | isInWater);
558 | sound = this.n.soundUp;
559 | }
560 | }
561 | case 22 -> {
562 | if (b(x, y, tileY, tileX, tileId)) {
563 | OnTouchHoop();
564 | this.n.LevelTiles[tileY][tileX] = (short) (0x9A | isInWater);
565 | this.n.LevelTiles[tileY - 1][tileX] = (short) (0x99 | isInWater);
566 | sound = this.n.soundUp;
567 | }
568 | }
569 | case 14 -> {
570 | if (b(x, y, tileY, tileX, tileId)) {
571 | if (this.ballSize == 16) {
572 | bool = false;
573 | break;
574 | }
575 | OnTouchHoop();
576 | this.n.LevelTiles[tileY][tileX] = (short) (0x92 | isInWater);
577 | this.n.LevelTiles[tileY - 1][tileX] = (short) (0x91 | isInWater);
578 | sound = this.n.soundUp;
579 | }
580 | }
581 | case 17, 19, 20 -> {
582 | if (b(x, y, tileY, tileX, tileId)) {
583 | if (this.ballSize == 16) {
584 | bool = false;
585 | break;
586 | }
587 | if (a(x, y, tileY, tileX, tileId))
588 | bool = false;
589 | }
590 | }
591 | case 25, 27, 28 -> {
592 | if (a(x, y, tileY, tileX, tileId))
593 | bool = false;
594 | }
595 | case 18 -> {
596 | if (b(x, y, tileY, tileX, tileId) && this.ballSize == 16)
597 | bool = false;
598 | }
599 | case 9 -> {
600 | if (b(x, y, tileY, tileX, tileId)) {
601 | if (this.n.M) {
602 | this.n.e = true;
603 | sound = this.n.soundPickup;
604 | break;
605 | }
606 | bool = false;
607 | }
608 | }
609 | case 29 -> { // Power up
610 | this.n.AddScore(1000);
611 | if (this.n.lives < 5) {
612 | this.n.lives++;
613 | this.n.y = true;
614 | }
615 | this.n.LevelTiles[tileY][tileX] = 0x80 | TileIDs.EMPTY;
616 | sound = this.n.soundPickup;
617 | }
618 | case 39, 40, 41, 42 -> {
619 | bool = false;
620 | if (this.ballSize == 16)
621 | UseRegularBall();
622 | }
623 | case TileIDs.PUMPER_UP, TileIDs.PUMPER_RIGHT, TileIDs.PUMPER_DOWN, TileIDs.PUMPER_LEFT -> {
624 | if (b(x, y, tileY, tileX, tileId)) {
625 | bool = false;
626 | if (this.ballSize == 12)
627 | UseBigBall();
628 | }
629 | }
630 | case TileIDs.POWER_UP_GRAVITY_UP, TileIDs.POWER_UP_GRAVITY_RIGHT, TileIDs.POWER_UP_GRAVITY_DOWN, TileIDs.POWER_UP_GRAVITY_LEFT -> {
631 | this.powerUpGravity = 300;
632 | sound = this.n.soundPickup;
633 | this.m = false;
634 | bool = false;
635 | }
636 | case 51, 52, 53, 54 -> {
637 | this.TODO_somePowerUp3 = 300;
638 | sound = this.n.soundPickup;
639 | bool = false;
640 | }
641 | case 38 -> {
642 | this.TODO_somePowerUp1 = 300;
643 | sound = this.n.soundPickup;
644 | bool = false;
645 | }
646 | }
647 | if (sound != null)
648 | sound.play(1);
649 | return bool;
650 | }
651 |
652 | public void b() {
653 | int i = this.TODO_unkX;
654 | int j = 0;
655 | int k = 0;
656 | byte b1 = 0;
657 | boolean bool1 = false;
658 | if (this.z == 2) {
659 | this.q--;
660 | if (this.q == 0) {
661 | this.z = 1;
662 | if (this.n.lives < 0)
663 | this.n.e = true;
664 | }
665 | return;
666 | }
667 | int tileX = this.TODO_unkX / 12;
668 | int tileY = this.TODO_unkY / 12;
669 | boolean isInWater = (this.n.LevelTiles[tileY][tileX] & 0x40) != 0;
670 | if (isInWater) {
671 | if (this.ballSize == 16) {
672 | k = -30;
673 | j = -2;
674 | if (this.m)
675 | this.o = -10;
676 | } else {
677 | k = 42;
678 | j = 6;
679 | }
680 | } else if (this.ballSize == 16) {
681 | k = 38;
682 | j = 3;
683 | } else {
684 | k = 80;
685 | j = 4;
686 | }
687 | if (this.powerUpGravity != 0) {
688 | bool1 = true;
689 | k *= -1;
690 | j *= -1;
691 | this.powerUpGravity--;
692 | if (this.powerUpGravity == 0) {
693 | bool1 = false;
694 | this.m = false;
695 | k *= -1;
696 | j *= -1;
697 | }
698 | }
699 | if (this.TODO_somePowerUp3 != 0) {
700 | if (-1 * Math.abs(this.t) > -80)
701 | if (bool1) {
702 | this.t = 80;
703 | } else {
704 | this.t = -80;
705 | }
706 | this.TODO_somePowerUp3--;
707 | }
708 | this.C++;
709 | if (this.C == 3)
710 | this.C = 0;
711 | if (this.o < -150) {
712 | this.o = -150;
713 | } else if (this.o > 150) {
714 | this.o = 150;
715 | }
716 | if (this.l < -150) {
717 | this.l = -150;
718 | } else if (this.l > 150) {
719 | this.l = 150;
720 | }
721 | if (this.o < 10 && this.o > 0 && !isInWater && !bool1)
722 | this.o = 10;
723 | for (byte b2 = 0; b2 < Math.abs(this.o) / 10; b2++) {
724 | byte b = 0;
725 | if (this.o != 0)
726 | b = (byte) ((this.o < 0) ? -1 : 1);
727 | if (TODO_CheckBallCollision(this.TODO_unkX, this.TODO_unkY + b)) {
728 | this.TODO_unkY += b;
729 | this.m = false;
730 | if (k == -30) {
731 | tileY = this.TODO_unkY / 12;
732 | if ((this.n.LevelTiles[tileY][tileX] & 0x40) == 0) {
733 | this.o >>= 1;
734 | if (this.o <= 10 && this.o >= -10)
735 | this.o = 0;
736 | }
737 | }
738 | } else {
739 | if (this.u && this.l < 10 && this.C == 0) {
740 | byte b4 = 1;
741 | if (TODO_CheckBallCollision(this.TODO_unkX + b4, this.TODO_unkY + b)) {
742 | this.TODO_unkX += b4;
743 | this.TODO_unkY += b;
744 | this.u = false;
745 | } else if (TODO_CheckBallCollision(this.TODO_unkX - b4, this.TODO_unkY + b)) {
746 | this.TODO_unkX -= b4;
747 | this.TODO_unkY += b;
748 | this.u = false;
749 | }
750 | }
751 | if (b > 0 || (bool1 && b < 0)) {
752 | this.o = this.o * -1 / 2;
753 | this.m = true;
754 | if (this.v && (this.w & 0x8) != 0) {
755 | this.v = false;
756 | if (bool1) {
757 | this.t += 10;
758 | } else {
759 | this.t += -10;
760 | }
761 | } else if (this.TODO_somePowerUp3 == 0) {
762 | this.t = 0;
763 | }
764 | if (this.o < 10 && this.o > -10) {
765 | if (bool1) {
766 | this.o = -10;
767 | break;
768 | }
769 | this.o = 10;
770 | }
771 | break;
772 | }
773 | if (b < 0 || (bool1 && b > 0))
774 | if (bool1) {
775 | this.o = -20;
776 | } else {
777 | this.o = -this.o >> 1;
778 | }
779 | }
780 | }
781 | if (bool1) {
782 | if (j == -2 && this.o < k) {
783 | this.o += j;
784 | if (this.o > k)
785 | this.o = k;
786 | } else if (!this.m && this.o > k) {
787 | this.o += j;
788 | if (this.o < k)
789 | this.o = k;
790 | }
791 | } else if (j == -2 && this.o > k) {
792 | this.o += j;
793 | if (this.o < k)
794 | this.o = k;
795 | } else if (!this.m && this.o < k) {
796 | this.o += j;
797 | if (this.o > k)
798 | this.o = k;
799 | }
800 | if (this.TODO_somePowerUp1 != 0) {
801 | b1 = 100;
802 | this.TODO_somePowerUp1--;
803 | } else {
804 | b1 = 50;
805 | }
806 | if ((this.w & 0x2) != 0 && this.l < b1) {
807 | this.l += 6;
808 | } else if ((this.w & 0x1) != 0 && this.l > -b1) {
809 | this.l -= 6;
810 | } else if (this.l > 0) {
811 | this.l -= 4;
812 | } else if (this.l < 0) {
813 | this.l += 4;
814 | }
815 | if (this.ballSize == 16 && this.TODO_somePowerUp3 == 0)
816 | if (bool1) {
817 | this.t += 5;
818 | } else {
819 | this.t += -5;
820 | }
821 | if (this.m && (this.w & 0x8) != 0) {
822 | if (bool1) {
823 | this.o = 67 + this.t;
824 | } else {
825 | this.o = -67 + this.t;
826 | }
827 | this.m = false;
828 | }
829 | int i1 = Math.abs(this.l);
830 | int i2 = i1 / 10;
831 | for (byte b3 = 0; b3 < i2; b3++) {
832 | byte b = 0;
833 | if (this.l != 0)
834 | b = (byte) ((this.l < 0) ? -1 : 1);
835 | if (TODO_CheckBallCollision(this.TODO_unkX + b, this.TODO_unkY)) {
836 | this.TODO_unkX += b;
837 | } else if (this.u) {
838 | this.u = false;
839 | byte b4 = 0;
840 | if (bool1) {
841 | b4 = 1;
842 | } else {
843 | b4 = -1;
844 | }
845 | if (TODO_CheckBallCollision(this.TODO_unkX + b, this.TODO_unkY + b4)) {
846 | this.TODO_unkX += b;
847 | this.TODO_unkY += b4;
848 | } else if (TODO_CheckBallCollision(this.TODO_unkX + b, this.TODO_unkY - b4)) {
849 | this.TODO_unkX += b;
850 | this.TODO_unkY -= b4;
851 | } else {
852 | this.l = -(this.l >> 1);
853 | }
854 | }
855 | }
856 | }
857 |
858 | public static boolean a(int paramInt1, int paramInt2, int paramInt3, int paramInt4, int paramInt5, int paramInt6, int paramInt7, int paramInt8) {
859 | return (paramInt1 <= paramInt7 && paramInt2 <= paramInt8 && paramInt5 <= paramInt3 && paramInt6 <= paramInt4);
860 | }
861 | }
862 |
863 |
864 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\f.class
865 | * Java compiler version: 1 (45.3)
866 | * JD-Core Version: 1.1.3
867 | */
--------------------------------------------------------------------------------
/src/main/java/com/nokia/mid/appl/boun/b.java:
--------------------------------------------------------------------------------
1 | package com.nokia.mid.appl.boun;
2 |
3 | import com.nokia.mid.ui.DirectGraphics;
4 | import com.nokia.mid.ui.DirectUtils;
5 | import com.nokia.mid.ui.FullCanvas;
6 |
7 | import javax.microedition.lcdui.Display;
8 | import javax.microedition.lcdui.Graphics;
9 | import javax.microedition.lcdui.Image;
10 | import java.io.DataInputStream;
11 | import java.io.IOException;
12 | import java.io.InputStream;
13 |
14 | public abstract class b extends FullCanvas {
15 | public static final class BounceColors {
16 | public static final int ALPHA = 0xff000000;
17 | public static final int SKY = 0xb0e0f0;
18 | public static final int SKY_ALPHA = ALPHA | SKY;
19 | public static final int WATER = 0x1060b0;
20 | public static final int WATER_ALPHA = ALPHA | WATER;
21 | }
22 |
23 | public static final class ImageManipulation {
24 | public static final int FLIP_HORIZONTAL = 0;
25 | public static final int FLIP_VERTICAL = 1;
26 | public static final int FLIP_BOTH = 2;
27 | /**
28 | * Rotate counter-clockwise by 90 degrees
29 | */
30 | public static final int ROTATE_90 = 3;
31 | /**
32 | * Rotate counter-clockwise by 180 degrees
33 | */
34 | public static final int ROTATE_180 = 4;
35 | /**
36 | * Rotate counter-clockwise by 270 degrees
37 | */
38 | public static final int ROTATE_270 = 5;
39 | }
40 |
41 | public static final class SpriteIDs {
42 | public static final int BRICK_WALL = 0;
43 | public static final int RUBBER_WALL = 1;
44 |
45 | public static final int THORNS_UP = 2;
46 | public static final int THORNS_DOWN = 3;
47 | public static final int THORNS_LEFT = 4;
48 | public static final int THORNS_RIGHT = 5;
49 |
50 | public static final int THORNS_WATER_UP = 6;
51 | public static final int THORNS_WATER_DOWN = 7;
52 | public static final int THORNS_WATER_LEFT = 8;
53 | public static final int THORNS_WATER_RIGHT = 9;
54 |
55 | /**
56 | * A.K.A. Checkpoint
57 | */
58 | public static final int CRYSTAL = 10;
59 | /**
60 | * A.K.A. Active checkpoint
61 | */
62 | public static final int CRYSTAL_ACTIVE = 11;
63 |
64 | public static final int EXIT = 12;
65 |
66 | public static final int HOOP_WIDE_LEFT_FLIP = 13;
67 | public static final int HOOP_WIDE_LEFT = 14;
68 | public static final int HOOP_WIDE_RIGHT_FLIP = 15;
69 | public static final int HOOP_WIDE_RIGHT = 16;
70 |
71 | public static final int HOOP_LEFT_FLIP = 17;
72 | public static final int HOOP_LEFT = 18;
73 | public static final int HOOP_RIGHT_FLIP = 19;
74 | public static final int HOOP_RIGHT = 20;
75 |
76 | public static final int HOOP_WIDE_LEFT_FLIP_PASSED = 21;
77 | public static final int HOOP_WIDE_LEFT_PASSED = 22;
78 | public static final int HOOP_WIDE_RIGHT_FLIP_PASSED = 23;
79 | public static final int HOOP_WIDE_RIGHT_PASSED = 24;
80 |
81 | public static final int HOOP_LEFT_FLIP_PASSED = 25;
82 | public static final int HOOP_LEFT_PASSED = 26;
83 | public static final int HOOP_RIGHT_FLIP_PASSED = 27;
84 | public static final int HOOP_RIGHT_PASSED = 28;
85 |
86 | /**
87 | * A.K.A. 1-Up
88 | */
89 | public static final int CRYSTAL_BALL = 45;
90 |
91 | public static final int DYN_THORN_QUARTER = 46;
92 |
93 | public static final int BALL = 47;
94 | public static final int POPPED_BALL = 48;
95 | public static final int BIG_BALL = 49;
96 | public static final int DEFLATER = 50;
97 | public static final int PUMPER = 51;
98 | public static final int POWER_UP_GRAVITY = 52;
99 | public static final int POWER_UP_SPEED = 53;
100 | public static final int POWER_UP_JUMP = 54;
101 | }
102 |
103 | protected int l;
104 |
105 | protected int k;
106 |
107 | protected int G;
108 |
109 | protected int Z;
110 |
111 | protected int v;
112 |
113 | protected boolean z;
114 |
115 | protected Image E;
116 |
117 | private Image[] Sprites;
118 |
119 | private Image I;
120 |
121 | private Graphics J;
122 |
123 | public int level = -1;
124 |
125 | public String LevelString;
126 |
127 | public String LevelCompletedString;
128 |
129 | public boolean d;
130 |
131 | protected int TODO_ballInitialX;
132 |
133 | protected int TODO_ballInitialY;
134 |
135 | /**
136 | * Either 12 (small) or 16 (big)
137 | */
138 | public int BallSize;
139 |
140 | protected int exitX;
141 |
142 | protected int exitY;
143 |
144 | public short[][] LevelTiles;
145 |
146 | public int TODO_width;
147 |
148 | public int TODO_height;
149 |
150 | public int HoopsTotal;
151 |
152 | public int DynThornsCount;
153 |
154 | public Vec2S[] DynThornsBottomLeft;
155 |
156 | public Vec2S[] DynThornsTopRight;
157 |
158 | public Vec2S[] ae;
159 |
160 | public Vec2S[] w;
161 |
162 | public Image[] r;
163 |
164 | public Graphics[] an;
165 |
166 | public Image spriteDynThorn;
167 |
168 | public Image imageBall;
169 |
170 | public Image imageHoop;
171 |
172 | public int tileX;
173 |
174 | public int tileY;
175 |
176 | public Image aa;
177 |
178 | public Image o;
179 |
180 | public int b;
181 |
182 | public boolean M;
183 |
184 | protected int displayWidth = 0;
185 |
186 | protected int displayHeight = 0;
187 |
188 | protected Display display;
189 |
190 | public BounceTimer GameTimer = null;
191 |
192 | public b(Display display) {
193 | this.display = display;
194 | this.displayWidth = getWidth();
195 | this.displayHeight = getHeight();
196 | this.v = 0;
197 | this.Z = 156;
198 | this.E = Image.createImage(156, 96);
199 | this.I = Image.createImage(12, 12);
200 | this.J = this.I.getGraphics();
201 | LoadSpriteSheet();
202 | this.d = false;
203 | this.l = 0;
204 | this.k = 0;
205 | this.z = false;
206 | this.G = this.l + 13;
207 | this.LevelTiles = null;
208 | }
209 |
210 | public void LoadLevelId(int levelId) {
211 | InputStream levelStream = null;
212 | DataInputStream levelDIS = null;
213 | this.d = false;
214 | String levelName = "";
215 | String[] levelIdFormat = new String[1];
216 | levelIdFormat[0] = Integer.valueOf(this.level).toString();
217 | this.LevelString = Translation.sprintf_translated(Translation.LEVEL, levelIdFormat);
218 | this.LevelCompletedString = Translation.sprintf_translated(Translation.LEVEL_COMPLETED, levelIdFormat);
219 | levelIdFormat[0] = null;
220 | levelIdFormat = null;
221 | if (levelId < 10) {
222 | levelName = "00" + levelId;
223 | } else if (levelId < 100) {
224 | levelName = "0" + levelId;
225 | }
226 | try {
227 | levelStream = getClass().getResourceAsStream("/levels/J2MElvl." + levelName);
228 | levelDIS = new DataInputStream(levelStream);
229 | this.TODO_ballInitialX = levelDIS.read();
230 | this.TODO_ballInitialY = levelDIS.read();
231 | int isBigBall = levelDIS.read();
232 | if (isBigBall == 0) {
233 | this.BallSize = 12;
234 | } else {
235 | this.BallSize = 16;
236 | }
237 | this.exitX = levelDIS.read();
238 | this.exitY = levelDIS.read();
239 | CreateTiles(this.exitX, this.exitY, this.Sprites[SpriteIDs.EXIT]);
240 | this.HoopsTotal = levelDIS.read();
241 | this.TODO_width = levelDIS.read();
242 | this.TODO_height = levelDIS.read();
243 | this.LevelTiles = new short[this.TODO_height][this.TODO_width];
244 | for (byte i = 0; i < this.TODO_height; i++) {
245 | for (byte j = 0; j < this.TODO_width; j++)
246 | this.LevelTiles[i][j] = (short) levelDIS.read();
247 | }
248 | this.DynThornsCount = levelDIS.read();
249 | if (this.DynThornsCount != 0)
250 | LoadLevelDynThorns(levelDIS);
251 | levelDIS.close();
252 | } catch (IOException iOException) {
253 | }
254 | }
255 |
256 | public static Image ModifyImage(Image paramImage, int manipulation) {
257 | Image image = DirectUtils.createImage(paramImage.getWidth(), paramImage.getHeight(), 0);
258 | if (image == null)
259 | image = Image.createImage(paramImage.getWidth(), paramImage.getHeight());
260 | Graphics graphics = image.getGraphics();
261 | DirectGraphics directGraphics = DirectUtils.getDirectGraphics(graphics);
262 | switch (manipulation) {
263 | case ImageManipulation.FLIP_HORIZONTAL -> {
264 | directGraphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT, DirectGraphics.FLIP_HORIZONTAL);
265 | return image;
266 | }
267 | case ImageManipulation.FLIP_VERTICAL -> {
268 | directGraphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT, DirectGraphics.FLIP_VERTICAL);
269 | return image;
270 | }
271 | case ImageManipulation.FLIP_BOTH -> {
272 | directGraphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT, DirectGraphics.FLIP_HORIZONTAL | DirectGraphics.FLIP_VERTICAL);
273 | return image;
274 | }
275 | case ImageManipulation.ROTATE_90 -> {
276 | directGraphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT, DirectGraphics.ROTATE_90);
277 | return image;
278 | }
279 | case ImageManipulation.ROTATE_180 -> {
280 | directGraphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT, DirectGraphics.ROTATE_180);
281 | return image;
282 | }
283 | case ImageManipulation.ROTATE_270 -> {
284 | directGraphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT, DirectGraphics.ROTATE_270);
285 | return image;
286 | }
287 | }
288 | graphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT);
289 | return image;
290 | }
291 |
292 | public void LoadLevelDynThorns(DataInputStream levelDIS) throws IOException {
293 | this.DynThornsBottomLeft = new Vec2S[this.DynThornsCount];
294 | this.DynThornsTopRight = new Vec2S[this.DynThornsCount];
295 | this.ae = new Vec2S[this.DynThornsCount];
296 | this.w = new Vec2S[this.DynThornsCount];
297 | this.r = new Image[this.DynThornsCount];
298 | this.an = new Graphics[this.DynThornsCount];
299 | for (byte thorn = 0; thorn < this.DynThornsCount; thorn++) {
300 | short x, y;
301 |
302 | x = (short) levelDIS.read();
303 | y = (short) levelDIS.read();
304 | this.DynThornsBottomLeft[thorn] = new Vec2S(x, y);
305 |
306 | x = (short) levelDIS.read();
307 | y = (short) levelDIS.read();
308 | this.DynThornsTopRight[thorn] = new Vec2S(x, y);
309 |
310 | x = (short) levelDIS.read();
311 | y = (short) levelDIS.read();
312 | this.ae[thorn].x = (short) levelDIS.read();
313 | this.ae[thorn].y = (short) levelDIS.read();
314 |
315 | x = (short) levelDIS.read();
316 | y = (short) levelDIS.read();
317 | this.w[thorn].x = x;
318 | this.w[thorn].y = y;
319 | }
320 | this.spriteDynThorn = Image.createImage(24, 24);
321 | Graphics graphics = this.spriteDynThorn.getGraphics();
322 | graphics.drawImage(this.Sprites[SpriteIDs.DYN_THORN_QUARTER], 0, 0, Graphics.TOP | Graphics.LEFT);
323 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.DYN_THORN_QUARTER], ImageManipulation.FLIP_HORIZONTAL), 12, 0, Graphics.TOP | Graphics.LEFT);
324 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.DYN_THORN_QUARTER], ImageManipulation.ROTATE_180), 12, 12, Graphics.TOP | Graphics.LEFT);
325 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.DYN_THORN_QUARTER], ImageManipulation.FLIP_VERTICAL), 0, 12, Graphics.TOP | Graphics.LEFT);
326 | graphics = null;
327 | }
328 |
329 | public void RunGarbageCollector() {
330 | for (byte i = 0; i < this.DynThornsCount; i++) {
331 | this.r[i] = null;
332 | this.an[i] = null;
333 | }
334 | this.r = null;
335 | this.an = null;
336 | this.LevelTiles = null;
337 | Runtime.getRuntime().gc();
338 | }
339 |
340 | public void UpdateDynThorns() {
341 | for (byte thorn = 0; thorn < this.DynThornsCount; thorn++) {
342 | short s1 = this.DynThornsBottomLeft[thorn].x;
343 | short s2 = this.DynThornsBottomLeft[thorn].y;
344 | short s3 = this.w[thorn].x;
345 | short s4 = this.w[thorn].y;
346 | this.w[thorn].x = (short) (this.w[thorn].x + this.ae[thorn].x);
347 | int n = (this.DynThornsTopRight[thorn].x - s1 - 2) * 12;
348 | int i1 = (this.DynThornsTopRight[thorn].y - s2 - 2) * 12;
349 | if (this.w[thorn].x < 0) {
350 | this.w[thorn].x = 0;
351 | } else if (this.w[thorn].x > n) {
352 | this.w[thorn].x = (short) n;
353 | }
354 | if (this.w[thorn].x == 0 || this.w[thorn].x == n)
355 | this.ae[thorn].x = (short) -this.ae[thorn].x;
356 | this.w[thorn].y = (short) (this.w[thorn].y + this.ae[thorn].y);
357 | if (this.w[thorn].y < 0) {
358 | this.w[thorn].y = 0;
359 | } else if (this.w[thorn].y > i1) {
360 | this.w[thorn].y = (short) i1;
361 | }
362 | if (this.w[thorn].y == 0 || this.w[thorn].y == i1)
363 | this.ae[thorn].y = (short) (this.ae[thorn].y * -1);
364 | short s5 = this.w[thorn].x;
365 | short s6 = this.w[thorn].y;
366 | if (s5 < s3) {
367 | short s = s5;
368 | s5 = s3;
369 | s3 = s;
370 | }
371 | if (s6 < s4) {
372 | short s = s6;
373 | s6 = s4;
374 | s4 = s;
375 | }
376 | s5 += 23;
377 | s6 += 23;
378 | int i = s3 / 12;
379 | int j = s4 / 12;
380 | int k = s5 / 12 + 1;
381 | int m = s6 / 12 + 1;
382 | for (int i2 = i; i2 < k; i2++) {
383 | for (int i3 = j; i3 < m; i3++)
384 | this.LevelTiles[s2 + i3][s1 + i2] = (short) (this.LevelTiles[s2 + i3][s1 + i2] | 0x80);
385 | }
386 | }
387 | }
388 |
389 | public int TestPointInsideDynThorns(int x, int y) {
390 | for (byte thorn = 0; thorn < this.DynThornsCount; thorn++) {
391 | if (x >= this.DynThornsBottomLeft[thorn].x && x < this.DynThornsTopRight[thorn].x
392 | && y >= this.DynThornsBottomLeft[thorn].y && y < this.DynThornsTopRight[thorn].y)
393 | return thorn;
394 | }
395 | return -1;
396 | }
397 |
398 | public void CreateTiles(int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
399 | int k;
400 | Graphics graphics = this.E.getGraphics();
401 | if (paramInt1 < 0 || paramInt2 < 0 || paramInt1 >= this.TODO_width || paramInt2 >= this.TODO_height) {
402 | graphics.drawImage(this.Sprites[SpriteIDs.BRICK_WALL], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
403 | return;
404 | }
405 | this.LevelTiles[paramInt2][paramInt1] = (short) (this.LevelTiles[paramInt2][paramInt1] & (~0x80));
406 | int tileId = this.LevelTiles[paramInt2][paramInt1];
407 | boolean isInWater = (tileId & 0x40) != 0; // TODO: investigate this bit mask
408 | if (isInWater)
409 | tileId = tileId & (~0x40);
410 | graphics.setColor(isInWater ? BounceColors.WATER : BounceColors.SKY);
411 | int j;
412 | switch (tileId) {
413 | case TileIDs.BRICK_WALL ->
414 | graphics.drawImage(this.Sprites[SpriteIDs.BRICK_WALL], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
415 | case TileIDs.EMPTY -> graphics.fillRect(paramInt3, paramInt4, 12, 12);
416 | case TileIDs.RUBBER_WALL ->
417 | graphics.drawImage(this.Sprites[SpriteIDs.RUBBER_WALL], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
418 | case TileIDs.THORNS_UP -> {
419 | if (isInWater) {
420 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_WATER_UP], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
421 | break;
422 | }
423 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_UP], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
424 | }
425 | case TileIDs.THORNS_RIGHT -> {
426 | if (isInWater) {
427 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_WATER_RIGHT], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
428 | break;
429 | }
430 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_RIGHT], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
431 | }
432 | case TileIDs.THORNS_DOWN -> {
433 | if (isInWater) {
434 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_WATER_DOWN], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
435 | break;
436 | }
437 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_DOWN], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
438 | }
439 | case TileIDs.THORNS_LEFT -> {
440 | if (isInWater) {
441 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_WATER_LEFT], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
442 | break;
443 | }
444 | graphics.drawImage(this.Sprites[SpriteIDs.THORNS_LEFT], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
445 | }
446 | case TileIDs.CRYSTAL ->
447 | graphics.drawImage(this.Sprites[SpriteIDs.CRYSTAL], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
448 | case TileIDs.CRYSTAL_ACTIVE ->
449 | graphics.drawImage(this.Sprites[SpriteIDs.CRYSTAL_ACTIVE], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
450 | case 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 -> {
451 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
452 | graphics.drawImage(this.Sprites[com.nokia.mid.appl.boun.d.a[tileId - 13]], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
453 | graphics.drawImage(this.Sprites[com.nokia.mid.appl.boun.d.b[tileId - 13]], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
454 | }
455 | case 9 -> { // TODO: what's this tile???
456 | j = (paramInt1 - this.tileX) * 12;
457 | k = (paramInt2 - this.tileY) * 12;
458 | graphics.setClip(paramInt3, paramInt4, 12, 12);
459 | graphics.drawImage(this.aa, paramInt3 - j, paramInt4 - k, Graphics.TOP | Graphics.LEFT);
460 | graphics.setClip(0, 0, this.E.getWidth(), this.E.getHeight());
461 | this.z = true;
462 | }
463 | case 10 -> {
464 | j = TestPointInsideDynThorns(paramInt1, paramInt2);
465 | if (j != -1) {
466 | k = (paramInt1 - this.DynThornsBottomLeft[j].x) * 12;
467 | int m = (paramInt2 - this.DynThornsBottomLeft[j].y) * 12;
468 | int n = this.w[j].x - k;
469 | int i1 = this.w[j].y - m;
470 | if ((n > -36 && n < 12) || (i1 > -36 && i1 < 12)) {
471 | this.J.setColor(BounceColors.SKY);
472 | this.J.fillRect(0, 0, 12, 12);
473 | this.J.drawImage(this.spriteDynThorn, n, i1, Graphics.TOP | Graphics.LEFT);
474 | graphics.drawImage(this.I, paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
475 | break;
476 | }
477 | graphics.setColor(BounceColors.SKY);
478 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
479 | }
480 | }
481 | case 29 ->
482 | graphics.drawImage(this.Sprites[SpriteIDs.CRYSTAL_BALL], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
483 | case 30 -> {
484 | if (isInWater) {
485 | graphics.drawImage(this.Sprites[61], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
486 | break;
487 | }
488 | graphics.drawImage(this.Sprites[57], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
489 | }
490 | case 31 -> {
491 | if (isInWater) {
492 | graphics.drawImage(this.Sprites[60], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
493 | break;
494 | }
495 | graphics.drawImage(this.Sprites[56], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
496 | }
497 | case 32 -> {
498 | if (isInWater) {
499 | graphics.drawImage(this.Sprites[59], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
500 | break;
501 | }
502 | graphics.drawImage(this.Sprites[55], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
503 | }
504 | case 33 -> {
505 | if (isInWater) {
506 | graphics.drawImage(this.Sprites[62], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
507 | break;
508 | }
509 | graphics.drawImage(this.Sprites[58], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
510 | }
511 | case 34 -> {
512 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
513 | graphics.drawImage(this.Sprites[65], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
514 | }
515 | case 35 -> {
516 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
517 | graphics.drawImage(this.Sprites[64], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
518 | }
519 | case 36 -> {
520 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
521 | graphics.drawImage(this.Sprites[63], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
522 | }
523 | case 37 -> {
524 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
525 | graphics.drawImage(this.Sprites[66], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
526 | }
527 | case 39 -> {
528 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
529 | graphics.drawImage(this.Sprites[50], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
530 | }
531 | case 40 -> {
532 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
533 | graphics.drawImage(ModifyImage(this.Sprites[50], ImageManipulation.ROTATE_270), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
534 | }
535 | case 41 -> {
536 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
537 | graphics.drawImage(ModifyImage(this.Sprites[50], ImageManipulation.ROTATE_180), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
538 | }
539 | case 42 -> {
540 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
541 | graphics.drawImage(ModifyImage(this.Sprites[50], ImageManipulation.ROTATE_90), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
542 | }
543 | case TileIDs.PUMPER_UP -> {
544 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
545 | graphics.drawImage(this.Sprites[SpriteIDs.PUMPER], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
546 | }
547 | case TileIDs.PUMPER_RIGHT -> {
548 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
549 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.PUMPER], ImageManipulation.ROTATE_270), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
550 | }
551 | case TileIDs.PUMPER_DOWN -> {
552 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
553 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.PUMPER], ImageManipulation.ROTATE_180), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
554 | }
555 | case TileIDs.PUMPER_LEFT -> {
556 | graphics.fillRect(paramInt3, paramInt4, 12, 12);
557 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.PUMPER], ImageManipulation.ROTATE_90), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
558 | }
559 | case TileIDs.POWER_UP_GRAVITY_UP -> graphics.drawImage(this.Sprites[SpriteIDs.POWER_UP_GRAVITY], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
560 | case TileIDs.POWER_UP_GRAVITY_RIGHT ->
561 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.POWER_UP_GRAVITY], ImageManipulation.ROTATE_270), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
562 | case TileIDs.POWER_UP_GRAVITY_DOWN ->
563 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.POWER_UP_GRAVITY], ImageManipulation.ROTATE_180), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
564 | case TileIDs.POWER_UP_GRAVITY_LEFT ->
565 | graphics.drawImage(ModifyImage(this.Sprites[SpriteIDs.POWER_UP_GRAVITY], ImageManipulation.ROTATE_90), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
566 | case 38 -> graphics.drawImage(this.Sprites[53], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
567 | case 51 -> graphics.drawImage(this.Sprites[54], paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
568 | case 52 ->
569 | graphics.drawImage(ModifyImage(this.Sprites[54], ImageManipulation.ROTATE_270), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
570 | case 53 ->
571 | graphics.drawImage(ModifyImage(this.Sprites[54], ImageManipulation.ROTATE_180), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
572 | case 54 ->
573 | graphics.drawImage(ModifyImage(this.Sprites[54], ImageManipulation.ROTATE_90), paramInt3, paramInt4, Graphics.TOP | Graphics.LEFT);
574 | }
575 | }
576 |
577 | public void CreateTiles(Graphics g, int paramInt1, int paramInt2, int paramInt3, int paramInt4) {
578 | int i = (paramInt1 - paramInt3) / 12;
579 | int j = (paramInt2 - paramInt3) / 12;
580 | int k = (paramInt1 + paramInt3 - 1) / 12 + 1;
581 | int m = (paramInt2 + paramInt3 - 1) / 12 + 1;
582 | if (i < 0)
583 | i = 0;
584 | if (j < 0)
585 | j = 0;
586 | if (k > this.TODO_width)
587 | k = this.TODO_width;
588 | if (m > this.TODO_height)
589 | m = this.TODO_height;
590 | for (int n = i; n < k; n++) {
591 | for (int i1 = j; i1 < m; i1++) {
592 | int i2 = this.LevelTiles[i1][n] & (~0x40);
593 | if (i2 >= 13 && i2 <= 28) {
594 | int i3 = (n - this.l) * 12 + paramInt4;
595 | int i4 = (i1 - this.k) * 12;
596 | g.drawImage(this.Sprites[com.nokia.mid.appl.boun.d.b[i2 - 13]], i3, i4, Graphics.TOP | Graphics.LEFT);
597 | }
598 | }
599 | }
600 | }
601 |
602 | public void f() {
603 | for (byte b1 = 0; b1 < 13; b1++) {
604 | for (byte b2 = 0; b2 < 8; b2++)
605 | CreateTiles(this.l + b1, this.k + b2, b1 * 12, b2 * 12);
606 | }
607 | }
608 |
609 | public void i() {
610 | int i = this.l;
611 | int j = this.k;
612 | for (byte b1 = 0; b1 < 13; b1++) {
613 | if (b1 * 12 >= this.Z && i >= this.l)
614 | i = this.G - 13;
615 | for (byte b2 = 0; b2 < 8; b2++) {
616 | if ((this.LevelTiles[j][i] & 0x80) != 0)
617 | CreateTiles(i, j, b1 * 12, b2 * 12);
618 | j++;
619 | }
620 | j = this.k;
621 | i++;
622 | }
623 | }
624 |
625 | public void LoadSpriteSheet(int paramInt) {
626 | int i = this.G - 13;
627 | int j = this.G;
628 | int k = paramInt - 64;
629 | if (k < 0) {
630 | k = 0;
631 | } else if (k > (this.TODO_width + 1) * 12 - 156) {
632 | k = (this.TODO_width + 1) * 12 - 156;
633 | }
634 | while (k / 12 < i) {
635 | this.Z -= 12;
636 | int m = this.Z;
637 | this.G--;
638 | j--;
639 | i--;
640 | if (this.Z <= 0) {
641 | this.Z = 156;
642 | this.l -= 13;
643 | }
644 | for (byte b1 = 0; b1 < 8; b1++)
645 | CreateTiles(this.G - 13, this.k + b1, m, b1 * 12);
646 | }
647 | while ((k + 128) / 12 >= j) {
648 | if (this.Z >= 156) {
649 | this.Z = 0;
650 | this.l += 13;
651 | }
652 | int m = this.Z;
653 | this.Z += 12;
654 | this.G++;
655 | j++;
656 | i++;
657 | for (byte b1 = 0; b1 < 8; b1++)
658 | CreateTiles(this.l + m / 12, this.k + b1, m, b1 * 12);
659 | }
660 | this.v = this.l * 12 - k;
661 | }
662 |
663 | public int m() {
664 | return this.l * 12 - this.v;
665 | }
666 |
667 | public int g() {
668 | return this.l * 12 - this.v + 128;
669 | }
670 |
671 | public Image Mirror16x16Tile(Image paramImage) {
672 | Image image = DirectUtils.createImage(16, 16, 0);
673 | if (image == null)
674 | image = Image.createImage(16, 16);
675 | Graphics graphics = image.getGraphics();
676 | DirectGraphics directGraphics = DirectUtils.getDirectGraphics(graphics);
677 | graphics.drawImage(paramImage, -4, -4, Graphics.TOP | Graphics.LEFT);
678 | directGraphics.drawImage(paramImage, 8, -4, Graphics.TOP | Graphics.LEFT, DirectGraphics.FLIP_HORIZONTAL);
679 | directGraphics.drawImage(paramImage, -4, 8, Graphics.TOP | Graphics.LEFT, DirectGraphics.FLIP_VERTICAL);
680 | directGraphics.drawImage(paramImage, 8, 8, Graphics.TOP | Graphics.LEFT, DirectGraphics.ROTATE_180);
681 | return image;
682 | }
683 |
684 | public Image MirrorExitTile(Image paramImage) {
685 | Image image = Image.createImage(24, 48);
686 | Graphics graphics = image.getGraphics();
687 | graphics.setColor(BounceColors.SKY);
688 | graphics.fillRect(0, 0, 24, 48);
689 | graphics.setColor(0xfc9d9e);
690 | graphics.fillRect(4, 0, 16, 48);
691 | graphics.setColor(0xe33a3f);
692 | graphics.fillRect(6, 0, 10, 48);
693 | graphics.setColor(0xc2848e);
694 | graphics.fillRect(10, 0, 4, 48);
695 | graphics.drawImage(paramImage, 0, 0, Graphics.TOP | Graphics.LEFT);
696 | graphics.drawImage(ModifyImage(paramImage, ImageManipulation.FLIP_HORIZONTAL), 12, 0, Graphics.TOP | Graphics.LEFT);
697 | graphics.drawImage(ModifyImage(paramImage, ImageManipulation.FLIP_VERTICAL), 0, 12, Graphics.TOP | Graphics.LEFT);
698 | graphics.drawImage(ModifyImage(paramImage, ImageManipulation.FLIP_BOTH), 12, 12, Graphics.TOP | Graphics.LEFT);
699 | return image;
700 | }
701 |
702 | public void LoadSpriteSheet() {
703 | Image ss = CreateTiles("/icons/objects_nm.png");
704 | this.Sprites = new Image[67];
705 | this.Sprites[SpriteIDs.BRICK_WALL] = CreateTiles(ss, 1, 0); // Brick wall
706 | this.Sprites[SpriteIDs.RUBBER_WALL] = CreateTiles(ss, 1, 2); // Rubber wall
707 | this.Sprites[SpriteIDs.THORNS_UP] = CreateTiles(ss, 0, 3, BounceColors.SKY_ALPHA); // Thorns Up
708 | this.Sprites[SpriteIDs.THORNS_DOWN] = ModifyImage(this.Sprites[SpriteIDs.THORNS_UP], ImageManipulation.FLIP_VERTICAL); // Thorns Down
709 | this.Sprites[SpriteIDs.THORNS_LEFT] = ModifyImage(this.Sprites[SpriteIDs.THORNS_UP], ImageManipulation.ROTATE_90); // Thorns Left
710 | this.Sprites[SpriteIDs.THORNS_RIGHT] = ModifyImage(this.Sprites[SpriteIDs.THORNS_UP], ImageManipulation.ROTATE_270); // Thorns Right
711 | this.Sprites[SpriteIDs.THORNS_WATER_UP] = CreateTiles(ss, 0, 3, BounceColors.WATER_ALPHA);
712 | this.Sprites[SpriteIDs.THORNS_WATER_DOWN] = ModifyImage(this.Sprites[6], ImageManipulation.FLIP_VERTICAL);
713 | this.Sprites[SpriteIDs.THORNS_WATER_LEFT] = ModifyImage(this.Sprites[6], ImageManipulation.ROTATE_90);
714 | this.Sprites[SpriteIDs.THORNS_WATER_RIGHT] = ModifyImage(this.Sprites[6], ImageManipulation.ROTATE_270);
715 | this.Sprites[SpriteIDs.CRYSTAL] = CreateTiles(ss, 0, 4);
716 | this.Sprites[SpriteIDs.CRYSTAL_ACTIVE] = CreateTiles(ss, 3, 4);
717 | this.Sprites[SpriteIDs.EXIT] = MirrorExitTile(CreateTiles(ss, 2, 3));
718 | this.Sprites[SpriteIDs.HOOP_WIDE_LEFT] = CreateTiles(ss, 0, 5);
719 | this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_FLIP] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT], ImageManipulation.FLIP_VERTICAL);
720 | this.Sprites[SpriteIDs.HOOP_WIDE_RIGHT_FLIP] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_FLIP], ImageManipulation.FLIP_HORIZONTAL);
721 | this.Sprites[SpriteIDs.HOOP_WIDE_RIGHT] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT], ImageManipulation.FLIP_HORIZONTAL);
722 | this.Sprites[SpriteIDs.HOOP_LEFT] = CreateTiles(ss, 1, 5);
723 | this.Sprites[SpriteIDs.HOOP_LEFT_FLIP] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT], ImageManipulation.FLIP_VERTICAL);
724 | this.Sprites[SpriteIDs.HOOP_RIGHT_FLIP] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT_FLIP], ImageManipulation.FLIP_HORIZONTAL);
725 | this.Sprites[SpriteIDs.HOOP_RIGHT] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT], ImageManipulation.FLIP_HORIZONTAL);
726 | this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_PASSED] = CreateTiles(ss, 2, 5);
727 | this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_FLIP_PASSED] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_PASSED], ImageManipulation.FLIP_VERTICAL);
728 | this.Sprites[SpriteIDs.HOOP_WIDE_RIGHT_FLIP_PASSED] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_FLIP_PASSED], ImageManipulation.FLIP_HORIZONTAL);
729 | this.Sprites[SpriteIDs.HOOP_WIDE_RIGHT_PASSED] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_PASSED], ImageManipulation.FLIP_HORIZONTAL);
730 | this.Sprites[SpriteIDs.HOOP_LEFT_PASSED] = CreateTiles(ss, 3, 5);
731 | this.Sprites[SpriteIDs.HOOP_LEFT_FLIP_PASSED] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT_PASSED], ImageManipulation.FLIP_VERTICAL);
732 | this.Sprites[SpriteIDs.HOOP_RIGHT_FLIP_PASSED] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT_FLIP_PASSED], ImageManipulation.FLIP_HORIZONTAL);
733 | this.Sprites[SpriteIDs.HOOP_RIGHT_PASSED] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT_PASSED], ImageManipulation.FLIP_HORIZONTAL);
734 | this.Sprites[29] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT], ImageManipulation.ROTATE_270);
735 | this.Sprites[30] = ModifyImage(this.Sprites[29], ImageManipulation.FLIP_VERTICAL);
736 | this.Sprites[31] = ModifyImage(this.Sprites[29], ImageManipulation.FLIP_HORIZONTAL);
737 | this.Sprites[32] = ModifyImage(this.Sprites[30], ImageManipulation.FLIP_HORIZONTAL);
738 | this.Sprites[33] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT], ImageManipulation.ROTATE_270);
739 | this.Sprites[34] = ModifyImage(this.Sprites[33], ImageManipulation.FLIP_VERTICAL);
740 | this.Sprites[35] = ModifyImage(this.Sprites[33], ImageManipulation.FLIP_HORIZONTAL);
741 | this.Sprites[36] = ModifyImage(this.Sprites[34], ImageManipulation.FLIP_HORIZONTAL);
742 | this.Sprites[37] = ModifyImage(this.Sprites[SpriteIDs.HOOP_WIDE_LEFT_PASSED], ImageManipulation.ROTATE_270);
743 | this.Sprites[38] = ModifyImage(this.Sprites[37], ImageManipulation.FLIP_VERTICAL);
744 | this.Sprites[39] = ModifyImage(this.Sprites[37], ImageManipulation.FLIP_HORIZONTAL);
745 | this.Sprites[40] = ModifyImage(this.Sprites[38], ImageManipulation.FLIP_HORIZONTAL);
746 | this.Sprites[41] = ModifyImage(this.Sprites[SpriteIDs.HOOP_LEFT_PASSED], ImageManipulation.ROTATE_270);
747 | this.Sprites[42] = ModifyImage(this.Sprites[41], ImageManipulation.FLIP_VERTICAL);
748 | this.Sprites[43] = ModifyImage(this.Sprites[41], ImageManipulation.FLIP_HORIZONTAL);
749 | this.Sprites[44] = ModifyImage(this.Sprites[42], ImageManipulation.FLIP_HORIZONTAL);
750 | this.Sprites[SpriteIDs.CRYSTAL_BALL] = CreateTiles(ss, 3, 3);
751 | this.Sprites[SpriteIDs.DYN_THORN_QUARTER] = CreateTiles(ss, 1, 3);
752 | this.Sprites[SpriteIDs.BALL] = CreateTiles(ss, 2, 0);
753 | this.Sprites[SpriteIDs.POPPED_BALL] = CreateTiles(ss, 0, 1);
754 | this.Sprites[SpriteIDs.BIG_BALL] = Mirror16x16Tile(CreateTiles(ss, 3, 0));
755 | this.Sprites[SpriteIDs.DEFLATER] = CreateTiles(ss, 3, 1);
756 | this.Sprites[SpriteIDs.PUMPER] = CreateTiles(ss, 2, 4);
757 | this.Sprites[SpriteIDs.POWER_UP_GRAVITY] = CreateTiles(ss, 3, 2);
758 | this.Sprites[SpriteIDs.POWER_UP_SPEED] = CreateTiles(ss, 1, 1);
759 | this.Sprites[SpriteIDs.POWER_UP_JUMP] = CreateTiles(ss, 2, 2);
760 | this.Sprites[55] = CreateTiles(ss, 0, 0, BounceColors.SKY_ALPHA);
761 | this.Sprites[56] = ModifyImage(this.Sprites[55], ImageManipulation.ROTATE_90);
762 | this.Sprites[57] = ModifyImage(this.Sprites[55], ImageManipulation.ROTATE_180);
763 | this.Sprites[58] = ModifyImage(this.Sprites[55], ImageManipulation.ROTATE_270);
764 | this.Sprites[59] = CreateTiles(ss, 0, 0, BounceColors.WATER_ALPHA);
765 | this.Sprites[60] = ModifyImage(this.Sprites[59], ImageManipulation.ROTATE_90);
766 | this.Sprites[61] = ModifyImage(this.Sprites[59], ImageManipulation.ROTATE_180);
767 | this.Sprites[62] = ModifyImage(this.Sprites[59], ImageManipulation.ROTATE_270);
768 | this.Sprites[63] = CreateTiles(ss, 0, 2);
769 | this.Sprites[64] = ModifyImage(this.Sprites[63], ImageManipulation.ROTATE_90);
770 | this.Sprites[65] = ModifyImage(this.Sprites[63], ImageManipulation.ROTATE_180);
771 | this.Sprites[66] = ModifyImage(this.Sprites[63], ImageManipulation.ROTATE_270);
772 | this.imageBall = CreateTiles(ss, 2, 1);
773 | this.imageHoop = CreateTiles(ss, 1, 4);
774 | }
775 |
776 | public void CreateTiles(f paramf) {
777 | paramf.spriteBall = this.Sprites[SpriteIDs.BALL];
778 | paramf.spritePoppedBall = this.Sprites[SpriteIDs.POPPED_BALL];
779 | paramf.spriteBigBall = this.Sprites[SpriteIDs.BIG_BALL];
780 | }
781 |
782 | public static Image CreateTiles(Image paramImage, int tileX, int tileY) {
783 | return CreateTiles(paramImage, tileX, tileY, 0);
784 | }
785 |
786 | public static Image CreateTiles(Image paramImage, int tileX, int tileY, int ARGB) {
787 | Image image = DirectUtils.createImage(12, 12, ARGB);
788 | if (image == null) {
789 | image = Image.createImage(12, 12);
790 | Graphics graphics1 = image.getGraphics();
791 | graphics1.setColor(ARGB);
792 | graphics1.fillRect(0, 0, 12, 12);
793 | }
794 |
795 | Graphics graphics = image.getGraphics();
796 | graphics.drawImage(paramImage, -tileX * 12, -tileY * 12, Graphics.TOP | Graphics.LEFT);
797 | return image;
798 | }
799 |
800 | public static Image CreateTiles(String path) {
801 | Image image = null;
802 | try {
803 | image = Image.createImage(path);
804 | } catch (IOException ignored) {
805 | }
806 | return image;
807 | }
808 |
809 | public void CreateTiles(int tileX, int tileY, Image paramImage) {
810 | this.tileX = tileX;
811 | this.tileY = tileY;
812 | this.o = paramImage;
813 | this.aa = Image.createImage(24, 24);
814 | this.b = 0;
815 | p();
816 | this.M = false;
817 | }
818 |
819 | public void p() {
820 | Graphics graphics = this.aa.getGraphics();
821 | graphics.drawImage(this.o, 0, -this.b, Graphics.TOP | Graphics.LEFT);
822 | }
823 |
824 | public void h() {
825 | this.b += 4;
826 | if (this.b >= 24) {
827 | this.b = 24;
828 | this.M = true;
829 | }
830 | p();
831 | }
832 |
833 | public abstract void Tick();
834 |
835 | public synchronized void StartGameTimer() {
836 | if (this.GameTimer != null)
837 | return;
838 | this.GameTimer = new BounceTimer(this, this);
839 | }
840 |
841 | public synchronized void StopGameTimer() {
842 | if (this.GameTimer == null)
843 | return;
844 | this.GameTimer.stop();
845 | this.GameTimer = null;
846 | }
847 |
848 | protected void GameTimerTick() {
849 | Tick();
850 | }
851 | }
852 |
853 |
854 | /* Location: C:\Users\kuzme\Downloads\nokiabounc_jdifc8jb.jar!\com\nokia\mid\appl\boun\b.class
855 | * Java compiler version: 1 (45.3)
856 | * JD-Core Version: 1.1.3
857 | */
--------------------------------------------------------------------------------