├── LICENSE
├── README.md
├── android
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── AndroidManifest.xml
├── assets
│ ├── audio
│ │ └── fxsplash.mp3
│ ├── lights.png
│ ├── m01.png
│ ├── spl2.png
│ ├── t01.png
│ ├── t02.png
│ ├── t03.png
│ └── uipcfont.png
├── build.gradle
├── gen
│ └── com
│ │ └── orangepixel
│ │ └── planetbusters
│ │ └── android
│ │ ├── BuildConfig.java
│ │ └── R.java
├── ic_launcher-web.png
├── libs
│ ├── armeabi-v7a
│ │ └── libgdx.so
│ ├── armeabi
│ │ └── libgdx.so
│ └── x86
│ │ └── libgdx.so
├── lint.xml
├── proguard-project.txt
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ └── values
│ │ ├── strings.xml
│ │ └── styles.xml
└── src
│ └── com
│ └── orangepixel
│ └── planetbusters
│ └── android
│ └── AndroidLauncher.java
├── build.gradle
├── core
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── build.gradle
└── src
│ └── com
│ └── orangepixel
│ ├── controller
│ ├── ControllerMapping.java
│ ├── GSGamePad.java
│ ├── GSGamePadAndroid.java
│ ├── Gamepad.java
│ ├── PS3.java
│ ├── PS4.java
│ ├── PS4OSX.java
│ ├── ProExPowerA.java
│ ├── XBox.java
│ ├── XBoxLinux.java
│ ├── XBoxLinuxAlt.java
│ └── XBoxOSX.java
│ ├── planetbusters
│ ├── Audio.java
│ ├── Bullets.java
│ ├── Entity.java
│ ├── FX.java
│ ├── Globals.java
│ ├── Levelroom.java
│ ├── Mission.java
│ ├── Monsters.java
│ ├── Player.java
│ ├── PlayerProfile.java
│ ├── World.java
│ └── myCanvas.java
│ ├── social
│ └── Social.java
│ └── utils
│ ├── ArcadeCanvas.java
│ ├── FLight.java
│ └── Rect.java
├── desktop
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── build.gradle
└── src
│ └── com
│ └── orangepixel
│ └── planetbusters
│ └── desktop
│ └── DesktopLauncher.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── ios
├── .classpath
├── .project
├── .settings
│ └── org.eclipse.jdt.core.prefs
├── Info.plist.xml
├── build.gradle
├── data
│ ├── Default-375w-667h@2x.png
│ ├── Default-414w-736h@3x.png
│ ├── Default-568h@2x.png
│ ├── Default.png
│ ├── Default@2x.png
│ ├── Default@2x~ipad.png
│ ├── Default~ipad.png
│ ├── Icon-72.png
│ ├── Icon-72@2x.png
│ ├── Icon.png
│ └── Icon@2x.png
├── robovm.properties
├── robovm.xml
└── src
│ └── com
│ └── orangepixel
│ └── planetbusters
│ └── IOSLauncher.java
├── local.properties
├── settings.gradle
└── tempgfx
└── mockup.xcf
/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 3, 29 June 2007
3 |
4 | Copyright (C) 2007 Free Software Foundation, Inc.
5 | Everyone is permitted to copy and distribute verbatim copies
6 | of this license document, but changing it is not allowed.
7 |
8 | Preamble
9 |
10 | The GNU General Public License is a free, copyleft license for
11 | software and other kinds of works.
12 |
13 | The licenses for most software and other practical works are designed
14 | to take away your freedom to share and change the works. By contrast,
15 | the GNU General Public License is intended to guarantee your freedom to
16 | share and change all versions of a program--to make sure it remains free
17 | software for all its users. We, the Free Software Foundation, use the
18 | GNU General Public License for most of our software; it applies also to
19 | any other work released this way by its authors. You can apply it to
20 | your programs, too.
21 |
22 | When we speak of free software, we are referring to freedom, not
23 | price. Our General Public Licenses are designed to make sure that you
24 | have the freedom to distribute copies of free software (and charge for
25 | them if you wish), that you receive source code or can get it if you
26 | want it, that you can change the software or use pieces of it in new
27 | free programs, and that you know you can do these things.
28 |
29 | To protect your rights, we need to prevent others from denying you
30 | these rights or asking you to surrender the rights. Therefore, you have
31 | certain responsibilities if you distribute copies of the software, or if
32 | you modify it: responsibilities to respect the freedom of others.
33 |
34 | For example, if you distribute copies of such a program, whether
35 | gratis or for a fee, you must pass on to the recipients the same
36 | freedoms that you received. You must make sure that they, too, receive
37 | or can get the source code. And you must show them these terms so they
38 | know their rights.
39 |
40 | Developers that use the GNU GPL protect your rights with two steps:
41 | (1) assert copyright on the software, and (2) offer you this License
42 | giving you legal permission to copy, distribute and/or modify it.
43 |
44 | For the developers' and authors' protection, the GPL clearly explains
45 | that there is no warranty for this free software. For both users' and
46 | authors' sake, the GPL requires that modified versions be marked as
47 | changed, so that their problems will not be attributed erroneously to
48 | authors of previous versions.
49 |
50 | Some devices are designed to deny users access to install or run
51 | modified versions of the software inside them, although the manufacturer
52 | can do so. This is fundamentally incompatible with the aim of
53 | protecting users' freedom to change the software. The systematic
54 | pattern of such abuse occurs in the area of products for individuals to
55 | use, which is precisely where it is most unacceptable. Therefore, we
56 | have designed this version of the GPL to prohibit the practice for those
57 | products. If such problems arise substantially in other domains, we
58 | stand ready to extend this provision to those domains in future versions
59 | of the GPL, as needed to protect the freedom of users.
60 |
61 | Finally, every program is threatened constantly by software patents.
62 | States should not allow patents to restrict development and use of
63 | software on general-purpose computers, but in those that do, we wish to
64 | avoid the special danger that patents applied to a free program could
65 | make it effectively proprietary. To prevent this, the GPL assures that
66 | patents cannot be used to render the program non-free.
67 |
68 | The precise terms and conditions for copying, distribution and
69 | modification follow.
70 |
71 | TERMS AND CONDITIONS
72 |
73 | 0. Definitions.
74 |
75 | "This License" refers to version 3 of the GNU General Public License.
76 |
77 | "Copyright" also means copyright-like laws that apply to other kinds of
78 | works, such as semiconductor masks.
79 |
80 | "The Program" refers to any copyrightable work licensed under this
81 | License. Each licensee is addressed as "you". "Licensees" and
82 | "recipients" may be individuals or organizations.
83 |
84 | To "modify" a work means to copy from or adapt all or part of the work
85 | in a fashion requiring copyright permission, other than the making of an
86 | exact copy. The resulting work is called a "modified version" of the
87 | earlier work or a work "based on" the earlier work.
88 |
89 | A "covered work" means either the unmodified Program or a work based
90 | on the Program.
91 |
92 | To "propagate" a work means to do anything with it that, without
93 | permission, would make you directly or secondarily liable for
94 | infringement under applicable copyright law, except executing it on a
95 | computer or modifying a private copy. Propagation includes copying,
96 | distribution (with or without modification), making available to the
97 | public, and in some countries other activities as well.
98 |
99 | To "convey" a work means any kind of propagation that enables other
100 | parties to make or receive copies. Mere interaction with a user through
101 | a computer network, with no transfer of a copy, is not conveying.
102 |
103 | An interactive user interface displays "Appropriate Legal Notices"
104 | to the extent that it includes a convenient and prominently visible
105 | feature that (1) displays an appropriate copyright notice, and (2)
106 | tells the user that there is no warranty for the work (except to the
107 | extent that warranties are provided), that licensees may convey the
108 | work under this License, and how to view a copy of this License. If
109 | the interface presents a list of user commands or options, such as a
110 | menu, a prominent item in the list meets this criterion.
111 |
112 | 1. Source Code.
113 |
114 | The "source code" for a work means the preferred form of the work
115 | for making modifications to it. "Object code" means any non-source
116 | form of a work.
117 |
118 | A "Standard Interface" means an interface that either is an official
119 | standard defined by a recognized standards body, or, in the case of
120 | interfaces specified for a particular programming language, one that
121 | is widely used among developers working in that language.
122 |
123 | The "System Libraries" of an executable work include anything, other
124 | than the work as a whole, that (a) is included in the normal form of
125 | packaging a Major Component, but which is not part of that Major
126 | Component, and (b) serves only to enable use of the work with that
127 | Major Component, or to implement a Standard Interface for which an
128 | implementation is available to the public in source code form. A
129 | "Major Component", in this context, means a major essential component
130 | (kernel, window system, and so on) of the specific operating system
131 | (if any) on which the executable work runs, or a compiler used to
132 | produce the work, or an object code interpreter used to run it.
133 |
134 | The "Corresponding Source" for a work in object code form means all
135 | the source code needed to generate, install, and (for an executable
136 | work) run the object code and to modify the work, including scripts to
137 | control those activities. However, it does not include the work's
138 | System Libraries, or general-purpose tools or generally available free
139 | programs which are used unmodified in performing those activities but
140 | which are not part of the work. For example, Corresponding Source
141 | includes interface definition files associated with source files for
142 | the work, and the source code for shared libraries and dynamically
143 | linked subprograms that the work is specifically designed to require,
144 | such as by intimate data communication or control flow between those
145 | subprograms and other parts of the work.
146 |
147 | The Corresponding Source need not include anything that users
148 | can regenerate automatically from other parts of the Corresponding
149 | Source.
150 |
151 | The Corresponding Source for a work in source code form is that
152 | same work.
153 |
154 | 2. Basic Permissions.
155 |
156 | All rights granted under this License are granted for the term of
157 | copyright on the Program, and are irrevocable provided the stated
158 | conditions are met. This License explicitly affirms your unlimited
159 | permission to run the unmodified Program. The output from running a
160 | covered work is covered by this License only if the output, given its
161 | content, constitutes a covered work. This License acknowledges your
162 | rights of fair use or other equivalent, as provided by copyright law.
163 |
164 | You may make, run and propagate covered works that you do not
165 | convey, without conditions so long as your license otherwise remains
166 | in force. You may convey covered works to others for the sole purpose
167 | of having them make modifications exclusively for you, or provide you
168 | with facilities for running those works, provided that you comply with
169 | the terms of this License in conveying all material for which you do
170 | not control copyright. Those thus making or running the covered works
171 | for you must do so exclusively on your behalf, under your direction
172 | and control, on terms that prohibit them from making any copies of
173 | your copyrighted material outside their relationship with you.
174 |
175 | Conveying under any other circumstances is permitted solely under
176 | the conditions stated below. Sublicensing is not allowed; section 10
177 | makes it unnecessary.
178 |
179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
180 |
181 | No covered work shall be deemed part of an effective technological
182 | measure under any applicable law fulfilling obligations under article
183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or
184 | similar laws prohibiting or restricting circumvention of such
185 | measures.
186 |
187 | When you convey a covered work, you waive any legal power to forbid
188 | circumvention of technological measures to the extent such circumvention
189 | is effected by exercising rights under this License with respect to
190 | the covered work, and you disclaim any intention to limit operation or
191 | modification of the work as a means of enforcing, against the work's
192 | users, your or third parties' legal rights to forbid circumvention of
193 | technological measures.
194 |
195 | 4. Conveying Verbatim Copies.
196 |
197 | You may convey verbatim copies of the Program's source code as you
198 | receive it, in any medium, provided that you conspicuously and
199 | appropriately publish on each copy an appropriate copyright notice;
200 | keep intact all notices stating that this License and any
201 | non-permissive terms added in accord with section 7 apply to the code;
202 | keep intact all notices of the absence of any warranty; and give all
203 | recipients a copy of this License along with the Program.
204 |
205 | You may charge any price or no price for each copy that you convey,
206 | and you may offer support or warranty protection for a fee.
207 |
208 | 5. Conveying Modified Source Versions.
209 |
210 | You may convey a work based on the Program, or the modifications to
211 | produce it from the Program, in the form of source code under the
212 | terms of section 4, provided that you also meet all of these conditions:
213 |
214 | a) The work must carry prominent notices stating that you modified
215 | it, and giving a relevant date.
216 |
217 | b) The work must carry prominent notices stating that it is
218 | released under this License and any conditions added under section
219 | 7. This requirement modifies the requirement in section 4 to
220 | "keep intact all notices".
221 |
222 | c) You must license the entire work, as a whole, under this
223 | License to anyone who comes into possession of a copy. This
224 | License will therefore apply, along with any applicable section 7
225 | additional terms, to the whole of the work, and all its parts,
226 | regardless of how they are packaged. This License gives no
227 | permission to license the work in any other way, but it does not
228 | invalidate such permission if you have separately received it.
229 |
230 | d) If the work has interactive user interfaces, each must display
231 | Appropriate Legal Notices; however, if the Program has interactive
232 | interfaces that do not display Appropriate Legal Notices, your
233 | work need not make them do so.
234 |
235 | A compilation of a covered work with other separate and independent
236 | works, which are not by their nature extensions of the covered work,
237 | and which are not combined with it such as to form a larger program,
238 | in or on a volume of a storage or distribution medium, is called an
239 | "aggregate" if the compilation and its resulting copyright are not
240 | used to limit the access or legal rights of the compilation's users
241 | beyond what the individual works permit. Inclusion of a covered work
242 | in an aggregate does not cause this License to apply to the other
243 | parts of the aggregate.
244 |
245 | 6. Conveying Non-Source Forms.
246 |
247 | You may convey a covered work in object code form under the terms
248 | of sections 4 and 5, provided that you also convey the
249 | machine-readable Corresponding Source under the terms of this License,
250 | in one of these ways:
251 |
252 | a) Convey the object code in, or embodied in, a physical product
253 | (including a physical distribution medium), accompanied by the
254 | Corresponding Source fixed on a durable physical medium
255 | customarily used for software interchange.
256 |
257 | b) Convey the object code in, or embodied in, a physical product
258 | (including a physical distribution medium), accompanied by a
259 | written offer, valid for at least three years and valid for as
260 | long as you offer spare parts or customer support for that product
261 | model, to give anyone who possesses the object code either (1) a
262 | copy of the Corresponding Source for all the software in the
263 | product that is covered by this License, on a durable physical
264 | medium customarily used for software interchange, for a price no
265 | more than your reasonable cost of physically performing this
266 | conveying of source, or (2) access to copy the
267 | Corresponding Source from a network server at no charge.
268 |
269 | c) Convey individual copies of the object code with a copy of the
270 | written offer to provide the Corresponding Source. This
271 | alternative is allowed only occasionally and noncommercially, and
272 | only if you received the object code with such an offer, in accord
273 | with subsection 6b.
274 |
275 | d) Convey the object code by offering access from a designated
276 | place (gratis or for a charge), and offer equivalent access to the
277 | Corresponding Source in the same way through the same place at no
278 | further charge. You need not require recipients to copy the
279 | Corresponding Source along with the object code. If the place to
280 | copy the object code is a network server, the Corresponding Source
281 | may be on a different server (operated by you or a third party)
282 | that supports equivalent copying facilities, provided you maintain
283 | clear directions next to the object code saying where to find the
284 | Corresponding Source. Regardless of what server hosts the
285 | Corresponding Source, you remain obligated to ensure that it is
286 | available for as long as needed to satisfy these requirements.
287 |
288 | e) Convey the object code using peer-to-peer transmission, provided
289 | you inform other peers where the object code and Corresponding
290 | Source of the work are being offered to the general public at no
291 | charge under subsection 6d.
292 |
293 | A separable portion of the object code, whose source code is excluded
294 | from the Corresponding Source as a System Library, need not be
295 | included in conveying the object code work.
296 |
297 | A "User Product" is either (1) a "consumer product", which means any
298 | tangible personal property which is normally used for personal, family,
299 | or household purposes, or (2) anything designed or sold for incorporation
300 | into a dwelling. In determining whether a product is a consumer product,
301 | doubtful cases shall be resolved in favor of coverage. For a particular
302 | product received by a particular user, "normally used" refers to a
303 | typical or common use of that class of product, regardless of the status
304 | of the particular user or of the way in which the particular user
305 | actually uses, or expects or is expected to use, the product. A product
306 | is a consumer product regardless of whether the product has substantial
307 | commercial, industrial or non-consumer uses, unless such uses represent
308 | the only significant mode of use of the product.
309 |
310 | "Installation Information" for a User Product means any methods,
311 | procedures, authorization keys, or other information required to install
312 | and execute modified versions of a covered work in that User Product from
313 | a modified version of its Corresponding Source. The information must
314 | suffice to ensure that the continued functioning of the modified object
315 | code is in no case prevented or interfered with solely because
316 | modification has been made.
317 |
318 | If you convey an object code work under this section in, or with, or
319 | specifically for use in, a User Product, and the conveying occurs as
320 | part of a transaction in which the right of possession and use of the
321 | User Product is transferred to the recipient in perpetuity or for a
322 | fixed term (regardless of how the transaction is characterized), the
323 | Corresponding Source conveyed under this section must be accompanied
324 | by the Installation Information. But this requirement does not apply
325 | if neither you nor any third party retains the ability to install
326 | modified object code on the User Product (for example, the work has
327 | been installed in ROM).
328 |
329 | The requirement to provide Installation Information does not include a
330 | requirement to continue to provide support service, warranty, or updates
331 | for a work that has been modified or installed by the recipient, or for
332 | the User Product in which it has been modified or installed. Access to a
333 | network may be denied when the modification itself materially and
334 | adversely affects the operation of the network or violates the rules and
335 | protocols for communication across the network.
336 |
337 | Corresponding Source conveyed, and Installation Information provided,
338 | in accord with this section must be in a format that is publicly
339 | documented (and with an implementation available to the public in
340 | source code form), and must require no special password or key for
341 | unpacking, reading or copying.
342 |
343 | 7. Additional Terms.
344 |
345 | "Additional permissions" are terms that supplement the terms of this
346 | License by making exceptions from one or more of its conditions.
347 | Additional permissions that are applicable to the entire Program shall
348 | be treated as though they were included in this License, to the extent
349 | that they are valid under applicable law. If additional permissions
350 | apply only to part of the Program, that part may be used separately
351 | under those permissions, but the entire Program remains governed by
352 | this License without regard to the additional permissions.
353 |
354 | When you convey a copy of a covered work, you may at your option
355 | remove any additional permissions from that copy, or from any part of
356 | it. (Additional permissions may be written to require their own
357 | removal in certain cases when you modify the work.) You may place
358 | additional permissions on material, added by you to a covered work,
359 | for which you have or can give appropriate copyright permission.
360 |
361 | Notwithstanding any other provision of this License, for material you
362 | add to a covered work, you may (if authorized by the copyright holders of
363 | that material) supplement the terms of this License with terms:
364 |
365 | a) Disclaiming warranty or limiting liability differently from the
366 | terms of sections 15 and 16 of this License; or
367 |
368 | b) Requiring preservation of specified reasonable legal notices or
369 | author attributions in that material or in the Appropriate Legal
370 | Notices displayed by works containing it; or
371 |
372 | c) Prohibiting misrepresentation of the origin of that material, or
373 | requiring that modified versions of such material be marked in
374 | reasonable ways as different from the original version; or
375 |
376 | d) Limiting the use for publicity purposes of names of licensors or
377 | authors of the material; or
378 |
379 | e) Declining to grant rights under trademark law for use of some
380 | trade names, trademarks, or service marks; or
381 |
382 | f) Requiring indemnification of licensors and authors of that
383 | material by anyone who conveys the material (or modified versions of
384 | it) with contractual assumptions of liability to the recipient, for
385 | any liability that these contractual assumptions directly impose on
386 | those licensors and authors.
387 |
388 | All other non-permissive additional terms are considered "further
389 | restrictions" within the meaning of section 10. If the Program as you
390 | received it, or any part of it, contains a notice stating that it is
391 | governed by this License along with a term that is a further
392 | restriction, you may remove that term. If a license document contains
393 | a further restriction but permits relicensing or conveying under this
394 | License, you may add to a covered work material governed by the terms
395 | of that license document, provided that the further restriction does
396 | not survive such relicensing or conveying.
397 |
398 | If you add terms to a covered work in accord with this section, you
399 | must place, in the relevant source files, a statement of the
400 | additional terms that apply to those files, or a notice indicating
401 | where to find the applicable terms.
402 |
403 | Additional terms, permissive or non-permissive, may be stated in the
404 | form of a separately written license, or stated as exceptions;
405 | the above requirements apply either way.
406 |
407 | 8. Termination.
408 |
409 | You may not propagate or modify a covered work except as expressly
410 | provided under this License. Any attempt otherwise to propagate or
411 | modify it is void, and will automatically terminate your rights under
412 | this License (including any patent licenses granted under the third
413 | paragraph of section 11).
414 |
415 | However, if you cease all violation of this License, then your
416 | license from a particular copyright holder is reinstated (a)
417 | provisionally, unless and until the copyright holder explicitly and
418 | finally terminates your license, and (b) permanently, if the copyright
419 | holder fails to notify you of the violation by some reasonable means
420 | prior to 60 days after the cessation.
421 |
422 | Moreover, your license from a particular copyright holder is
423 | reinstated permanently if the copyright holder notifies you of the
424 | violation by some reasonable means, this is the first time you have
425 | received notice of violation of this License (for any work) from that
426 | copyright holder, and you cure the violation prior to 30 days after
427 | your receipt of the notice.
428 |
429 | Termination of your rights under this section does not terminate the
430 | licenses of parties who have received copies or rights from you under
431 | this License. If your rights have been terminated and not permanently
432 | reinstated, you do not qualify to receive new licenses for the same
433 | material under section 10.
434 |
435 | 9. Acceptance Not Required for Having Copies.
436 |
437 | You are not required to accept this License in order to receive or
438 | run a copy of the Program. Ancillary propagation of a covered work
439 | occurring solely as a consequence of using peer-to-peer transmission
440 | to receive a copy likewise does not require acceptance. However,
441 | nothing other than this License grants you permission to propagate or
442 | modify any covered work. These actions infringe copyright if you do
443 | not accept this License. Therefore, by modifying or propagating a
444 | covered work, you indicate your acceptance of this License to do so.
445 |
446 | 10. Automatic Licensing of Downstream Recipients.
447 |
448 | Each time you convey a covered work, the recipient automatically
449 | receives a license from the original licensors, to run, modify and
450 | propagate that work, subject to this License. You are not responsible
451 | for enforcing compliance by third parties with this License.
452 |
453 | An "entity transaction" is a transaction transferring control of an
454 | organization, or substantially all assets of one, or subdividing an
455 | organization, or merging organizations. If propagation of a covered
456 | work results from an entity transaction, each party to that
457 | transaction who receives a copy of the work also receives whatever
458 | licenses to the work the party's predecessor in interest had or could
459 | give under the previous paragraph, plus a right to possession of the
460 | Corresponding Source of the work from the predecessor in interest, if
461 | the predecessor has it or can get it with reasonable efforts.
462 |
463 | You may not impose any further restrictions on the exercise of the
464 | rights granted or affirmed under this License. For example, you may
465 | not impose a license fee, royalty, or other charge for exercise of
466 | rights granted under this License, and you may not initiate litigation
467 | (including a cross-claim or counterclaim in a lawsuit) alleging that
468 | any patent claim is infringed by making, using, selling, offering for
469 | sale, or importing the Program or any portion of it.
470 |
471 | 11. Patents.
472 |
473 | A "contributor" is a copyright holder who authorizes use under this
474 | License of the Program or a work on which the Program is based. The
475 | work thus licensed is called the contributor's "contributor version".
476 |
477 | A contributor's "essential patent claims" are all patent claims
478 | owned or controlled by the contributor, whether already acquired or
479 | hereafter acquired, that would be infringed by some manner, permitted
480 | by this License, of making, using, or selling its contributor version,
481 | but do not include claims that would be infringed only as a
482 | consequence of further modification of the contributor version. For
483 | purposes of this definition, "control" includes the right to grant
484 | patent sublicenses in a manner consistent with the requirements of
485 | this License.
486 |
487 | Each contributor grants you a non-exclusive, worldwide, royalty-free
488 | patent license under the contributor's essential patent claims, to
489 | make, use, sell, offer for sale, import and otherwise run, modify and
490 | propagate the contents of its contributor version.
491 |
492 | In the following three paragraphs, a "patent license" is any express
493 | agreement or commitment, however denominated, not to enforce a patent
494 | (such as an express permission to practice a patent or covenant not to
495 | sue for patent infringement). To "grant" such a patent license to a
496 | party means to make such an agreement or commitment not to enforce a
497 | patent against the party.
498 |
499 | If you convey a covered work, knowingly relying on a patent license,
500 | and the Corresponding Source of the work is not available for anyone
501 | to copy, free of charge and under the terms of this License, through a
502 | publicly available network server or other readily accessible means,
503 | then you must either (1) cause the Corresponding Source to be so
504 | available, or (2) arrange to deprive yourself of the benefit of the
505 | patent license for this particular work, or (3) arrange, in a manner
506 | consistent with the requirements of this License, to extend the patent
507 | license to downstream recipients. "Knowingly relying" means you have
508 | actual knowledge that, but for the patent license, your conveying the
509 | covered work in a country, or your recipient's use of the covered work
510 | in a country, would infringe one or more identifiable patents in that
511 | country that you have reason to believe are valid.
512 |
513 | If, pursuant to or in connection with a single transaction or
514 | arrangement, you convey, or propagate by procuring conveyance of, a
515 | covered work, and grant a patent license to some of the parties
516 | receiving the covered work authorizing them to use, propagate, modify
517 | or convey a specific copy of the covered work, then the patent license
518 | you grant is automatically extended to all recipients of the covered
519 | work and works based on it.
520 |
521 | A patent license is "discriminatory" if it does not include within
522 | the scope of its coverage, prohibits the exercise of, or is
523 | conditioned on the non-exercise of one or more of the rights that are
524 | specifically granted under this License. You may not convey a covered
525 | work if you are a party to an arrangement with a third party that is
526 | in the business of distributing software, under which you make payment
527 | to the third party based on the extent of your activity of conveying
528 | the work, and under which the third party grants, to any of the
529 | parties who would receive the covered work from you, a discriminatory
530 | patent license (a) in connection with copies of the covered work
531 | conveyed by you (or copies made from those copies), or (b) primarily
532 | for and in connection with specific products or compilations that
533 | contain the covered work, unless you entered into that arrangement,
534 | or that patent license was granted, prior to 28 March 2007.
535 |
536 | Nothing in this License shall be construed as excluding or limiting
537 | any implied license or other defenses to infringement that may
538 | otherwise be available to you under applicable patent law.
539 |
540 | 12. No Surrender of Others' Freedom.
541 |
542 | If conditions are imposed on you (whether by court order, agreement or
543 | otherwise) that contradict the conditions of this License, they do not
544 | excuse you from the conditions of this License. If you cannot convey a
545 | covered work so as to satisfy simultaneously your obligations under this
546 | License and any other pertinent obligations, then as a consequence you may
547 | not convey it at all. For example, if you agree to terms that obligate you
548 | to collect a royalty for further conveying from those to whom you convey
549 | the Program, the only way you could satisfy both those terms and this
550 | License would be to refrain entirely from conveying the Program.
551 |
552 | 13. Use with the GNU Affero General Public License.
553 |
554 | Notwithstanding any other provision of this License, you have
555 | permission to link or combine any covered work with a work licensed
556 | under version 3 of the GNU Affero General Public License into a single
557 | combined work, and to convey the resulting work. The terms of this
558 | License will continue to apply to the part which is the covered work,
559 | but the special requirements of the GNU Affero General Public License,
560 | section 13, concerning interaction through a network will apply to the
561 | combination as such.
562 |
563 | 14. Revised Versions of this License.
564 |
565 | The Free Software Foundation may publish revised and/or new versions of
566 | the GNU General Public License from time to time. Such new versions will
567 | be similar in spirit to the present version, but may differ in detail to
568 | address new problems or concerns.
569 |
570 | Each version is given a distinguishing version number. If the
571 | Program specifies that a certain numbered version of the GNU General
572 | Public License "or any later version" applies to it, you have the
573 | option of following the terms and conditions either of that numbered
574 | version or of any later version published by the Free Software
575 | Foundation. If the Program does not specify a version number of the
576 | GNU General Public License, you may choose any version ever published
577 | by the Free Software Foundation.
578 |
579 | If the Program specifies that a proxy can decide which future
580 | versions of the GNU General Public License can be used, that proxy's
581 | public statement of acceptance of a version permanently authorizes you
582 | to choose that version for the Program.
583 |
584 | Later license versions may give you additional or different
585 | permissions. However, no additional obligations are imposed on any
586 | author or copyright holder as a result of your choosing to follow a
587 | later version.
588 |
589 | 15. Disclaimer of Warranty.
590 |
591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
599 |
600 | 16. Limitation of Liability.
601 |
602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
610 | SUCH DAMAGES.
611 |
612 | 17. Interpretation of Sections 15 and 16.
613 |
614 | If the disclaimer of warranty and limitation of liability provided
615 | above cannot be given local legal effect according to their terms,
616 | reviewing courts shall apply local law that most closely approximates
617 | an absolute waiver of all civil liability in connection with the
618 | Program, unless a warranty or assumption of liability accompanies a
619 | copy of the Program in return for a fee.
620 |
621 | END OF TERMS AND CONDITIONS
622 |
623 | How to Apply These Terms to Your New Programs
624 |
625 | If you develop a new program, and you want it to be of the greatest
626 | possible use to the public, the best way to achieve this is to make it
627 | free software which everyone can redistribute and change under these terms.
628 |
629 | To do so, attach the following notices to the program. It is safest
630 | to attach them to the start of each source file to most effectively
631 | state the exclusion of warranty; and each file should have at least
632 | the "copyright" line and a pointer to where the full notice is found.
633 |
634 | {one line to give the program's name and a brief idea of what it does.}
635 | Copyright (C) {year} {name of author}
636 |
637 | This program is free software: you can redistribute it and/or modify
638 | it under the terms of the GNU General Public License as published by
639 | the Free Software Foundation, either version 3 of the License, or
640 | (at your option) any later version.
641 |
642 | This program is distributed in the hope that it will be useful,
643 | but WITHOUT ANY WARRANTY; without even the implied warranty of
644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
645 | GNU General Public License for more details.
646 |
647 | You should have received a copy of the GNU General Public License
648 | along with this program. If not, see .
649 |
650 | Also add information on how to contact you by electronic and paper mail.
651 |
652 | If the program does terminal interaction, make it output a short
653 | notice like this when it starts in an interactive mode:
654 |
655 | {project} Copyright (C) {year} {fullname}
656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
657 | This is free software, and you are welcome to redistribute it
658 | under certain conditions; type `show c' for details.
659 |
660 | The hypothetical commands `show w' and `show c' should show the appropriate
661 | parts of the General Public License. Of course, your program's commands
662 | might be different; for a GUI interface, you would use an "about box".
663 |
664 | You should also get your employer (if you work as a programmer) or school,
665 | if any, to sign a "copyright disclaimer" for the program, if necessary.
666 | For more information on this, and how to apply and follow the GNU GPL, see
667 | .
668 |
669 | The GNU General Public License does not permit incorporating your program
670 | into proprietary programs. If your program is a subroutine library, you
671 | may consider it more useful to permit linking proprietary applications with
672 | the library. If this is what you want to do, use the GNU Lesser General
673 | Public License instead of this License. But first, please read
674 | .
675 |
676 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # planetbusters
2 | Small game for the LibGDX jam
3 |
4 | Sadly I'm just to swamped with Space Grunts and Heroes of Loot 2 work so
5 | I simply don't have time to put a lot more into this.
6 |
7 | I do think it can be fleshed into a pretty fun game with shops, weapon upgrades
8 | different planet environments and more, so let me know if you do something with it!
9 | It's actually possible I might pick this up later in the year to do something with it
10 | myself.. we'll see!
11 |
12 | As it is now, it's just a quick shooter, you can't die or lose, no menu or interface, etc.
13 |
14 |
15 | # how to play
16 |
17 | The default keyboard settings are the only ones available so:
18 | arrow keys to run, X to shoot
19 |
20 | You can change those in ArcadeCanvas or if I have time I'll add the keyboard setup stuff
21 | I used in my other games.
22 |
23 | # libgdx usage
24 | So you might notice some weird things going on that could be done different (better?)
25 | when I would use more of LibGDX's stuff, but I mainly use LibGDX as the layer between my
26 | own framework and the OS.
27 |
28 | The upside of this is that it makes things portable to other systems where libgdx
29 | doesn't run, or even to other middleware.
30 |
31 | Also I'm not the cleanest of coders, this is actually one of my neater sources (but it's
32 | also very small compared to other stuff). My idea is: if the code works, it works, move on!
33 |
--------------------------------------------------------------------------------
/android/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/android/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Planet Busters-android
4 |
5 |
6 |
7 | org.eclipse.jdt.core.javanature
8 | com.android.ide.eclipse.adt.AndroidNature
9 |
10 |
11 |
12 | com.android.ide.eclipse.adt.ResourceManagerBuilder
13 |
14 |
15 |
16 | com.android.ide.eclipse.adt.PreCompilerBuilder
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javabuilder
21 |
22 |
23 |
24 | com.android.ide.eclipse.adt.ApkBuilder
25 |
26 |
27 |
28 |
29 |
30 |
--------------------------------------------------------------------------------
/android/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #
2 | #Sat Dec 19 10:43:55 CET 2015
3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
4 | org.eclipse.jdt.core.compiler.compliance=1.6
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
10 | eclipse.preferences.version=1
11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
12 | org.eclipse.jdt.core.compiler.source=1.6
13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
14 |
--------------------------------------------------------------------------------
/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
9 |
14 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/android/assets/audio/fxsplash.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/audio/fxsplash.mp3
--------------------------------------------------------------------------------
/android/assets/lights.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/lights.png
--------------------------------------------------------------------------------
/android/assets/m01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/m01.png
--------------------------------------------------------------------------------
/android/assets/spl2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/spl2.png
--------------------------------------------------------------------------------
/android/assets/t01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/t01.png
--------------------------------------------------------------------------------
/android/assets/t02.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/t02.png
--------------------------------------------------------------------------------
/android/assets/t03.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/t03.png
--------------------------------------------------------------------------------
/android/assets/uipcfont.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/assets/uipcfont.png
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | android {
2 | buildToolsVersion "23.0.2"
3 | compileSdkVersion 23
4 | sourceSets {
5 | main {
6 | manifest.srcFile 'AndroidManifest.xml'
7 | java.srcDirs = ['src']
8 | aidl.srcDirs = ['src']
9 | renderscript.srcDirs = ['src']
10 | res.srcDirs = ['res']
11 | assets.srcDirs = ['assets']
12 | jniLibs.srcDirs = ['libs']
13 | }
14 |
15 | instrumentTest.setRoot('tests')
16 | }
17 | }
18 |
19 |
20 | // called every time gradle gets executed, takes the native dependencies of
21 | // the natives configuration, and extracts them to the proper libs/ folders
22 | // so they get packed with the APK.
23 | task copyAndroidNatives() {
24 | file("libs/armeabi/").mkdirs();
25 | file("libs/armeabi-v7a/").mkdirs();
26 | file("libs/x86/").mkdirs();
27 |
28 | configurations.natives.files.each { jar ->
29 | def outputDir = null
30 | if(jar.name.endsWith("natives-armeabi-v7a.jar")) outputDir = file("libs/armeabi-v7a")
31 | if(jar.name.endsWith("natives-armeabi.jar")) outputDir = file("libs/armeabi")
32 | if(jar.name.endsWith("natives-x86.jar")) outputDir = file("libs/x86")
33 | if(outputDir != null) {
34 | copy {
35 | from zipTree(jar)
36 | into outputDir
37 | include "*.so"
38 | }
39 | }
40 | }
41 | }
42 |
43 | task run(type: Exec) {
44 | def path
45 | def localProperties = project.file("../local.properties")
46 | if (localProperties.exists()) {
47 | Properties properties = new Properties()
48 | localProperties.withInputStream { instr ->
49 | properties.load(instr)
50 | }
51 | def sdkDir = properties.getProperty('sdk.dir')
52 | if (sdkDir) {
53 | path = sdkDir
54 | } else {
55 | path = "$System.env.ANDROID_HOME"
56 | }
57 | } else {
58 | path = "$System.env.ANDROID_HOME"
59 | }
60 |
61 | def adb = path + "/platform-tools/adb"
62 | commandLine "$adb", 'shell', 'am', 'start', '-n', 'com.orangepixel.planetbusters.android/com.orangepixel.planetbusters.android.AndroidLauncher'
63 | }
64 |
65 | // sets up the Android Eclipse project, using the old Ant based build.
66 | eclipse {
67 | // need to specify Java source sets explicitely, SpringSource Gradle Eclipse plugin
68 | // ignores any nodes added in classpath.file.withXml
69 | sourceSets {
70 | main {
71 | java.srcDirs "src", 'gen'
72 | }
73 | }
74 |
75 | jdt {
76 | sourceCompatibility = 1.6
77 | targetCompatibility = 1.6
78 | }
79 |
80 | classpath {
81 | plusConfigurations += [ project.configurations.compile ]
82 | containers 'com.android.ide.eclipse.adt.ANDROID_FRAMEWORK', 'com.android.ide.eclipse.adt.LIBRARIES'
83 | }
84 |
85 | project {
86 | name = appName + "-android"
87 | natures 'com.android.ide.eclipse.adt.AndroidNature'
88 | buildCommands.clear();
89 | buildCommand "com.android.ide.eclipse.adt.ResourceManagerBuilder"
90 | buildCommand "com.android.ide.eclipse.adt.PreCompilerBuilder"
91 | buildCommand "org.eclipse.jdt.core.javabuilder"
92 | buildCommand "com.android.ide.eclipse.adt.ApkBuilder"
93 | }
94 | }
95 |
96 | // sets up the Android Idea project, using the old Ant based build.
97 | idea {
98 | module {
99 | sourceDirs += file("src");
100 | scopes = [ COMPILE: [plus:[project.configurations.compile]]]
101 |
102 | iml {
103 | withXml {
104 | def node = it.asNode()
105 | def builder = NodeBuilder.newInstance();
106 | builder.current = node;
107 | builder.component(name: "FacetManager") {
108 | facet(type: "android", name: "Android") {
109 | configuration {
110 | option(name: "UPDATE_PROPERTY_FILES", value:"true")
111 | }
112 | }
113 | }
114 | }
115 | }
116 | }
117 | }
118 |
--------------------------------------------------------------------------------
/android/gen/com/orangepixel/planetbusters/android/BuildConfig.java:
--------------------------------------------------------------------------------
1 | /** Automatically generated file. DO NOT MODIFY */
2 | package com.orangepixel.planetbusters.android;
3 |
4 | public final class BuildConfig {
5 | public final static boolean DEBUG = true;
6 | }
--------------------------------------------------------------------------------
/android/gen/com/orangepixel/planetbusters/android/R.java:
--------------------------------------------------------------------------------
1 | /* AUTO-GENERATED FILE. DO NOT MODIFY.
2 | *
3 | * This class was automatically generated by the
4 | * aapt tool from the resource data it found. It
5 | * should not be modified by hand.
6 | */
7 |
8 | package com.orangepixel.planetbusters.android;
9 |
10 | public final class R {
11 | public static final class attr {
12 | }
13 | public static final class drawable {
14 | public static final int ic_launcher=0x7f020000;
15 | }
16 | public static final class string {
17 | public static final int app_name=0x7f030000;
18 | }
19 | public static final class style {
20 | public static final int GdxTheme=0x7f040000;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/android/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/ic_launcher-web.png
--------------------------------------------------------------------------------
/android/libs/armeabi-v7a/libgdx.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/libs/armeabi-v7a/libgdx.so
--------------------------------------------------------------------------------
/android/libs/armeabi/libgdx.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/libs/armeabi/libgdx.so
--------------------------------------------------------------------------------
/android/libs/x86/libgdx.so:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/libs/x86/libgdx.so
--------------------------------------------------------------------------------
/android/lint.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/android/proguard-project.txt:
--------------------------------------------------------------------------------
1 | # To enable ProGuard in your project, edit project.properties
2 | # to define the proguard.config property as described in that file.
3 | #
4 | # Add project specific ProGuard rules here.
5 | # By default, the flags in this file are appended to flags specified
6 | # in ${sdk.dir}/tools/proguard/proguard-android.txt
7 | # You can edit the include path and order by changing the ProGuard
8 | # include property in project.properties.
9 | #
10 | # For more details, see
11 | # http://developer.android.com/guide/developing/tools/proguard.html
12 |
13 | # Add any project specific keep options here:
14 |
15 | # If your project uses WebView with JS, uncomment the following
16 | # and specify the fully qualified class name to the JavaScript interface
17 | # class:
18 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19 | # public *;
20 | #}
21 |
22 | -verbose
23 |
24 | -dontwarn android.support.**
25 | -dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication
26 | -dontwarn com.badlogic.gdx.utils.GdxBuild
27 | -dontwarn com.badlogic.gdx.physics.box2d.utils.Box2DBuild
28 | -dontwarn com.badlogic.gdx.jnigen.BuildTarget*
29 | -dontwarn com.badlogic.gdx.graphics.g2d.freetype.FreetypeBuild
30 |
31 | -keep class com.badlogic.gdx.controllers.android.AndroidControllers
32 |
33 | -keepclassmembers class com.badlogic.gdx.backends.android.AndroidInput* {
34 | (com.badlogic.gdx.Application, android.content.Context, java.lang.Object, com.badlogic.gdx.backends.android.AndroidApplicationConfiguration);
35 | }
36 |
37 | -keepclassmembers class com.badlogic.gdx.physics.box2d.World {
38 | boolean contactFilter(long, long);
39 | void beginContact(long);
40 | void endContact(long);
41 | void preSolve(long, long);
42 | void postSolve(long, long);
43 | boolean reportFixture(long);
44 | float reportRayFixture(long, float, float, float, float, float);
45 | }
46 |
--------------------------------------------------------------------------------
/android/project.properties:
--------------------------------------------------------------------------------
1 | # This file is automatically generated by Android Tools.
2 | # Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3 | #
4 | # This file must be checked in Version Control Systems.
5 | #
6 | # To customize properties used by the Ant build system edit
7 | # "ant.properties", and override values to adapt the script to your
8 | # project structure.
9 | #
10 | # To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12 |
13 | # Project target.
14 | target=android-23
15 |
--------------------------------------------------------------------------------
/android/res/drawable-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/res/drawable-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/res/drawable-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/res/drawable-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/drawable-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/android/res/drawable-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Planet Busters
5 |
6 |
7 |
--------------------------------------------------------------------------------
/android/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/android/src/com/orangepixel/planetbusters/android/AndroidLauncher.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters.android;
2 |
3 | import android.os.Bundle;
4 |
5 | import com.badlogic.gdx.backends.android.AndroidApplication;
6 | import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration;
7 | import com.orangepixel.planetbusters.myCanvas;
8 |
9 | public class AndroidLauncher extends AndroidApplication {
10 | @Override
11 | protected void onCreate (Bundle savedInstanceState) {
12 | super.onCreate(savedInstanceState);
13 | AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
14 | initialize(new myCanvas(), config);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | mavenCentral()
4 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
5 | }
6 | dependencies {
7 | classpath 'com.android.tools.build:gradle:1.2.3'
8 | classpath 'org.robovm:robovm-gradle-plugin:1.9.0'
9 | }
10 | }
11 |
12 | allprojects {
13 | apply plugin: "eclipse"
14 | apply plugin: "idea"
15 |
16 | version = '1.0'
17 | ext {
18 | appName = "Planet Busters"
19 | gdxVersion = '1.7.1'
20 | roboVMVersion = '1.9.0'
21 | box2DLightsVersion = '1.4'
22 | ashleyVersion = '1.7.0'
23 | aiVersion = '1.6.0'
24 | }
25 |
26 | repositories {
27 | mavenCentral()
28 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
29 | maven { url "https://oss.sonatype.org/content/repositories/releases/" }
30 | }
31 | }
32 |
33 | project(":desktop") {
34 | apply plugin: "java"
35 |
36 |
37 | dependencies {
38 | compile project(":core")
39 | compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
40 | compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
41 | compile "com.badlogicgames.gdx:gdx-controllers-desktop:$gdxVersion"
42 | compile "com.badlogicgames.gdx:gdx-controllers-platform:$gdxVersion:natives-desktop"
43 | }
44 | }
45 |
46 | project(":android") {
47 | apply plugin: "android"
48 |
49 | configurations { natives }
50 |
51 | dependencies {
52 | compile project(":core")
53 | compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
54 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
55 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
56 | natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
57 | compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
58 | compile "com.badlogicgames.gdx:gdx-controllers-android:$gdxVersion"
59 | }
60 | }
61 |
62 | project(":ios") {
63 | apply plugin: "java"
64 | apply plugin: "robovm"
65 |
66 |
67 | dependencies {
68 | compile project(":core")
69 | compile "org.robovm:robovm-rt:$roboVMVersion"
70 | compile "org.robovm:robovm-cocoatouch:$roboVMVersion"
71 | compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
72 | compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
73 | }
74 | }
75 |
76 | project(":core") {
77 | apply plugin: "java"
78 |
79 |
80 | dependencies {
81 | compile "com.badlogicgames.gdx:gdx:$gdxVersion"
82 | compile "com.badlogicgames.gdx:gdx-controllers:$gdxVersion"
83 | }
84 | }
85 |
86 | tasks.eclipse.doLast {
87 | delete ".project"
88 | }
--------------------------------------------------------------------------------
/core/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/core/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Planet Busters-core
4 |
5 |
6 |
7 | org.eclipse.jdt.core.javanature
8 |
9 |
10 |
11 | org.eclipse.jdt.core.javabuilder
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/core/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #
2 | #Sat Dec 19 10:43:55 CET 2015
3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
4 | org.eclipse.jdt.core.compiler.compliance=1.6
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
10 | eclipse.preferences.version=1
11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
12 | org.eclipse.jdt.core.compiler.source=1.6
13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
14 |
--------------------------------------------------------------------------------
/core/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 |
3 | sourceCompatibility = 1.6
4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5 |
6 | sourceSets.main.java.srcDirs = [ "src/" ]
7 |
8 |
9 | eclipse.project {
10 | name = appName + "-core"
11 | }
12 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/ControllerMapping.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 | import com.badlogic.gdx.controllers.PovDirection;
4 |
5 | public class ControllerMapping {
6 | public String id="generic";
7 | public int BUTTON_A = 0;
8 | public int BUTTON_B = 1;
9 | public int BUTTON_X = 2;
10 | public int BUTTON_Y = 3;
11 | public int BUTTON_LB = 4;
12 | public int BUTTON_RB = 5;
13 | public int BUTTON_BACK = 6;
14 | public int BUTTON_START = 7;
15 | public int BUTTON_LS = 8; //Left Stick pressed down
16 | public int BUTTON_RS = 9; //Right Stick pressed down
17 |
18 | public PovDirection DPAD_UP = PovDirection.north;
19 | public PovDirection DPAD_DOWN = PovDirection.south;
20 | public PovDirection DPAD_LEFT = PovDirection.west;
21 | public PovDirection DPAD_RIGHT = PovDirection.east;
22 |
23 | public int BUTTON_DPAD_UP=0;
24 | public int BUTTON_DPAD_DOWN=1;
25 | public int BUTTON_DPAD_LEFT=2;
26 | public int BUTTON_DPAD_RIGHT=3;
27 |
28 | public int POV = 0;
29 |
30 | public int AXIS_LX = 1; //-1 is left | +1 is right
31 | public int AXIS_LY = 0; //-1 is up | +1 is down
32 | public int AXIS_RX = 3; //-1 is left | +1 is right
33 | public int AXIS_RY = 2; //-1 is up | +1 is down
34 | public int AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
35 |
36 | public boolean reverseXAxis=false;
37 | public boolean reverseYAxis=false;
38 |
39 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/GSGamePad.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 | // GameStop Red Samurai Gamepad controller support
4 |
5 | public class GSGamePad extends ControllerMapping {
6 |
7 | public GSGamePad() {
8 | id="gsgamepad";
9 | BUTTON_A = 0; // 96
10 | BUTTON_B = 1; // 97
11 | BUTTON_X = 2; // 99
12 | BUTTON_Y = 3; // 100
13 | BUTTON_LB = 4;
14 | BUTTON_RB = 5;
15 | BUTTON_BACK = 6;
16 | BUTTON_START = 7;
17 | BUTTON_LS = 8; //Left Stick pressed down
18 | BUTTON_RS = 9; //Right Stick pressed down
19 |
20 | POV = 0;
21 |
22 | AXIS_LY = 1; //-1 is up | +1 is down
23 | AXIS_LX = 0; //-1 is left | +1 is right
24 | AXIS_RY = 3; //-1 is up | +1 is down
25 | AXIS_RX = 2; //-1 is left | +1 is right
26 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/GSGamePadAndroid.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 | // GameStop Red Samurai Gamepad controller support
4 |
5 | public class GSGamePadAndroid extends ControllerMapping {
6 |
7 | public GSGamePadAndroid() {
8 | id="gsgamepad";
9 | BUTTON_A = 96;
10 | BUTTON_B = 97;
11 | BUTTON_X = 99;
12 | BUTTON_Y = 100;
13 | BUTTON_LB = 102;
14 | BUTTON_RB = 103;
15 | BUTTON_BACK = 6;
16 | BUTTON_START = 7;
17 | BUTTON_LS = 8; //Left Stick pressed down
18 | BUTTON_RS = 9; //Right Stick pressed down
19 |
20 | BUTTON_DPAD_UP=19;
21 | BUTTON_DPAD_DOWN=20;
22 | BUTTON_DPAD_LEFT=21;
23 | BUTTON_DPAD_RIGHT=22;
24 |
25 | POV = 0;
26 |
27 | AXIS_LY = 1; //-1 is up | +1 is down
28 | AXIS_LX = 0; //-1 is left | +1 is right
29 | AXIS_RY = 3; //-1 is up | +1 is down
30 | AXIS_RX = 2; //-1 is left | +1 is right
31 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/Gamepad.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 |
5 | public class Gamepad {
6 |
7 | public ControllerMapping mapping;
8 |
9 | // to keep track of 1st or 2nd controller, track the hashcode
10 | public int hashcode;
11 | public String name;
12 |
13 | public boolean isTouchscreen;
14 | public boolean isKeyboard;
15 | public boolean isGamepad;
16 | public boolean isMouse;
17 |
18 | public boolean backPressed;
19 | public boolean backLocked;
20 |
21 | public boolean scrollWheelUp;
22 | public boolean scrollWheelDown;
23 |
24 | public boolean BUTTON_A;
25 | public boolean BUTTON_B;
26 | public boolean BUTTON_X;
27 | public boolean BUTTON_Y;
28 | public boolean BUTTON_LB;
29 | public boolean BUTTON_RB;
30 |
31 | public boolean BUTTON_SPECIAL1; // defined by the game code
32 | public boolean BUTTON_SPECIAL1locked;
33 |
34 | public boolean BUTTON_SPECIAL2; // defined by the game code
35 | public boolean BUTTON_SPECIAL2locked;
36 |
37 |
38 | public boolean BUTTON_DPADLeft;
39 | public boolean BUTTON_DPADUp;
40 | public boolean BUTTON_DPADRight;
41 | public boolean BUTTON_DPADDown;
42 |
43 |
44 | public boolean DPAD_UP;
45 | public boolean DPAD_RIGHT;
46 | public boolean DPAD_LEFT;
47 | public boolean DPAD_DOWN;
48 |
49 | public boolean BUTTON_DPADLeftLocked;
50 | public boolean BUTTON_DPADUpLocked;
51 | public boolean BUTTON_DPADRightLocked;
52 | public boolean BUTTON_DPADDownLocked;
53 |
54 | public boolean BUTTON_Alocked;
55 | public boolean BUTTON_Blocked;
56 | public boolean BUTTON_Xlocked;
57 | public boolean BUTTON_Ylocked;
58 | public boolean BUTTON_LBlocked;
59 | public boolean BUTTON_RBlocked;
60 |
61 |
62 | public boolean leftPressed;
63 | public boolean rightPressed;
64 | public boolean upPressed;
65 | public boolean downPressed;
66 |
67 | public boolean leftLocked;
68 | public boolean rightLocked;
69 | public boolean upLocked;
70 | public boolean downLocked;
71 |
72 | public int AXIS_LY;
73 | public int AXIS_LX;
74 | public int AXIS_RY;
75 | public int AXIS_RX;
76 |
77 |
78 | public final void isKeyboard() {
79 | isTouchscreen=false;
80 | isGamepad=false;
81 | isKeyboard=true;
82 | isMouse=false;
83 | }
84 |
85 | public final void isGamepad() {
86 | isTouchscreen=false;
87 | isGamepad=true;
88 | isKeyboard=false;
89 | isMouse=false;
90 | }
91 |
92 | public final void isTouchscreen() {
93 | isTouchscreen=true;
94 | isGamepad=false;
95 | isKeyboard=false;
96 | isMouse=false;
97 | }
98 |
99 | public final void isMouse() {
100 | isMouse=true;
101 | isTouchscreen=false;
102 | isGamepad=false;
103 | isKeyboard=false;
104 | }
105 |
106 | public Gamepad() {
107 | isKeyboard=false;
108 | isGamepad=false;
109 |
110 | backPressed=false;
111 | backLocked=false;
112 |
113 | BUTTON_A=false;
114 | BUTTON_B=false;
115 | BUTTON_X=false;
116 | BUTTON_Y=false;
117 |
118 | leftPressed=false;
119 | rightPressed=false;
120 | upPressed=false;
121 | downPressed=false;
122 |
123 | leftLocked=false;
124 | rightLocked=false;
125 | upLocked=false;
126 | downLocked=false;
127 |
128 | BUTTON_Alocked=false;
129 | BUTTON_Blocked=false;
130 | BUTTON_Xlocked=false;
131 | BUTTON_Ylocked=false;
132 |
133 | AXIS_LY=0;
134 | AXIS_LX=0;
135 | AXIS_RY=0;
136 | AXIS_RX=0;
137 | }
138 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/PS3.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // PS3 on OSX (on windows, it won't register button presses, requires tools/vague drivers
5 |
6 | public class PS3 extends ControllerMapping {
7 | public PS3() {
8 | id="ps3";
9 | BUTTON_A = 14;
10 | BUTTON_B = 13;
11 | BUTTON_X = 15;
12 | BUTTON_Y = 12;
13 | BUTTON_LB = 4;
14 | BUTTON_RB = 5;
15 | BUTTON_BACK = 6;
16 | BUTTON_START = 7;
17 | BUTTON_LS = 8; //Left Stick pressed down
18 | BUTTON_RS = 9; //Right Stick pressed down
19 |
20 | POV = 0;
21 |
22 | AXIS_LY = 1; //-1 is up | +1 is down
23 | AXIS_LX = 0; //-1 is left | +1 is right
24 | AXIS_RY = 3; //-1 is up | +1 is down
25 | AXIS_RX = 2; //-1 is left | +1 is right
26 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
27 | }
28 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/PS4.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // Dualshock 4 (ps4) on windows
5 |
6 | // Wireless Controller
7 | // OS: Windows
8 | public class PS4 extends ControllerMapping {
9 | public PS4() {
10 | id="ps4";
11 | BUTTON_A=1;
12 | BUTTON_B=2;
13 | BUTTON_X=0;
14 | BUTTON_Y=3;
15 | BUTTON_Y=3;
16 |
17 | // not confirmed, copied from ps3
18 | BUTTON_LB = 4;
19 | BUTTON_RB = 5;
20 | BUTTON_BACK = 6;
21 | BUTTON_START = 7;
22 | BUTTON_LS = 8; //Left Stick pressed down
23 | BUTTON_RS = 9; //Right Stick pressed down
24 |
25 | POV = 0;
26 | AXIS_LX=3;
27 | AXIS_LY=2;
28 | AXIS_RX=1;
29 | AXIS_RY=0;
30 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
31 | }
32 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/PS4OSX.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // Dualshock 4 (ps4) on windows
5 |
6 | // Wireless Controller
7 | // OS: osx
8 | public class PS4OSX extends ControllerMapping {
9 | public PS4OSX() {
10 | id="ps4";
11 | BUTTON_A=1;
12 | BUTTON_B=2;
13 | BUTTON_X=0;
14 | BUTTON_Y=3;
15 | BUTTON_Y=3;
16 |
17 | // not confirmed, copied from ps3
18 | BUTTON_LB = 4;
19 | BUTTON_RB = 5;
20 | BUTTON_BACK = 6;
21 | BUTTON_START = 7;
22 | BUTTON_LS = 8; //Left Stick pressed down
23 | BUTTON_RS = 9; //Right Stick pressed down
24 |
25 | POV = 0;
26 |
27 | AXIS_LX=0;
28 | AXIS_LY=1;
29 | AXIS_RX=2;
30 | AXIS_RY=3;
31 |
32 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
33 | }
34 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/ProExPowerA.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // USB Downlo01.50 Pro Ex (Pro Ex from PowerA)
5 |
6 | // Wireless Controller
7 | // OS: OSX
8 | public class ProExPowerA extends ControllerMapping {
9 | public ProExPowerA() {
10 | id="Pro ex";
11 | BUTTON_A=1;
12 | BUTTON_B=2;
13 | BUTTON_X=0;
14 | BUTTON_Y=3;
15 | BUTTON_Y=3;
16 |
17 | // not confirmed, copied from ps3
18 | BUTTON_LB = 4;
19 | BUTTON_RB = 5;
20 | BUTTON_BACK = 6;
21 | BUTTON_START = 7;
22 | BUTTON_LS = 8; //Left Stick pressed down
23 | BUTTON_RS = 9; //Right Stick pressed down
24 |
25 | POV = 0;
26 | AXIS_LX=0;
27 | AXIS_LY=1;
28 | AXIS_RX=2;
29 | AXIS_RY=3;
30 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
31 | }
32 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/XBox.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // XBox 360 controller mapping for Windows
5 | // XBox One uses same mappings
6 |
7 | public class XBox extends ControllerMapping {
8 | public XBox() {
9 | id="xbox";
10 | BUTTON_A = 0;
11 | BUTTON_B = 1;
12 | BUTTON_X = 2;
13 | BUTTON_Y = 3;
14 | BUTTON_LB = 4;
15 | BUTTON_RB = 5;
16 | BUTTON_BACK = 6;
17 | BUTTON_START = 7;
18 | BUTTON_LS = 8; //Left Stick pressed down
19 | BUTTON_RS = 9; //Right Stick pressed down
20 |
21 | BUTTON_DPAD_UP=10;
22 | BUTTON_DPAD_DOWN=11;
23 | BUTTON_DPAD_LEFT=12;
24 | BUTTON_DPAD_RIGHT=13;
25 |
26 | POV = 0;
27 |
28 | AXIS_LY = 0; //-1 is up | +1 is down
29 | AXIS_LX = 1; //-1 is left | +1 is right
30 | AXIS_RY = 2; //-1 is up | +1 is down
31 | AXIS_RX = 3; //-1 is left | +1 is right
32 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
33 | }
34 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/XBoxLinux.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // XBox 360 controller mapping for Windows
5 | // XBox One uses same mappings
6 |
7 | public class XBoxLinux extends ControllerMapping {
8 | public XBoxLinux() {
9 | id="xbox";
10 | BUTTON_A = 0;
11 | BUTTON_B = 1;
12 | BUTTON_X = 2;
13 | BUTTON_Y = 3;
14 | BUTTON_LB = 4;
15 | BUTTON_RB = 5;
16 | BUTTON_BACK = 6;
17 | BUTTON_START = 7;
18 | BUTTON_LS = 8; //Left Stick pressed down
19 | BUTTON_RS = 9; //Right Stick pressed down
20 |
21 | BUTTON_DPAD_UP=10;
22 | BUTTON_DPAD_DOWN=11;
23 | BUTTON_DPAD_LEFT=12;
24 | BUTTON_DPAD_RIGHT=13;
25 |
26 | POV = 0;
27 |
28 | AXIS_LY = 1; //-1 is up | +1 is down
29 | AXIS_LX = 0; //-1 is left | +1 is right
30 | AXIS_RY = 4; //-1 is up | +1 is down
31 | AXIS_RX = 3; //-1 is left | +1 is right
32 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
33 | }
34 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/XBoxLinuxAlt.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // XBox 360 controller mapping for Windows
5 | // XBox One uses same mappings
6 |
7 | public class XBoxLinuxAlt extends ControllerMapping {
8 | public XBoxLinuxAlt() {
9 | id="xbox";
10 | BUTTON_A = 0;
11 | BUTTON_B = 1;
12 | BUTTON_X = 2;
13 | BUTTON_Y = 3;
14 | BUTTON_LB = 4;
15 | BUTTON_RB = 5;
16 | BUTTON_BACK = 6;
17 | BUTTON_START = 7;
18 | BUTTON_LS = 8; //Left Stick pressed down
19 | BUTTON_RS = 9; //Right Stick pressed down
20 |
21 | BUTTON_DPAD_UP=10;
22 | BUTTON_DPAD_DOWN=11;
23 | BUTTON_DPAD_LEFT=12;
24 | BUTTON_DPAD_RIGHT=13;
25 |
26 | POV = 0;
27 |
28 | AXIS_LY = 1; //-1 is up | +1 is down
29 | AXIS_LX = 0; //-1 is left | +1 is right
30 | AXIS_RY = 3; //-1 is up | +1 is down
31 | AXIS_RX = 4; //-1 is left | +1 is right
32 | AXIS_TRIGGER = 4; //LT and RT are on the same Axis! LT > 0 | RT < 0
33 | }
34 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/controller/XBoxOSX.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.controller;
2 |
3 |
4 | // XBox 360 controller mapping for OSX
5 |
6 | public class XBoxOSX extends ControllerMapping {
7 | public XBoxOSX() {
8 | id="xbox_osx";
9 | BUTTON_A = 11;
10 | BUTTON_B = 12;
11 | BUTTON_X = 13;
12 | BUTTON_Y = 14;
13 | BUTTON_LB = 8;
14 | BUTTON_RB = 9;
15 | BUTTON_BACK = 5;
16 | BUTTON_START = 4;
17 | BUTTON_LS = 6; //Left Stick pressed down
18 | BUTTON_RS = 7; //Right Stick pressed down
19 |
20 | BUTTON_DPAD_UP=0;
21 | BUTTON_DPAD_DOWN=1;
22 | BUTTON_DPAD_LEFT=2;
23 | BUTTON_DPAD_RIGHT=3;
24 |
25 | POV = 0;
26 |
27 | AXIS_LY = 3; //-1 is up | +1 is down
28 | AXIS_LX = 2; //-1 is left | +1 is right
29 | AXIS_RX = 4; //-1 is left | +1 is right
30 | AXIS_RY = 5; //-1 is up | +1 is down
31 | AXIS_TRIGGER = 4;
32 | }
33 | }
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Audio.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.audio.Music;
5 | import com.badlogic.gdx.audio.Sound;
6 |
7 | public class Audio {
8 |
9 | public static boolean useMusic;
10 | public static boolean useSFX;
11 | public static int SoundVolume;
12 | public static int MusicVolume;
13 |
14 | public static Music myGameMusic;
15 |
16 | // sound effects
17 | public static Sound FX_SPLASH;
18 |
19 |
20 |
21 | public final static void initSounds() {
22 | String root="audio/";
23 |
24 | FX_SPLASH=Gdx.audio.newSound(Gdx.files.internal(root + "fxsplash.mp3"));
25 | }
26 |
27 |
28 |
29 | // play specified sound
30 | public final static long playSound(Sound sound) {
31 | long soundID=-1;
32 | if (useSFX) {
33 | soundID=sound.play(SoundVolume / 10.0f);
34 | }
35 | return soundID;
36 | }
37 |
38 |
39 | // play specified sound , randomly changes pitch slightly, to vary often used sound effects
40 | public final static long playSoundPitched(Sound sound) {
41 | long soundID=-1;
42 |
43 | if (useSFX) {
44 | soundID=sound.play(SoundVolume / 10.0f);
45 | sound.setPitch(soundID, (88+Globals.getRandom(16))/100.0f);
46 | }
47 |
48 | return soundID;
49 | }
50 |
51 |
52 | // stops sound (sound effect auto stop
53 | public final static void stopAllSounds() {
54 | if (myGameMusic != null) myGameMusic.stop();
55 | }
56 |
57 | public final static void playBackgroundMusic() {
58 | if (useMusic && myGameMusic != null) {
59 | myGameMusic.play();
60 | myGameMusic.setVolume(MusicVolume / 10.0f);
61 | }
62 | }
63 |
64 |
65 | public final static void stopBackgroundMusic() {
66 | if (useMusic) {
67 | if (myGameMusic != null && myGameMusic.isPlaying())
68 | myGameMusic.pause();
69 | }
70 | }
71 |
72 | }
73 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Bullets.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.orangepixel.utils.FLight;
4 |
5 | public class Bullets extends Entity{
6 |
7 |
8 | public final static int bDEFAULTBULLET = 0,
9 | bEXPLOSION = 1;
10 |
11 |
12 | // bullet-owner types
13 | public final static int bOWNER_ANYONE = 0,
14 | bOWNER_PLAYER = 1,
15 | bOWNER_MONSTER = 2;
16 |
17 |
18 | static Bullets[] bulletList=new Bullets[320];
19 |
20 |
21 | // position
22 | int floatX;
23 | int floatY;
24 | int xSpeed;
25 | int ySpeed;
26 | int myDirection;
27 | int startX;
28 | int startY;
29 | int targetX;
30 | int targetY;
31 | boolean onGround;
32 |
33 | // appearance
34 | int xOffsetAdd;
35 | int animationDelay;
36 | int actionDelay;
37 | boolean visible;
38 |
39 | // states
40 | int myOwner;
41 | int energy;
42 | int duration;
43 | int subType;
44 | int myType;
45 | int aiState;
46 | int aiCountdown;
47 | int renderPass;
48 |
49 | boolean died;
50 | boolean deleted;
51 |
52 |
53 |
54 | public final static void initBullets() {
55 | for (int i=bulletList.length - 1; i >= 0; i--) bulletList[i]=new Bullets();
56 | killAll();
57 | }
58 |
59 |
60 | public final static void killAll() {
61 | for (int i=bulletList.length - 1; i >= 0; i--) bulletList[i].deleted=true;
62 | }
63 |
64 |
65 |
66 |
67 | public final static int addBullets(int mType, int myX, int myY, int mSubType, int mDirection, int mOwner, World myWorld) {
68 | int i=0;
69 | while (i>1);
158 | y-=(h>>1);
159 | energy=3;
160 | visible=false;
161 | aiCountdown=3;
162 | break;
163 |
164 | }
165 |
166 | floatX=x<<4;
167 | floatY=y<<4;
168 | }
169 |
170 |
171 | public final void update(World myWorld, Player myPlayer) {
172 | boolean hitPlayer=false;
173 | if (myPlayer.x+8>=x && myPlayer.x+1=y && myPlayer.y+1>4;
181 | y=floatY>>4;
182 |
183 | if (duration>0) duration--;
184 | else died=true;
185 |
186 | if (myWorld.isSolid(x>>4, y>>4)) {
187 | for (int i=4; --i>=0;) {
188 | FX.addFX(FX.fDEBRI, x+Globals.getRandom(3), y, 0, myWorld);
189 | }
190 | died=true;
191 | }
192 | FLight.addLight(x+3-myWorld.worldOffsetX, y+1-myWorld.worldOffsetY, 48, FLight.LightType_Sphere, 255,155,12,128);
193 |
194 | if (myOwner==bOWNER_MONSTER || myOwner==bOWNER_ANYONE) {
195 | if (hitPlayer) myPlayer.hit();
196 | }
197 | break;
198 |
199 | case bEXPLOSION:
200 |
201 | if (myOwner==bOWNER_MONSTER && hitPlayer) {
202 | myPlayer.hit();
203 | if (myPlayer.x+5>1)) myPlayer.throwBack(Globals.LEFT);
204 | else myPlayer.throwBack(Globals.RIGHT);
205 | }
206 |
207 | if (aiCountdown>0) aiCountdown--;
208 | else died=true;
209 | break;
210 | }
211 |
212 | }
213 |
214 |
215 |
216 |
217 | public final boolean collidesWith(Monsters myMonster) {
218 | boolean collide=false;
219 |
220 | if (myOwner!=bOWNER_ANYONE && myOwner==bOWNER_MONSTER) return false;
221 | int cw=x+w;
222 | int ch=y+h;
223 |
224 | if ((myMonster.x<=cw) && (myMonster.x+myMonster.w>=x) && (myMonster.y<=ch) && (myMonster.y+myMonster.h>=y)) collide=true;
225 |
226 | return collide;
227 | }
228 |
229 | }
230 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Entity.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | public class Entity {
4 |
5 | int x;
6 | int y;
7 | int xOffset;
8 | int yOffset;
9 | int w;
10 | int h;
11 | int rotation;
12 | int alpha;
13 | }
14 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/FX.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.orangepixel.utils.FLight;
4 |
5 | public class FX extends Entity {
6 |
7 |
8 | public final static int fSPEECH = 0,
9 | fLANDPLUME = 1,
10 | fBULLETPUFF = 2,
11 | fCOREELECTRO = 3,
12 | fDEBRI = 4,
13 | fSCOREPLUME = 5,
14 | fEXPLOSION = 6;
15 |
16 |
17 |
18 | // we got crazy on FX in this one, so large enough array needed ;)
19 | static FX[] fxList=new FX[1024];
20 |
21 |
22 | // position
23 | int floatX;
24 | int floatY;
25 | int xSpeed;
26 | int ySpeed;
27 | int myDirection;
28 | int startX;
29 | int startY;
30 | int targetX;
31 | int targetY;
32 | boolean onGround;
33 |
34 |
35 |
36 |
37 | // appearance
38 | int xOffsetAdd;
39 | int animationDelay;
40 | int actionDelay;
41 | boolean visible;
42 |
43 | // states
44 | int subType;
45 | int myType;
46 | int aiState;
47 | int aiCountdown;
48 | int renderPass;
49 |
50 | boolean died;
51 | boolean deleted;
52 |
53 |
54 |
55 | public final static void initFX() {
56 | for (int i=fxList.length - 1; i >= 0; i--) fxList[i]=new FX();
57 | killAll();
58 | }
59 |
60 | public final static void killAll() {
61 | for (int i=fxList.length - 1; i >= 0; i--) fxList[i].deleted=true;
62 | }
63 |
64 |
65 |
66 |
67 | public final static int addFX(int mType, int myX, int myY, int mSubType, World myWorld) {
68 | int i=0;
69 | while (i>4;
184 | if (aiCountdown>0) aiCountdown--;
185 | else died=true;
186 | break;
187 |
188 | case fLANDPLUME:
189 | if (animationDelay>0) animationDelay--;
190 | else {
191 | animationDelay=4;
192 | xOffset+=22;
193 | if (xOffset>66) died=true;
194 | }
195 | break;
196 |
197 | case fBULLETPUFF:
198 | if (animationDelay>0) animationDelay--;
199 | else {
200 | animationDelay=2;
201 | xOffset+=4;
202 | if (xOffset>19) died=true;
203 | }
204 | break;
205 |
206 | case fCOREELECTRO:
207 | if (animationDelay>0) animationDelay--;
208 | else died=true;
209 | break;
210 |
211 | case fDEBRI:
212 | floatX+=xSpeed;
213 | x=floatX>>4;
214 |
215 | if (myWorld.isSolid(x>>4, y>>4)) {
216 | if (xSpeed<0) {
217 | x=((x>>4)<<4)+16;
218 | floatX=x<<4;
219 | xSpeed=-xSpeed>>1;
220 | } else {
221 | x=((x>>4)<<4)-w;
222 | floatX=x<<4;
223 | xSpeed=-xSpeed>>1;
224 | }
225 |
226 | }
227 |
228 | floatY+=ySpeed;
229 | y=floatY>>4;
230 | if (ySpeed<64) ySpeed+=6;
231 |
232 | tx=(x>>4);
233 | if (ySpeed<0) {
234 | ty=(y>>4);
235 | if (myWorld.isSolid(tx,ty)) {
236 | y=(ty<<4)+16;
237 | floatY=y<<4;
238 | ySpeed=0;
239 | }
240 | } else {
241 | ty=(y+h+4)>>4;
242 | if (myWorld.isSolid(tx,ty)) {
243 | y=(ty<<4)-h-3;
244 | floatY=y<<4;
245 | ySpeed=-(ySpeed>>1);
246 | if (ySpeed>=-2) ySpeed=0;
247 | xSpeed=xSpeed>>1;
248 | if (xSpeed>-2 && xSpeed<2) xSpeed=0;
249 | }
250 | }
251 | break;
252 |
253 | case fSCOREPLUME:
254 | floatY+=ySpeed;
255 | y=floatY>>4;
256 | ySpeed+=4;
257 | if (ySpeed>=0) ySpeed=0;
258 |
259 | if (aiCountdown>0) aiCountdown--;
260 | else died=true;
261 |
262 | alpha-=2;
263 | if (alpha<=0) {
264 | alpha=0;
265 | died=true;
266 | }
267 | break;
268 |
269 | case fEXPLOSION:
270 | if (aiCountdown>0) aiCountdown--;
271 |
272 | if (animationDelay>0) animationDelay--;
273 | else {
274 | animationDelay=2;
275 | xOffset+=16;
276 | if (xOffset>144) died=true;
277 | }
278 | FLight.addLight(x+8-myWorld.worldOffsetX, y+8-myWorld.worldOffsetY, 64, FLight.LightType_Sphere, 255,128,0,160+aiCountdown);
279 | break;
280 |
281 | }
282 |
283 | }
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 | }
292 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Globals.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import java.util.Calendar;
4 | import java.util.Random;
5 |
6 | import com.badlogic.gdx.Gdx;
7 |
8 | public class Globals {
9 |
10 | public final static boolean debugMe=true;
11 |
12 | public final static int UP = 0,
13 | RIGHT = 1,
14 | LEFT = 2,
15 | DOWN = 3;
16 |
17 | // WEAPONS
18 | public final static int WEAPON_GUN = 0;
19 |
20 | // spriteXOffset, spriteYOffset, spriteWidth, spriteHeight
21 | public final static int[][] weaponValues = new int[][] {
22 | {0,20, 14,6},
23 | };
24 |
25 |
26 | // CHATTER QUOTES
27 | public final static String[] dudeQuotes = new String[] {
28 | "let's bring the pain!",
29 | "let's bust a planet...",
30 | "here comes the storm",
31 | "wooooohi!",
32 | "toooo easy!",
33 | "this and all that!"
34 | };
35 |
36 |
37 |
38 | // GALAXY names
39 | public final static String[] galaxyNamePre = new String[] {
40 | "omega",
41 | "armada",
42 | "lucious",
43 | "link",
44 | "toto",
45 | "altera",
46 | "altoro",
47 | "applepie",
48 | "methodi",
49 | "sitrus",
50 | "sinus",
51 | "armada",
52 | "lasius",
53 | "torius",
54 | "milky",
55 | "chocola",
56 | "sour",
57 | "bread",
58 | "left"
59 | };
60 |
61 | public final static String[] galaxyNamePost = new String[] {
62 | "galaxy",
63 | "space",
64 | "region",
65 | "nebula",
66 | "sphere",
67 | "stars",
68 | "system",
69 | "u2",
70 | "populus",
71 | "cube",
72 | "planetoids",
73 | "expanse",
74 | "area"
75 | };
76 |
77 |
78 |
79 |
80 | public final static void debug(String whatsUp) {
81 | if (!debugMe) return;
82 | Gdx.app.log("orangepixelsays",whatsUp);
83 | }
84 |
85 |
86 |
87 |
88 |
89 | // Random and seeding related code
90 | // seed values
91 | public static Random randomGenerator = new Random();
92 | static int randx=2016; // 123456789;
93 | static int randy=01; // 362436069;
94 | static int randz=18; // 521288629;
95 | static int randw=1; // 88675123;
96 |
97 | static int[] randomTable=new int[60000];
98 | static int randomNextInt;
99 |
100 | // set this true to always have same level (daily challenge for example)
101 | static boolean getRandomSeeded=false;
102 |
103 | public static void fillRandomTable() {
104 | int t;
105 |
106 | Calendar cal=Calendar.getInstance();
107 |
108 | randx=(cal.get(Calendar.YEAR) * 3);
109 | randy=(1 + (cal.get(Calendar.MONTH) * 7));
110 | randz=(1 + (cal.get(Calendar.DAY_OF_MONTH)));
111 |
112 | for (int i=0; i < 60000; i++) {
113 | t=randx ^ (randx << 11);
114 | randx=randy;
115 | randy=randz;
116 | randz=randw;
117 | randw=randw ^ (randw >> 19) ^ (t ^ (t >> 8));
118 | randomTable[i]=randw;
119 | }
120 |
121 | randomNextInt=0;
122 | }
123 |
124 | public static int getRandomSeeded(int digit1) {
125 | int value=randomTable[randomNextInt] % digit1;
126 | randomNextInt++;
127 | if (randomNextInt == 60000) randomNextInt=0;
128 | return value;
129 | }
130 |
131 | public static int getRandom(int digit1) {
132 | if (getRandomSeeded) return getRandomSeeded(digit1);
133 | else return randomGenerator.nextInt(digit1);
134 | }
135 |
136 | }
137 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Levelroom.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | public class Levelroom {
4 |
5 | int x;
6 | int y;
7 | int width;
8 | int height;
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Mission.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | public class Mission {
4 |
5 | public final static Mission[] missionList = new Mission[16];
6 |
7 |
8 | private final static String[] planetFirstname = new String[] {
9 | "planet",
10 | "totopolis",
11 | "uruga",
12 | "epsylon",
13 | "garth",
14 | "galaci",
15 | "gdx",
16 | "robovm",
17 | "robotality",
18 | "pixelius",
19 | "orange",
20 | "red",
21 | "blue",
22 | "black",
23 | "tauri"
24 | };
25 |
26 | private final static String[] planetLastname = new String[] {
27 | "turi",
28 | "xl-1",
29 | "sirius",
30 | "tempora",
31 | "xyilk",
32 | "pixel",
33 | "pixie",
34 | "lib",
35 | "gdx",
36 | "mark 2",
37 | "melok",
38 | "ceti"
39 | };
40 |
41 |
42 |
43 |
44 | String missionName;
45 |
46 | int Spriteset;
47 | int difficulty; // 1=easy --> hard
48 | int cost;
49 |
50 | boolean completed;
51 | boolean hasRadiation;
52 |
53 |
54 |
55 | public final static void set(int id, int mSet, int mDifficulty, boolean mCompleted, int mCost) {
56 | missionList[id]=new Mission();
57 | missionList[id].setName();
58 | missionList[id].Spriteset=mSet;
59 | missionList[id].difficulty=mDifficulty;
60 | missionList[id].completed=mCompleted;
61 | missionList[id].cost=mCost;
62 | missionList[id].hasRadiation=false;
63 |
64 | // radiation?
65 | if (Globals.getRandom(100)>90 && missionList[id].difficulty>3) missionList[id].hasRadiation=true;
66 |
67 | }
68 |
69 | public final static void setCompleted(int id) {
70 | missionList[id].completed=true;
71 | }
72 |
73 | public final static boolean getCompleted(int id) {
74 | return missionList[id].completed;
75 | }
76 |
77 | public final static boolean hasRadiation(int id) {
78 | return missionList[id].hasRadiation;
79 | }
80 |
81 | public final static String getName(int id) {
82 | return missionList[id].missionName;
83 | }
84 |
85 | public final static int getSpriteset(int id) {
86 | return missionList[id].Spriteset;
87 | }
88 |
89 | public final static int getDifficulty(int id) {
90 | return missionList[id].difficulty;
91 | }
92 |
93 | public final static int getCost(int id) {
94 | return missionList[id].cost;
95 | }
96 |
97 |
98 | // create a random planet name
99 | public final void setName() {
100 | missionName=planetFirstname[Globals.getRandom(planetFirstname.length)]+" "+planetLastname[Globals.getRandom(planetLastname.length)];
101 | }
102 |
103 | }
104 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Monsters.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.orangepixel.utils.FLight;
4 |
5 | public class Monsters extends Entity {
6 |
7 |
8 | public final static int mSHIP = 0,
9 | mSCENERY = 1,
10 | mSOLIDSCENERY = 2,
11 | mWORM = 3,
12 | mCREDIT = 4,
13 | mPLANETCORE = 5,
14 | mROBOEYE = 6,
15 | mHEALTH = 7,
16 | mBOUNCEXPLODE = 8;
17 |
18 |
19 |
20 | static Monsters[] monsterList=new Monsters[320];
21 |
22 |
23 | // position
24 | int floatX;
25 | int floatY;
26 | int xSpeed;
27 | int ySpeed;
28 | int ySpeedIncrease;
29 | int myDirection;
30 | int startX;
31 | int startY;
32 | int targetX;
33 | int targetY;
34 | boolean onGround;
35 |
36 |
37 | // appearance
38 | int xOffsetAdd;
39 | int animationDelay;
40 | int actionDelay;
41 | boolean visible;
42 |
43 | // states
44 | boolean activated;
45 | int energy;
46 | int subType;
47 | int myType;
48 | int aiState;
49 | int aiCountdown;
50 | int renderPass;
51 | int fireDelay;
52 |
53 | boolean died;
54 | boolean deleted;
55 |
56 |
57 |
58 | public final static void initMonsters() {
59 | for (int i=monsterList.length - 1; i >= 0; i--) monsterList[i]=new Monsters();
60 | killAll();
61 | }
62 |
63 |
64 | public final static void killAll() {
65 | for (int i=monsterList.length - 1; i >= 0; i--) monsterList[i].deleted=true;
66 | }
67 |
68 |
69 |
70 | public final static int addMonster(int mType, int myX, int myY, int mSubType, World myWorld) {
71 | int i=0;
72 | while (i50) myDirection=Globals.RIGHT;
169 | else myDirection=Globals.LEFT;
170 |
171 | energy=4+(1*myWorld.difficulty);
172 | break;
173 |
174 |
175 | case mCREDIT:
176 | w=7;
177 | h=7;
178 | xOffset=17;
179 | yOffset=68;
180 | ySpeed=-24;
181 | aiState=0;
182 | break;
183 |
184 | case mPLANETCORE:
185 | w=16;
186 | h=15;
187 | xOffset=24;
188 | yOffset=68;
189 | aiState=0;
190 | y-=6;
191 | break;
192 |
193 | case mROBOEYE:
194 | w=10;
195 | h=10;
196 | y+=3;
197 | xOffset=32+(Globals.getRandom(2)*10);
198 | yOffset=21;
199 |
200 | if (Globals.getRandom(100)>50) myDirection=Globals.RIGHT;
201 | else myDirection=Globals.LEFT;
202 |
203 | energy=2+(3*myWorld.difficulty);
204 | break;
205 |
206 |
207 | case mHEALTH:
208 | w=5;
209 | h=7;
210 | y+=7;
211 |
212 | xOffset=40;
213 | yOffset=68;
214 | ySpeed=-8;
215 | ySpeedIncrease=-4;
216 | break;
217 |
218 | case mBOUNCEXPLODE:
219 | w=10;
220 | h=10;
221 | y-=7;
222 | xOffset=62;
223 | yOffset=21;
224 | ySpeed=-8;
225 |
226 | energy=2+(myWorld.difficulty);
227 | aiState=0;
228 | break;
229 | }
230 |
231 | floatX=x<<4;
232 | floatY=y<<4;
233 | }
234 |
235 |
236 |
237 |
238 | public final void update(World myWorld, Player myPlayer) {
239 | int tx;
240 | int ty;
241 | boolean onScreen;
242 |
243 | if (x+w>myWorld.worldOffsetX-16 && xmyWorld.worldOffsetY-16 && y=x && myPlayer.x+1=y && myPlayer.y+1>2;
273 | ySpeed=(targetY-floatY)>>2;
274 |
275 | if (xSpeed>48) xSpeed=48;
276 | if (ySpeed>48) ySpeed=48;
277 |
278 | floatX+=xSpeed;
279 | floatY+=ySpeed;
280 |
281 | x=floatX>>4;
282 | y=floatY>>4;
283 |
284 | myWorld.setCameraTakeOver(x, y, 16);
285 |
286 | if (floatX>=targetX-3 && floatY>=targetY-3) {
287 | aiState=2;
288 | myPlayer.BustAPLanet(x,y);
289 | }
290 |
291 | break;
292 |
293 | case 2:
294 | // hover - idle
295 | break;
296 | }
297 |
298 | FLight.addLight(x-1-myWorld.worldOffsetX, y+7-myWorld.worldOffsetY, 8, FLight.LightType_SphereTense, 255,207,17,255);
299 | FLight.addLight(x-1-myWorld.worldOffsetX, y+7-myWorld.worldOffsetY, 64, FLight.LightType_Sphere, 255,174,17,255);
300 | break;
301 |
302 | case mSOLIDSCENERY:
303 | myWorld.put(x>>4, y>>4, World.tMONSTER);
304 | break;
305 |
306 | case mWORM:
307 | switch (aiState) {
308 | case 0:
309 | if (aiCountdown<=8) xOffset=13;
310 | if (aiCountdown>0) aiCountdown--;
311 | else {
312 | aiState=1;
313 | if (myDirection==Globals.RIGHT) xSpeed=32;
314 | else xSpeed=-32;
315 | xOffset=0;
316 | }
317 | break;
318 |
319 | case 1:
320 | doHorizontal(myWorld);
321 |
322 | xSpeed=xSpeed>>1;
323 | if (xSpeed>-2 && xSpeed<2) {
324 | xSpeed=0;
325 | aiState=0;
326 | aiCountdown=16;
327 | }
328 |
329 |
330 | ty=(y>>4);
331 | if (xSpeed<0) {
332 | tx=(x>>4);
333 | if (myWorld.isSolid(tx, ty)) {
334 | x=(tx<<4)+16;
335 | floatX=x<<4;
336 | xSpeed=0;
337 | aiState=0;
338 | aiCountdown=16;
339 | myDirection=Globals.RIGHT;
340 | }
341 | } else {
342 | tx=(x+w)>>4;
343 | if (myWorld.isSolid(tx, ty)) {
344 | x=(tx<<4)-w;
345 | floatX=x<<4;
346 | xSpeed=0;
347 |
348 | aiState=0;
349 | aiCountdown=16;
350 | myDirection=Globals.LEFT;
351 | }
352 | }
353 |
354 | if (hitPlayer) myPlayer.hit();
355 | break;
356 |
357 | }
358 | break;
359 |
360 | case mCREDIT:
361 | switch (aiState) {
362 | case 0:
363 | floatY+=ySpeed;
364 | y=floatY>>4;
365 |
366 | if (ySpeed<64) ySpeed+=8;
367 | ty=(y+h+4)>>4;
368 | if (myWorld.isSolid(x>>4, ty)) {
369 | y=(ty<<4)-(h+4);
370 | floatY=y<<4;
371 | ySpeed=0;
372 | aiState=1;
373 | aiCountdown=200;
374 | }
375 | break;
376 |
377 | case 1:
378 | if (aiCountdown>0) aiCountdown--;
379 | else {
380 | died=true;
381 | }
382 |
383 | visible=(aiCountdown>16 || aiCountdown%4<2);
384 |
385 | if (hitPlayer) {
386 | myPlayer.addCredits(5);
387 | FX.addFX(FX.fSCOREPLUME, x,y, 5, myWorld);
388 | died=true;
389 | }
390 | break;
391 | }
392 |
393 | FLight.addLight(x+3-myWorld.worldOffsetX, y+3-myWorld.worldOffsetY, 64, FLight.LightType_Sphere, 255,206,12,128);
394 | break;
395 |
396 | case mPLANETCORE:
397 | FLight.addLight(x+8-myWorld.worldOffsetX, y+7-myWorld.worldOffsetY, 24, FLight.LightType_SphereTense, 100,205,244,200);
398 | FLight.addLight(x+8-myWorld.worldOffsetX, y+7-myWorld.worldOffsetY, 80, FLight.LightType_Sphere, 100,205,244,128);
399 | FX.addFX(FX.fCOREELECTRO, x+3, y-4, 0, myWorld);
400 |
401 | if (hitPlayer && myPlayer.xSpeed==0 && myPlayer.onGround) myWorld.levelCompleted=true;
402 | break;
403 |
404 | case mROBOEYE:
405 | if (aiState==0 || aiState==2) {
406 | // idle animation
407 | if (animationDelay>0) animationDelay--;
408 | else {
409 | animationDelay=8;
410 | if (xOffset==32) xOffset=42;
411 | else xOffset=32;
412 | }
413 | }
414 |
415 |
416 |
417 | switch (aiState) {
418 | case 0:
419 | if (playerInOurSight(myPlayer)) {
420 | activated=true;
421 |
422 | targetX=x;
423 | if (xmyPlayer.x+24) targetX=myPlayer.x+24;
425 |
426 | if (targetX>x) {
427 | xSpeed=16;
428 | myDirection=Globals.RIGHT;
429 | } else if (targetX0) aiCountdown--;
437 | else {
438 | if (myDirection==Globals.LEFT) myDirection=Globals.RIGHT;
439 | else myDirection=Globals.LEFT;
440 | aiCountdown=80;
441 | }
442 | break;
443 |
444 |
445 | case 1:
446 | doHorizontal(myWorld);
447 |
448 |
449 | if (xSpeed==0 || (x>targetX-4 && x0) animationDelay--;
456 | else {
457 | animationDelay=8;
458 | if (xOffset==42) xOffset=52;
459 | else xOffset=42;
460 | }
461 |
462 | if (fireDelay>0) fireDelay--;
463 | else {
464 | fireDelay=8;
465 | Bullets.addBullets(Bullets.bDEFAULTBULLET, x, y+4, 0, myDirection, Bullets.bOWNER_MONSTER, myWorld);
466 | }
467 |
468 |
469 | if (hitPlayer) myPlayer.hit();
470 | break;
471 |
472 | }
473 |
474 | if (myDirection==Globals.RIGHT) {
475 | yOffset=21;
476 | FLight.addLight(x+8-myWorld.worldOffsetX, y+3-myWorld.worldOffsetY, 16, FLight.LightType_Sphere, 255,0,0,128);
477 | } else {
478 | yOffset=31;
479 | FLight.addLight(x+1-myWorld.worldOffsetX, y+3-myWorld.worldOffsetY, 16, FLight.LightType_Sphere, 255,0,0,128);
480 | }
481 | break;
482 |
483 |
484 |
485 | case mHEALTH:
486 | floatY+=ySpeed;
487 | y=floatY>>4;
488 | ySpeed+=ySpeedIncrease;
489 | if (ySpeed<=-24 && ySpeedIncrease<0) {
490 | ySpeedIncrease=-ySpeedIncrease;
491 | } else if (ySpeed>=24 && ySpeedIncrease>0) {
492 | ySpeedIncrease=-ySpeedIncrease;
493 | }
494 |
495 | if (hitPlayer) {
496 | myPlayer.addHealth(1);
497 | died=true;
498 | }
499 |
500 | FLight.addLight(x+3-myWorld.worldOffsetX, y+4-myWorld.worldOffsetY, 16, FLight.LightType_SphereTense, 255,0,16,255);
501 | FLight.addLight(x+3-myWorld.worldOffsetX, y+4-myWorld.worldOffsetY, 48, FLight.LightType_Sphere, 255,0,16,128);
502 | break;
503 |
504 | case mBOUNCEXPLODE:
505 | doVertical(myWorld);
506 |
507 | if (ySpeed<48) ySpeed+=4;
508 |
509 | if (onGround) {
510 | ySpeed=-32;
511 | onGround=false;
512 | }
513 |
514 | if (aiState==1) {
515 | doHorizontal(myWorld);
516 | if (aiCountdown>0) aiCountdown--;
517 | if (aiCountdown==0 || hitPlayer) {
518 | aiState=2;
519 | }
520 | } else if (aiState==2) {
521 | died=true;
522 | FX.addFX(FX.fEXPLOSION, x, y, 0, myWorld);
523 | Bullets.addBullets(Bullets.bEXPLOSION, x+5, y+5, 32, 0, Bullets.bOWNER_MONSTER, myWorld);
524 | }
525 | break;
526 |
527 | }
528 |
529 | }
530 |
531 |
532 |
533 | public final void doHorizontal(World myWorld) {
534 | int tx;
535 | int ty;
536 |
537 | floatX+=xSpeed;
538 | x=floatX>>4;
539 |
540 | ty=(y+(h>>1))>>4;
541 |
542 | if (xSpeed>0) {
543 | tx=(x+w)>>4;
544 | if (myWorld.isSolid(tx, ty)) {
545 | x=(tx<<4)-w;
546 | floatX=x<<4;
547 | xSpeed=0;
548 | }
549 | } else {
550 | tx=x>>4;
551 | if (myWorld.isSolid(tx, ty)) {
552 | x=(tx<<4)+16;
553 | floatX=x<<4;
554 | xSpeed=0;
555 | }
556 | }
557 |
558 |
559 | }
560 |
561 |
562 | public final void doVertical(World myWorld) {
563 | int tx;
564 | int ty;
565 |
566 | floatY+=ySpeed;
567 | y=floatY>>4;
568 |
569 | tx=(x+(w>>1))>>4;
570 |
571 | if (ySpeed>0) {
572 | ty=(y+h+3)>>4;
573 | if (myWorld.isSolid(tx, ty)) {
574 | onGround=true;
575 | y=(ty<<4)-(h+3);
576 | floatY=y<<4;
577 | ySpeed=0;
578 | }
579 | } else {
580 | onGround=false;
581 | ty=y>>4;
582 | if (myWorld.isSolid(tx, ty)) {
583 | y=(ty<<4)+16;
584 | floatY=y<<4;
585 | ySpeed=0;
586 | }
587 | }
588 |
589 |
590 | }
591 |
592 |
593 |
594 | public final boolean playerInOurRoom(Player myPlayer) {
595 | if (myPlayer.y+10>y-20 && myPlayer.yy-20 && myPlayer.yx && myDirection==Globals.RIGHT) return true;
602 | if (myPlayer.x+5>4, y>>4, World.tEMPTY);
620 |
621 | // myPlayer.addScore(10);
622 |
623 | if (Globals.getRandom(100)>80) addMonster(mCREDIT, x, y, 0, myWorld);
624 |
625 | FX.addFX(FX.fEXPLOSION, x, y, 0, myWorld);
626 |
627 | for (int i=6; --i>=0;) {
628 | FX.addFX(FX.fDEBRI, x+Globals.getRandom(3), y, 0, myWorld);
629 | }
630 | }
631 | result=true;
632 | break;
633 |
634 | case mWORM:
635 | energy-=myBullet.energy;
636 | xSpeed=myBullet.myDirection<<4;
637 | if (energy<=0) {
638 | died=true;
639 |
640 | // myPlayer.addScore(10);
641 | // FX.addFX(FX.fSCOREPLUME, x,y, 5, myWorld);
642 |
643 | addMonster(mCREDIT, x, y, 0, myWorld);
644 |
645 |
646 | for (int i=4; --i>=0;) {
647 | FX.addFX(FX.fDEBRI, x+Globals.getRandom(3), y, 0, myWorld);
648 | }
649 | }
650 | result=true;
651 | break;
652 |
653 |
654 | case mROBOEYE:
655 | energy-=myBullet.energy;
656 |
657 | // shortcircuit our shooting
658 | fireDelay=8;
659 |
660 | xSpeed=myBullet.myDirection<<4;
661 | if (energy<=0) {
662 | died=true;
663 |
664 | // myPlayer.addScore(10);
665 | // FX.addFX(FX.fSCOREPLUME, x,y, 5, myWorld);
666 |
667 | addMonster(mCREDIT, x, y, 0, myWorld);
668 |
669 | FX.addFX(FX.fEXPLOSION, x, y, 0, myWorld);
670 |
671 | for (int i=4; --i>=0;) {
672 | FX.addFX(FX.fDEBRI, x+Globals.getRandom(3), y, 0, myWorld);
673 | }
674 | }
675 | result=true;
676 | break;
677 |
678 |
679 |
680 |
681 | case mBOUNCEXPLODE:
682 |
683 | energy-=myBullet.energy;
684 | if (energy<=0) {
685 | if (aiState==1) aiState=2;
686 | else {
687 | if (myBullet.xSpeed>0) xSpeed=-24;
688 | else xSpeed=24;
689 |
690 | energy=24+(myWorld.difficulty*2);
691 |
692 | aiState=1;
693 | aiCountdown=64;
694 | }
695 | }
696 | result=true;
697 | break;
698 | }
699 |
700 |
701 | return result;
702 | }
703 |
704 |
705 |
706 | }
707 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/Player.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.orangepixel.utils.FLight;
4 |
5 | public class Player extends Entity {
6 |
7 | // position
8 | int floatX;
9 | int floatY;
10 | int xSpeed;
11 | int ySpeed;
12 | int myDirection;
13 | boolean onGround;
14 |
15 | // stats
16 | int health;
17 | int score;
18 | int creditsCollected;
19 | int healthDelay;
20 |
21 | // interaction
22 | boolean leftPressed;
23 | boolean rightPressed;
24 | boolean upPressed;
25 | boolean actionPressed;
26 | boolean downPressed;
27 |
28 | // appearance
29 | int xOffsetAdd;
30 | int animationDelay;
31 | int actionDelay;
32 | boolean visible;
33 |
34 | boolean firstLanding;
35 |
36 |
37 | public Player() {
38 |
39 | }
40 |
41 | public final void newGameInit() {
42 | creditsCollected=0;
43 | score=0;
44 | health=9;
45 | }
46 |
47 |
48 | public final void init(int startX, int startY) {
49 | x=startX;
50 | y=startY;
51 |
52 | myDirection=Globals.RIGHT;
53 |
54 | xOffset=0;
55 | yOffset=0;
56 | xOffsetAdd=10;
57 | w=10;
58 | h=10;
59 | xSpeed=0;
60 | ySpeed=0;
61 |
62 | actionDelay=0;
63 |
64 | // wait for the ship to give us the BustAPLanet() signal
65 | visible=false;
66 |
67 |
68 | floatX=x<<4;
69 | floatY=y<<4;
70 | healthDelay=0;
71 | }
72 |
73 |
74 |
75 |
76 | public final void resetInput() {
77 | leftPressed=false;
78 | rightPressed=false;
79 | upPressed=false;
80 | actionPressed=false;
81 | downPressed=false;
82 | }
83 |
84 |
85 |
86 | public void BustAPLanet(int startX, int startY) {
87 | x=startX;
88 | y=startY;
89 | floatX=x<<4;
90 | floatY=y<<4;
91 | ySpeed=-24;
92 | onGround=false;
93 | visible=true;
94 | firstLanding=true;
95 | }
96 |
97 | public void hit() {
98 | if (healthDelay>0) return;
99 |
100 | healthDelay=16;
101 | health--;
102 | if (health<=0) health=0;
103 | }
104 |
105 |
106 | public void addHealth( int value) {
107 | health+=value;
108 | if (health>9) health=9;
109 | healthDelay=16;
110 | }
111 |
112 | public void addScore(int value) {
113 | score+=value;
114 | }
115 |
116 | public void addCredits(int value) {
117 | creditsCollected+=value;
118 |
119 | if (Globals.getRandom(100)>80)
120 | FX.addFX(FX.fSPEECH, x+Globals.getRandom(32)-16, y, Globals.getRandom(Globals.dudeQuotes.length), null);
121 | }
122 |
123 |
124 | // throw back player (i.e.: after an explosion)
125 | public void throwBack(int mDirection) {
126 | ySpeed=-32;
127 |
128 | switch (mDirection) {
129 | case Globals.LEFT:
130 | xSpeed=-48;
131 | break;
132 |
133 | case Globals.RIGHT:
134 | xSpeed=48;
135 | break;
136 | }
137 | }
138 |
139 | public void update(World myWorld) {
140 | if (!visible) return;
141 | if (healthDelay>0) healthDelay--;
142 |
143 | int tx;
144 | int ty;
145 |
146 | if (actionDelay>0) actionDelay--;
147 |
148 |
149 |
150 |
151 | if (leftPressed) {
152 | if (xSpeed>-24) xSpeed-=4;
153 | else xSpeed=-24;
154 |
155 | myDirection=Globals.LEFT;
156 | } else if (rightPressed) {
157 | if (xSpeed<24) xSpeed+=4;
158 | else xSpeed=24;
159 |
160 | myDirection=Globals.RIGHT;
161 | } else {
162 |
163 | if (xSpeed<0) {
164 | xSpeed+=2;
165 | if (xSpeed>=0) xSpeed=0;
166 | } else if (xSpeed>0) {
167 | xSpeed-=2;
168 | if (xSpeed<=0) xSpeed=0;
169 | }
170 | }
171 |
172 | if (actionPressed && actionDelay==0) {
173 | actionDelay=8;
174 | myWorld.worldShake=8;
175 |
176 | Bullets.addBullets(Bullets.bDEFAULTBULLET, x+5,y+5, 0, myDirection, Bullets.bOWNER_PLAYER, myWorld);
177 |
178 | // 3way
179 | Bullets.addBullets(Bullets.bDEFAULTBULLET, x+5,y+5, -1, myDirection, Bullets.bOWNER_PLAYER, myWorld);
180 | Bullets.addBullets(Bullets.bDEFAULTBULLET, x+5,y+5, 1, myDirection, Bullets.bOWNER_PLAYER, myWorld);
181 |
182 | if (myDirection==Globals.RIGHT) FLight.addLight(x+11-myWorld.worldOffsetX, y+5-myWorld.worldOffsetY, 24, FLight.LightType_Sphere, 180,180,180,255);
183 | else FLight.addLight(x-12-myWorld.worldOffsetX, y+5-myWorld.worldOffsetY, 24, FLight.LightType_Sphere, 180,180,180,255);
184 |
185 | // kickback
186 | if (myDirection==Globals.RIGHT) xSpeed-=4;
187 | else if (myDirection==Globals.LEFT) xSpeed+=4;
188 | }
189 |
190 |
191 | floatX+=xSpeed;
192 | x=floatX>>4;
193 |
194 | if (x>4;
201 |
202 | if (xSpeed>0) {
203 | tx=(x+w)>>4;
204 | if (myWorld.isSolid(tx, ty)) {
205 | x=(tx<<4)-w;
206 | xSpeed=0;
207 | floatX=x<<4;
208 | }
209 | } else {
210 | tx=(x+4)>>4;
211 | if (myWorld.isSolid(tx, ty)) {
212 | x=(tx<<4)+12;
213 | floatX=x<<4;
214 | xSpeed=0;
215 | }
216 | }
217 |
218 |
219 | if (upPressed && onGround) {
220 | ySpeed=-48;
221 | onGround=false;
222 | }
223 |
224 | floatY+=ySpeed;
225 |
226 | if (ySpeed<64) ySpeed+=4;
227 | y=floatY>>4;
228 |
229 | tx=(x+5)>>4;
230 |
231 | if (ySpeed<0) {
232 | ty=(y+8)>>4;
233 | if (myWorld.isSolid(tx, ty)) {
234 | y=(ty<<4)+8;
235 | floatY=y<<4;
236 | ySpeed=0;
237 | onGround=false;
238 | }
239 | } else {
240 | ty=(y+h+4)>>4;
241 | if (myWorld.isSolid(tx, ty)) {
242 | if (myWorld.getTile(tx, ty)==World.tMONSTER) y=(ty<<4)-(h-1);
243 | else y=(ty<<4)-(h+4);
244 | floatY=y<<4;
245 | if (ySpeed>16) {
246 | FX.addFX(FX.fLANDPLUME, x-6, y+7, 0, myWorld);
247 | myWorld.worldShake=16;
248 | }
249 | ySpeed=0;
250 | onGround=true;
251 | if (firstLanding) {
252 | firstLanding=false;
253 | FX.addFX(FX.fSPEECH, x+32, y-4, Globals.getRandom(Globals.dudeQuotes.length), myWorld);
254 | }
255 | }
256 |
257 | }
258 |
259 |
260 |
261 |
262 | animate();
263 |
264 | FLight.addLight(x+5-myWorld.worldOffsetX, y+5-myWorld.worldOffsetY, 32, FLight.LightType_Sphere, 244,236,151,150);
265 | }
266 |
267 |
268 |
269 |
270 |
271 | public void animate() {
272 | if (myDirection==Globals.LEFT) yOffset=10;
273 | else if (myDirection==Globals.RIGHT) yOffset=0;
274 |
275 | if (xSpeed==0 && ySpeed==0) {
276 | // IDLE!
277 | if (animationDelay>0) animationDelay--;
278 | else {
279 | animationDelay=8;
280 | xOffset+=10;
281 | if (xOffset>20) xOffset=0;
282 | }
283 | } else if (ySpeed<-8) {
284 | xOffset=60;
285 | } else if (!onGround) {
286 | xOffset=70;
287 | } else {
288 | // RUN
289 | if (animationDelay>0) animationDelay--;
290 | else {
291 | animationDelay=4;
292 | xOffset+=xOffsetAdd;
293 | if (xOffset>=50) {
294 | xOffset=50;
295 | xOffsetAdd=-10;
296 | } else if (xOffset<=30) {
297 | xOffset=30;
298 | xOffsetAdd=10;
299 | }
300 | }
301 | }
302 |
303 | }
304 |
305 | }
306 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/PlayerProfile.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.badlogic.gdx.Gdx;
4 | import com.badlogic.gdx.Preferences;
5 |
6 |
7 | /**
8 | * Keeps track of a player profile and all the data that corresponds
9 | * to such a profile
10 | *
11 | * @author Pascal
12 | *
13 | */
14 |
15 |
16 | public class PlayerProfile {
17 |
18 | String fileName;
19 |
20 | // audio?
21 | boolean useMusic;
22 | boolean useSFX;
23 | boolean useFullscreen;
24 | int storedWindowedModeID;
25 | int musicVolume;
26 | int soundVolume;
27 |
28 |
29 | // input settings (touch,gamepad,keyboard)
30 | int[] stickX;
31 | int[] stickY;
32 | int[] keyboardSettings;
33 | int[] controller1;
34 | int[] controller2;
35 |
36 | // simple check for cheating
37 | boolean CRCcheckPassed;
38 |
39 |
40 |
41 |
42 |
43 | /**
44 | * Main constructor, initialise a blank profile
45 | */
46 | public PlayerProfile(String myFile) {
47 | fileName=myFile;
48 |
49 | stickX=new int[6];
50 | stickY=new int[6];
51 |
52 | keyboardSettings=new int[16];
53 |
54 |
55 | // signal a reset is needed
56 | stickX[0]=-999;
57 | stickY[0]=-999;
58 |
59 | controller1=new int[12];
60 | controller2=new int[12];
61 |
62 | musicVolume=4;
63 | soundVolume=7;
64 | }
65 |
66 |
67 |
68 | /**
69 | *
70 | * Load the settings for this profile
71 | *
72 | * @param mFileName Filename of the preferences file to use
73 | * @return Map object (basically all data that was saved to the specified profile file)
74 | */
75 | public final void loadSettings() {
76 | int myCRC=0;
77 |
78 | Preferences prefs = Gdx.app.getPreferences(fileName);
79 |
80 | // get profile preferences and settings
81 | useMusic=prefs.getBoolean("usemusic", true);
82 | useSFX=prefs.getBoolean("usesfx",true);
83 | useFullscreen=prefs.getBoolean("useFullscreen",false);
84 | storedWindowedModeID=prefs.getInteger("storedWindowedModeID",2); // 1080x720 by default -1);
85 |
86 | musicVolume=prefs.getInteger("musicvolume",3);
87 | soundVolume=prefs.getInteger("soundvolume",7);
88 |
89 |
90 |
91 | for (int i=12; --i>=0;) {
92 | controller1[i]=prefs.getInteger("controller1"+i,-999);
93 |
94 | if (controller1[i]!=-999) controller2[i]=prefs.getInteger("controller2"+i,controller1[i]);
95 | else controller2[i]=prefs.getInteger("controller2"+i,-999);
96 | }
97 | for (int i=6; --i>=0;) {
98 | stickX[i]=prefs.getInteger("stickx"+i,-999);
99 | stickY[i]=prefs.getInteger("sticky"+i,-999);
100 | }
101 |
102 | for (int i=16; --i>=0;) {
103 | keyboardSettings[i]=prefs.getInteger("keyboardSettings"+i,-1);
104 | }
105 |
106 |
107 | int CRCcheck=prefs.getInteger("LastMinuteEvent", -1);
108 |
109 | CRCcheckPassed=false;
110 | if (CRCcheck>-1) {
111 | if (CRCcheck==myCRC) CRCcheckPassed=true;
112 | else CRCcheckPassed=false;
113 | } else {
114 | CRCcheckPassed=true;
115 | }
116 |
117 | if (CRCcheckPassed) Gdx.app.log("opdebug","CRC valid");
118 | else Gdx.app.log("opdebug","CRC invalid");
119 | }
120 |
121 |
122 |
123 | /**
124 | * Save the settings for this profile
125 | */
126 | public final void saveSettings() {
127 | int myCRC=0;
128 |
129 | Preferences prefsEditor = Gdx.app.getPreferences(fileName);
130 |
131 | // save settings and preferences
132 | prefsEditor.putBoolean("usemusic", useMusic);
133 | prefsEditor.putBoolean("usesfx", useSFX);
134 | prefsEditor.putBoolean("useFullscreen",useFullscreen);
135 | prefsEditor.putInteger("storedWindowedModeID",storedWindowedModeID);
136 |
137 | prefsEditor.putInteger("musicvolume",musicVolume);
138 | prefsEditor.putInteger("soundvolume",soundVolume);
139 |
140 |
141 | for (int i=6; --i>=0;) {
142 | prefsEditor.putInteger("stickx"+i,stickX[i]);
143 | prefsEditor.putInteger("sticky"+i,stickY[i]);
144 | }
145 |
146 | for (int i=16; --i>=0;) {
147 | prefsEditor.putInteger("keyboardSettings"+i,keyboardSettings[i]);
148 | }
149 |
150 |
151 | for (int i=12; --i>=0;) {
152 | prefsEditor.putInteger("controller1"+i,controller1[i]);
153 | prefsEditor.putInteger("controller2"+i,controller2[i]);
154 | }
155 |
156 | prefsEditor.putInteger("LastMinuteEvent", myCRC);
157 |
158 | prefsEditor.flush();
159 |
160 | prefsEditor=null;
161 | }
162 |
163 |
164 |
165 |
166 |
167 | public final void resetControls(int displayW, int displayH) {
168 | int tx=48;
169 | int ty=displayH-48;
170 | tx-=24;
171 | ty-=24;
172 |
173 |
174 | // left
175 | stickX[0]=tx-12;
176 | stickY[0]=ty+12;
177 |
178 | // right
179 | stickX[1]=tx+36;
180 | stickY[1]=ty+12;
181 |
182 | // up
183 | stickX[2]=tx+12;
184 | stickY[2]=ty-12;
185 |
186 | // down
187 | stickX[3]=tx+12;
188 | stickY[3]=ty+36;
189 | }
190 |
191 |
192 |
193 |
194 |
195 |
196 | }
197 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/planetbusters/World.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import com.orangepixel.utils.FLight;
4 |
5 | public class World {
6 |
7 | public final static int tileMapW = 40;
8 | public final static int tileMapH = 40;
9 |
10 | public final static int tEMPTY = 0,
11 | tSOLID = 1,
12 | tMONSTER=2,
13 | tMARKER=3;
14 |
15 | int worldOffsetX;
16 | int worldOffsetY;
17 |
18 | int worldFloorY;
19 |
20 | int worldShake;
21 | int worldShakeOffsetX;
22 | int worldShakeOffsetY;
23 |
24 | int Spriteset;
25 |
26 | int lockScreen;
27 | boolean lockVertical;
28 | boolean CameraTakeOver; // if something else besides player takes focus
29 | boolean CameraIsView; // signal player we are back on camera-position checking
30 | int CameraTakeOverCountdown;
31 | int lockVerticalValue;
32 | int softLock;
33 | boolean autoScroll;
34 | int cameraTargetX;
35 | int cameraTargetY;
36 |
37 | int difficulty;
38 |
39 | boolean levelCompleted;
40 |
41 |
42 | int displayW;
43 | int displayH;
44 |
45 |
46 | int[] tileMap = new int[tileMapW*tileMapH];
47 | int[] renderMap = new int[tileMapW*tileMapH];
48 |
49 | int worldPre;
50 | int worldPost;
51 | int world; // galaxy, increases with every X missions completed
52 | int level;
53 |
54 |
55 | public final void initWorld() {
56 | for (int x=0; xtileMapW || myY>tileMapH) return true;
134 | if (tileMap[myX+(myY*tileMapW)]>=tSOLID) return true;
135 |
136 | return false;
137 | }
138 |
139 |
140 | public final void setCameraTakeOver(int myx,int myy,int duration) {
141 | CameraTakeOver=true;
142 | CameraTakeOverCountdown=duration;
143 | cameraTargetX=myx;
144 | cameraTargetY=myy;
145 | }
146 |
147 | public final void setCamera(int x, int y) {
148 | cameraTargetX=worldOffsetX=x;
149 | cameraTargetY=worldOffsetY=y;
150 | }
151 |
152 | public final void handleCamera(Player tmpPlayer) {
153 | int tx;
154 | int ty;
155 |
156 | if (CameraTakeOver) {
157 | int xSpeed=((cameraTargetX- (displayW>>1)) - worldOffsetX) >> 3;
158 | int ySpeed=((cameraTargetY- (displayH>>1)) - worldOffsetY) >> 3;
159 |
160 | worldOffsetX+=xSpeed;
161 | worldOffsetY+=ySpeed;
162 | } else {
163 |
164 | tx=tmpPlayer.x+8;
165 | ty=tmpPlayer.y+10;
166 |
167 | int xSpeed=((tx- (displayW>>1)) - worldOffsetX) >> 3;
168 | int ySpeed=((ty- (displayH>>1)) - worldOffsetY) >> 3;
169 |
170 | worldOffsetX+=xSpeed;
171 | worldOffsetY+=ySpeed;
172 | }
173 |
174 | // correct stuff
175 | if (worldOffsetX<0) worldOffsetX=0;
176 | if (worldOffsetX>(tileMapW*16)-displayW) worldOffsetX=(tileMapW*16)-displayW;
177 | // if (worldOffsetY<0) worldOffsetY=0;
178 | if (worldOffsetY>(tileMapH*16)-displayH) worldOffsetY=(tileMapH*16)-displayH;
179 | }
180 |
181 |
182 |
183 |
184 | public final void update() {
185 | if (worldShake>0) worldShake--;
186 | if (CameraTakeOverCountdown>0) CameraTakeOverCountdown--;
187 | else CameraTakeOver=false;
188 |
189 | worldShakeOffsetY=0;
190 | worldShakeOffsetX=0;
191 | if (worldShake>0) {
192 | if (worldShake>24) {
193 | worldShakeOffsetY=Globals.getRandom(8)-4;
194 | worldShakeOffsetX=Globals.getRandom(8)-4;
195 | } else if (worldShake>12) {
196 | worldShakeOffsetY=Globals.getRandom(4)-2;
197 | worldShakeOffsetX=Globals.getRandom(4)-2;
198 | } else {
199 | worldShakeOffsetY=Globals.getRandom(2)-1;
200 | worldShakeOffsetX=Globals.getRandom(2)-1;
201 | }
202 | }
203 |
204 | worldOffsetX+=worldShakeOffsetX;
205 | worldOffsetY+=worldShakeOffsetY;
206 |
207 | // place lights based on tiles
208 | int tx;
209 | int ty;
210 |
211 | tx=-worldOffsetX;
212 | for (int x=0; x=-128 && ty>=-128 && tx 255)
165 | splashAlpha=255;
166 | }
167 |
168 | if (!splashDone && worldTicks % 2 == 0) {
169 | splashFrame+=16;
170 | if (splashFrame == 96) {
171 | splashFrame=0;
172 | splashDone=true;
173 | }
174 | }
175 |
176 | // jump
177 | if (splashYSpeed < 6 && worldTicks % 2 == 0) splashYSpeed++;
178 | splashY+=splashYSpeed;
179 | if (splashY >= 0) {
180 | splashY=0;
181 | splashYSpeed=-(splashYSpeed >> 1);
182 | }
183 |
184 | // center on screen
185 | tx=(lowDisplayW >> 1) - 36;
186 | ty=((lowDisplayH >> 1) - 48) + splashY;
187 | // render pixel
188 | dest.set(tx, ty, tx + 72, ty + 72);
189 | src.set(splashFrame, 0, splashFrame + 16, 16);
190 | drawBitmap(splashImage, src, dest);
191 |
192 | // render name
193 | tx=(lowDisplayW >> 1) - 61;
194 | ty=(lowDisplayH >> 1) + 30;
195 | dest.set(tx, ty, tx + 122, ty + 26);
196 | src.set(0, 16, 122, 42);
197 | drawBitmap(splashImage, src, dest);
198 |
199 |
200 | if (worldTicks > 48 && splashDone) {
201 |
202 | if (mySocial != null) {
203 | mySocial.initSocial();
204 | mySocial.loginSocial();
205 | }
206 |
207 | activePlayer.resetControls(lowDisplayW, lowDisplayH);
208 |
209 | Globals.fillRandomTable();
210 |
211 | initNewGame();
212 | }
213 | break;
214 |
215 |
216 |
217 |
218 |
219 | case INITMAP:
220 | Monsters.killAll();
221 | FX.killAll();
222 | Bullets.killAll();
223 |
224 | myWorld.initWorld();
225 |
226 | generateWorld();
227 |
228 | levelTitleCountdown=256;
229 |
230 | FLight.isLightRendering=true;
231 | GameState=INGAME;
232 | break;
233 |
234 |
235 |
236 | case INGAME:
237 | FLight.clearLights();
238 | handleInput();
239 |
240 |
241 | myPlayer.update(myWorld);
242 | myWorld.update();
243 | myWorld.handleCamera(myPlayer);
244 |
245 | // add "planet side sun light"
246 | FLight.addLight((lowDisplayW>>1)-myWorld.worldOffsetX,(-64)-myWorld.worldOffsetY,256,FLight.LightType_Sphere,29,175,243,255);
247 |
248 |
249 | Monsters.updateMonsters(myWorld, myPlayer);
250 | Bullets.updateBullets(myWorld, myPlayer);
251 | FX.updateFX(myWorld,myPlayer);
252 |
253 |
254 | renderScene();
255 |
256 |
257 | if (myWorld.levelCompleted) {
258 | // choose next mission!
259 | menuSelectedItem=0;
260 | FLight.isLightRendering=false;
261 |
262 | Monsters.killAll();
263 | FX.killAll();
264 | Bullets.killAll();
265 |
266 | myPlayer.visible=false;
267 |
268 |
269 | myWorld.level++;
270 | if (myWorld.level==4) {
271 | myWorld.world++;
272 | myWorld.createGalaxy();
273 | myWorld.level=0;
274 | }
275 | GameState=INITMAP;
276 |
277 | }
278 | break;
279 | }
280 | }
281 |
282 |
283 |
284 | // Render everything uneffected by lights (statusbar, dialogs, messages, etc)
285 | public final void GameLoopPostLights() {
286 | switch (GameState) {
287 | case INGAME:
288 |
289 |
290 | // render topscene (on top of lights)
291 | // render solid tiles ("underworld")
292 | tx=-myWorld.worldOffsetX;
293 | for (int x=0; x < World.tileMapW; x++) {
294 | if (tx>-16 && tx-16 && ty0) {
317 | levelTitleCountdown--;
318 | renderText(Globals.galaxyNamePre[myWorld.worldPre]+" "+Globals.galaxyNamePost[myWorld.worldPost],0,-1,32,116,0,2);
319 | tx=(lowDisplayW>>1)-59;
320 | ty=40;
321 | dest.set(tx,ty,tx+117,ty+1);
322 | src.set(0,137,117,138);
323 | drawBitmap(sprites[1],src,dest);
324 | renderText( Mission.getName(myWorld.level) , 0, -1, 42, 320, 0, 0);
325 |
326 | // (world.level)
327 | renderText("("+myWorld.world+"."+(myWorld.level+1)+")",0,-1,52,320,0,0);
328 | }
329 | break;
330 |
331 |
332 | }
333 | }
334 |
335 |
336 | // keyboard or gamepad only
337 | // default is set to arrow-keys + x
338 | public final void handleInput() {
339 | myPlayer.resetInput();
340 |
341 | if (controller1.leftPressed) {
342 | myPlayer.leftPressed=true;
343 | }
344 |
345 | if (controller1.rightPressed) {
346 | myPlayer.rightPressed=true;
347 | }
348 |
349 | if (controller1.upPressed) {
350 | myPlayer.upPressed=true;
351 | }
352 |
353 | if (controller1.BUTTON_X) {
354 | myPlayer.actionPressed=true;
355 | }
356 |
357 |
358 | // TEST
359 | if (controller1.backPressed && !controller1.backLocked) {
360 | initNewGame();
361 | }
362 | }
363 |
364 |
365 |
366 |
367 |
368 |
369 | // [ INIT CODE! ]----------------------------------------------------------------------------
370 | public final void initNewGame() {
371 | myPlayer.newGameInit();
372 | myWorld.initNewGame(lowDisplayW,lowDisplayH);
373 |
374 | myWorld.level=0;
375 | GameState=INITMAP;
376 | }
377 |
378 |
379 |
380 |
381 |
382 |
383 | // [ RENDERING STUFF! ]----------------------------------------------------------------------------
384 | public final void renderScene() {
385 | drawPaint(255, 0, 0, 0);
386 |
387 | // render planet (top-part)
388 | tx=-(128+(myWorld.worldOffsetX%96));
389 | ty=(-44)-myWorld.worldOffsetY;
390 | //ty=(myWorld.worldFloorY-26)-myWorld.worldOffsetY;
391 | while (tx-16 && tx-16 && ty> 3) << 4), ((tile & 7) << 4) + 16, ((tile >> 3) << 4) + 16);
410 | drawBitmap(sprites[2], src, dest);
411 | }
412 | }
413 | ty+=16;
414 | }
415 | }
416 | tx+=16;
417 | }
418 |
419 |
420 | renderMonsters(1);
421 | renderPlayer(myPlayer);
422 | renderBullets(1);
423 | renderFX(1);
424 |
425 | // render planet (bottom-part) hanging over the first row of the underworld images
426 | tx=-(128+(myWorld.worldOffsetX%96));
427 | ty=(-44)-myWorld.worldOffsetY;
428 | while (tx0) renderWeapon(tmpPlayer);
458 | }
459 |
460 |
461 |
462 | public final void renderMonsters(int myRenderPassID) {
463 | int i=0;
464 | int tx;
465 | int ty;
466 |
467 | Monsters tmpMonster;
468 |
469 | while (i0) {
574 | myX-=1;
575 | myY-=2;
576 |
577 | dest.set(myX,myY,myX+Globals.weaponValues[weaponID][2],myY+Globals.weaponValues[weaponID][3]);
578 | src.set( Globals.weaponValues[weaponID][0], Globals.weaponValues[weaponID][1],
579 | Globals.weaponValues[weaponID][0]+Globals.weaponValues[weaponID][2], Globals.weaponValues[weaponID][1]+Globals.weaponValues[weaponID][3]);
580 | drawBitmap(sprites[1], src, dest);
581 | } else {
582 | // weapon on our back
583 | myX-=12;
584 | myY-=6;
585 | dest.set(myX,myY,myX+Globals.weaponValues[weaponID][2],myY+Globals.weaponValues[weaponID][3]);
586 | src.set( Globals.weaponValues[weaponID][0], Globals.weaponValues[weaponID][1],
587 | Globals.weaponValues[weaponID][0]+Globals.weaponValues[weaponID][2], Globals.weaponValues[weaponID][1]+Globals.weaponValues[weaponID][3]);
588 | drawBitmapRotated(sprites[1], src, dest,-120);
589 | }
590 | } else {
591 | if (tmpPlayer.actionDelay>0) {
592 | myX+=1;
593 | myY-=2;
594 |
595 | dest.set(myX-Globals.weaponValues[weaponID][2],myY,myX,myY+Globals.weaponValues[weaponID][3]);
596 | src.set( Globals.weaponValues[weaponID][0], (Globals.weaponValues[weaponID][1]+Globals.weaponValues[weaponID][3]),
597 | Globals.weaponValues[weaponID][0]+Globals.weaponValues[weaponID][2],
598 | (Globals.weaponValues[weaponID][1]+Globals.weaponValues[weaponID][3])+Globals.weaponValues[weaponID][3]);
599 | drawBitmap(sprites[1], src, dest);
600 | } else {
601 | myX+=12;
602 | myY-=6;
603 | dest.set(myX-Globals.weaponValues[weaponID][2],myY,myX,myY+Globals.weaponValues[weaponID][3]);
604 | src.set( Globals.weaponValues[weaponID][0], (Globals.weaponValues[weaponID][1]+Globals.weaponValues[weaponID][3]),
605 | Globals.weaponValues[weaponID][0]+Globals.weaponValues[weaponID][2],
606 | (Globals.weaponValues[weaponID][1]+Globals.weaponValues[weaponID][3])+Globals.weaponValues[weaponID][3]);
607 | drawBitmapRotated(sprites[1], src, dest,120);
608 | }
609 |
610 | }
611 |
612 | }
613 |
614 |
615 | public final void renderStatusbar() {
616 | // render score
617 | // renderText(String.format("%08d", myPlayer.score),0, -1,16,80,0,0);
618 |
619 | // money collected?
620 | renderCredits();
621 |
622 | // render heart above player (blinking if just hit)
623 | if (myPlayer.visible && (myPlayer.healthDelay==0 || myPlayer.healthDelay%4<2) ) {
624 | tx=(myPlayer.x-myWorld.worldOffsetX);
625 | ty=(myPlayer.y-myWorld.worldOffsetY)-9+(myPlayer.healthDelay>>2);
626 | dest.set(tx,ty,tx+7,ty+7);
627 | src.set(17,96, 24,103);
628 | drawBitmap(sprites[1],src,dest);
629 | tx+=9;
630 | dest.set(tx,ty,tx+5,ty+7);
631 | src.set(156+(myPlayer.health*6), 0,161+(myPlayer.health*6), 7);
632 | drawBitmap(sprites[25],src,dest);
633 | }
634 | }
635 |
636 |
637 | public final void renderCredits() {
638 | tx=lowDisplayW-64;
639 | renderText( Integer.toString(myPlayer.creditsCollected), 0, tx,16,64,0,0);
640 | tx-=8;
641 | dest.set(tx,16,tx+7,23);
642 | src.set(17,68,24,75);
643 | drawBitmap(sprites[1],src,dest);
644 | }
645 |
646 |
647 |
648 |
649 | // [ LEVEL GENERATOR ]----------------------------------------------------------------------------
650 |
651 | public final void generateWorld() {
652 | Levelroom[] myRooms = new Levelroom[96];
653 |
654 | int roomID=0;
655 | int nextY=0;
656 | int corridorHeight;
657 | int itterateCount;
658 |
659 | // create a list of rooms
660 | for (int i=0; i0) {
720 | startX=myRooms[roomID-1].x+Globals.getRandom(myRooms[roomID-1].width);
721 | itterateCount--;
722 | }
723 |
724 | if (itterateCount==0) break;
725 |
726 | // create corridor (entry into the underworld)
727 | corridorHeight=1+Globals.getRandom(3);
728 |
729 | for (int y=0; yWorld.tileMapW-1) myRooms[roomID].x=World.tileMapW-myRooms[roomID].width-1;
753 | myRooms[roomID].y=nextY;
754 |
755 | // cut out the room from the solid underworld
756 | myWorld.putArea(myRooms[roomID].x,myRooms[roomID].y,myRooms[roomID].width,myRooms[roomID].height,World.tEMPTY);
757 |
758 | // texture the room
759 | myWorld.putAreaRendermap(myRooms[roomID].x,myRooms[roomID].y,myRooms[roomID].width,1, 2);
760 | myWorld.putAreaRendermap(myRooms[roomID].x,myRooms[roomID].y+1,myRooms[roomID].width,1, 10);
761 | myWorld.putRendermap(myRooms[roomID].x,myRooms[roomID].y,1);
762 | myWorld.putRendermap(myRooms[roomID].x,myRooms[roomID].y+1,9);
763 |
764 |
765 |
766 |
767 | // randomly add light-tiles to corridor + floors
768 | itterateCount=myRooms[roomID].width>>2;
769 | while (itterateCount>0) {
770 | // add lights into the wall textures at random spots
771 | myWorld.putRendermap(myRooms[roomID].x+1+Globals.getRandom(myRooms[roomID].width-2), myRooms[roomID].y, 3);
772 |
773 | // add lights on the floor at random spots
774 | if (myWorld.Spriteset==2)
775 | myWorld.putRendermap(myRooms[roomID].x+1+Globals.getRandom(myRooms[roomID].width-2), myRooms[roomID].y+1, 12);
776 |
777 | itterateCount--;
778 | }
779 |
780 |
781 | // randomly add "pilar" tiles (if nothing else was placed)
782 | itterateCount=myRooms[roomID].width>>2;
783 | while (itterateCount>0) {
784 | tx=Globals.getRandom(myRooms[roomID].width-2);
785 |
786 | if (myWorld.getRendermap(myRooms[roomID].x+1+tx, myRooms[roomID].y)==2
787 | || myWorld.getRendermap(myRooms[roomID].x+1+tx, myRooms[roomID].y)==10) {
788 | myWorld.putRendermap(myRooms[roomID].x+1+tx, myRooms[roomID].y, 5);
789 | myWorld.putRendermap(myRooms[roomID].x+1+tx, myRooms[roomID].y+1, 13);
790 | }
791 |
792 | itterateCount--;
793 | }
794 |
795 |
796 | roomID++;
797 | previousStartX=startX;
798 |
799 | }
800 |
801 |
802 | // add planet core to last room
803 | itterateCount=myRooms[roomID-1].width;
804 | tx=myRooms[roomID-1].x+1+Globals.getRandom(myRooms[roomID-1].width-2);
805 | while (itterateCount>0) {
806 | ty=myRooms[roomID-1].y+1;
807 | if (!myWorld.isSolid(tx, ty) && myWorld.isSolid(tx, ty+1)) {
808 | Monsters.addMonster(Monsters.mPLANETCORE, tx<<4,ty<<4, 0, myWorld);
809 | itterateCount=0;
810 | } else {
811 | tx++;
812 | if (tx>myRooms[roomID].x+myRooms[roomID].width) tx=myRooms[roomID].x+1;
813 | }
814 | itterateCount--;
815 | }
816 |
817 | // clear markers
818 | myWorld.clearType(World.tMARKER);
819 |
820 |
821 | myPlayer.init( 48, lowDisplayH-32);
822 | myWorld.setCamera(0, -256);
823 |
824 |
825 |
826 | // Add the player ship, triggering the player's drop
827 | Monsters.addMonster(Monsters.mSHIP, 48, (-3)<<4, 0, myWorld);
828 | Monsters.addMonster(Monsters.mSCENERY, (14<<4)-8, 8, 0, myWorld);
829 |
830 |
831 | }
832 |
833 |
834 |
835 | public final void populateRoom(Levelroom myRoom) {
836 | // add metal crates randomly
837 | int itterateCount=myRoom.width>>3;
838 | while (itterateCount>0) {
839 | tx=myRoom.x+1+Globals.getRandom(myRoom.width-2);
840 | ty=myRoom.y+1;
841 | if (!myWorld.isSolid(tx, ty) && myWorld.isSolid(tx, ty+1)) {
842 | Monsters.addMonster(Monsters.mSOLIDSCENERY, tx<<4,ty<<4, 0, myWorld);
843 | }
844 | itterateCount--;
845 | }
846 |
847 | // add health
848 | itterateCount=Globals.getRandom(myRoom.width>>2);
849 | while (itterateCount>0) {
850 | tx=myRoom.x+1+Globals.getRandom(myRoom.width-2);
851 | ty=myRoom.y;
852 | if (!myWorld.isSolid(tx, ty)) {
853 | Monsters.addMonster(Monsters.mHEALTH, tx<<4,ty<<4, 0, myWorld);
854 | }
855 | itterateCount--;
856 | }
857 |
858 |
859 |
860 | // add some monsters
861 | itterateCount=myRoom.width>>2;
862 | int monsterType;
863 |
864 | int maxDifficulty=8*myWorld.difficulty;
865 |
866 | while (itterateCount>0 && maxDifficulty>0) {
867 |
868 | monsterType=Globals.getRandom(3);
869 |
870 | tx=myRoom.x+1+Globals.getRandom(myRoom.width-2);
871 | ty=myRoom.y+1;
872 |
873 | if (!myWorld.isSolid(tx, ty) && myWorld.isSolid(tx, ty+1)) {
874 |
875 | switch (monsterType) {
876 | case 0:
877 | if (myWorld.difficulty<3 || Globals.getRandom(100)>90) {
878 | Monsters.addMonster(Monsters.mWORM, tx<<4,ty<<4, 0, myWorld);
879 | maxDifficulty--;
880 | }
881 | break;
882 |
883 | case 1:
884 | if (myWorld.difficulty>1 || Globals.getRandom(100)>90) {
885 | Monsters.addMonster(Monsters.mROBOEYE, tx<<4,ty<<4, 0, myWorld);
886 | maxDifficulty-=2;
887 | }
888 | break;
889 |
890 | case 2:
891 | if (myWorld.difficulty>1 || Globals.getRandom(100)>90) {
892 | Monsters.addMonster(Monsters.mBOUNCEXPLODE, tx<<4,ty<<4, 0, myWorld);
893 | maxDifficulty-=2;
894 | }
895 | break;
896 |
897 | }
898 | }
899 | itterateCount--;
900 | }
901 | }
902 | }
903 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/social/Social.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.social;
2 |
3 |
4 | public interface Social {
5 |
6 |
7 | public boolean isConnected();
8 |
9 |
10 | public void initSocial();
11 | public void loginSocial();
12 |
13 | public void disposeSocial();
14 |
15 | public void uploadScore(String leaderBoard, int score, boolean keepBest);
16 | public void uploadAchievement(int achievementID);
17 |
18 | public void getScores(String leaderBoard);
19 |
20 | public void uploadDaily(String leaderBoard, int score);
21 |
22 | // called on every frame update, steam requires this to process the callbacks
23 | public void processInfo();
24 |
25 | public int getMaxHighscoreCount();
26 | public int getHighScores(int idx);
27 | public String getHighScoreName(int idx);
28 | public boolean doneDownloadingScores();
29 | public boolean doneUploadingScore();
30 | public boolean noLeaderboardFound();
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/utils/FLight.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.utils;
2 |
3 | import com.badlogic.gdx.graphics.Color;
4 | import com.badlogic.gdx.graphics.Texture;
5 |
6 | public class FLight {
7 |
8 | public final static int LightType_Up = 0,
9 | LightType_Right = 1,
10 | LightType_Down = 2,
11 | LightType_Left = 3,
12 | LightType_SphereTense = 4,
13 | LightType_Sphere = 5,
14 | LightType_FLARE = 6,
15 |
16 | LightType_CLIP = 7;
17 |
18 |
19 |
20 | // light stuff
21 | public static Texture lightSprite;
22 | public static FLight[] myLights = new FLight[256];
23 | public static boolean isLightRendering; // switch this on/off when needed
24 | public static Color ambientColor=new Color();
25 |
26 |
27 |
28 | // type of light
29 | int lightType;
30 |
31 | // position and dimensions
32 | float x;
33 | float y;
34 | float w;
35 | float h;
36 |
37 | float distance;
38 |
39 | // colors
40 | float r;
41 | float g;
42 | float b;
43 | float a;
44 |
45 | boolean active;
46 |
47 |
48 | public final static void initLights() {
49 | for (int i=myLights.length - 1; i >= 0; i--) {
50 | myLights[i]=new FLight(); // 128);
51 | myLights[i].setActive(false);
52 | }
53 | }
54 |
55 |
56 | // light handling
57 | public final static void clearLights() {
58 | for (int i=0; i < myLights.length; i++) {
59 | myLights[i].setActive(false);
60 | }
61 | }
62 |
63 |
64 | public final static void addLight(int ax, int ay, float myDist, int myType, int myR, int myG, int myB, int myA) {
65 | int i=0;
66 | // FakeLight
67 | while (i < myLights.length && myLights[i].isActive()) i++;
68 | if (i < myLights.length) {
69 | myLights[i].setLightType(myType);
70 |
71 | myLights[i].setPosition(ax,ay);
72 | myLights[i].setColor(myR/255f, myG/255f, myB/255f, myA/255f);
73 | myLights[i].setDistance(myDist);
74 | myLights[i].setActive(true);
75 | }
76 |
77 | }
78 |
79 |
80 |
81 |
82 |
83 | public int getLightType() {
84 | return lightType;
85 | }
86 |
87 | public void setLightType(int myType) {
88 | lightType=myType;
89 | }
90 |
91 | public float getX() {
92 | return x;
93 | }
94 |
95 | public float getY() {
96 | return y;
97 | }
98 |
99 | public void setPosition(float ax, float ay) {
100 | x=ax;
101 | y=ay;
102 | }
103 |
104 | public Color getColor() {
105 | return new Color(r,g,b,a);
106 | }
107 |
108 | public void setColor(float ar, float ag, float ab, float aa) {
109 | r=ar;
110 | g=ag;
111 | b=ab;
112 | a=aa;
113 | }
114 |
115 | public float getDistance() {
116 | return distance;
117 | }
118 |
119 | public void setDistance(float adistance) {
120 | distance=adistance;
121 | }
122 |
123 | public boolean isActive() {
124 | return active;
125 | }
126 |
127 | public void setActive(boolean mActive) {
128 | active=mActive;
129 | }
130 |
131 |
132 | }
133 |
--------------------------------------------------------------------------------
/core/src/com/orangepixel/utils/Rect.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.utils;
2 |
3 | public class Rect {
4 |
5 | public int left;
6 | public int right;
7 | public int top;
8 | public int bottom;
9 | public int width;
10 | public int height;
11 |
12 | public final void set(int mleft, int mtop, int mright, int mbottom) {
13 | left=mleft;
14 | top=mtop;
15 | right=mright;
16 | bottom=mbottom;
17 |
18 | width=right-left;
19 | height=bottom-top;
20 | }
21 |
22 | public final void set(Rect mSource) {
23 | left=mSource.left;
24 | top=mSource.top;
25 | right=mSource.right;
26 | bottom=mSource.bottom;
27 | width=mSource.width;
28 | height=mSource.height;
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/desktop/.classpath:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/desktop/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Planet Busters-desktop
4 |
5 |
6 |
7 |
8 |
9 | org.eclipse.jdt.core.javabuilder
10 |
11 |
12 |
13 |
14 |
15 | org.eclipse.jdt.core.javanature
16 |
17 |
18 |
19 | assets
20 | 2
21 | PARENT-1-PROJECT_LOC/android/assets
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/desktop/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #
2 | #Sat Dec 19 10:43:55 CET 2015
3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
4 | org.eclipse.jdt.core.compiler.compliance=1.6
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
10 | eclipse.preferences.version=1
11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
12 | org.eclipse.jdt.core.compiler.source=1.6
13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
14 |
--------------------------------------------------------------------------------
/desktop/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "java"
2 |
3 | sourceCompatibility = 1.6
4 | sourceSets.main.java.srcDirs = [ "src/" ]
5 |
6 | project.ext.mainClassName = "com.orangepixel.planetbusters.desktop.DesktopLauncher"
7 | project.ext.assetsDir = new File("../android/assets");
8 |
9 | task run(dependsOn: classes, type: JavaExec) {
10 | main = project.mainClassName
11 | classpath = sourceSets.main.runtimeClasspath
12 | standardInput = System.in
13 | workingDir = project.assetsDir
14 | ignoreExitValue = true
15 | }
16 |
17 | task dist(type: Jar) {
18 | from files(sourceSets.main.output.classesDir)
19 | from files(sourceSets.main.output.resourcesDir)
20 | from {configurations.compile.collect {zipTree(it)}}
21 | from files(project.assetsDir);
22 |
23 | manifest {
24 | attributes 'Main-Class': project.mainClassName
25 | }
26 | }
27 |
28 | dist.dependsOn classes
29 |
30 | eclipse {
31 | project {
32 | name = appName + "-desktop"
33 | linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/android/assets'
34 | }
35 | }
36 |
37 | task afterEclipseImport(description: "Post processing after project generation", group: "IDE") {
38 | doLast {
39 | def classpath = new XmlParser().parse(file(".classpath"))
40 | new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]);
41 | def writer = new FileWriter(file(".classpath"))
42 | def printer = new XmlNodePrinter(new PrintWriter(writer))
43 | printer.setPreserveWhitespace(true)
44 | printer.print(classpath)
45 | }
46 | }
--------------------------------------------------------------------------------
/desktop/src/com/orangepixel/planetbusters/desktop/DesktopLauncher.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters.desktop;
2 |
3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
5 | import com.orangepixel.planetbusters.myCanvas;
6 |
7 | public class DesktopLauncher {
8 |
9 | static myCanvas startCanvas;
10 |
11 |
12 | public static void main (String[] args) {
13 | LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
14 |
15 | cfg.title = "Planet Busters - LibGDX Jam";
16 | cfg.resizable=true;
17 | cfg.vSyncEnabled=true;
18 |
19 | cfg.width = 1080;
20 | cfg.height = 720;
21 | cfg.fullscreen=false;
22 |
23 |
24 | startCanvas=new myCanvas();
25 |
26 | new LwjglApplication(startCanvas, cfg);
27 |
28 | // startup options
29 | for (String s: args) {
30 | if (s.toLowerCase().contains("nocontroller")) {
31 | startCanvas.argument_noController=true;
32 | cfg.title+=" - nocontroller";
33 | }
34 |
35 | if (s.toLowerCase().contains("forcewindow")) {
36 | startCanvas.argument_forceWindowed=true;
37 | cfg.title+=" - windowed";
38 | }
39 | }
40 |
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.daemon=true
2 | org.gradle.jvmargs=-Xms128m -Xmx512m
3 | org.gradle.configureondemand=true
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Sat Sep 21 13:08:26 CEST 2013
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=http\://services.gradle.org/distributions/gradle-2.4-all.zip
7 |
--------------------------------------------------------------------------------
/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/ios/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ios/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | Planet Busters-ios
4 |
5 |
6 |
7 | org.eclipse.jdt.core.javanature
8 | org.robovm.eclipse.RoboVMNature
9 |
10 |
11 |
12 | org.eclipse.jdt.core.javabuilder
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ios/.settings/org.eclipse.jdt.core.prefs:
--------------------------------------------------------------------------------
1 | #
2 | #Sat Dec 19 10:43:55 CET 2015
3 | org.eclipse.jdt.core.compiler.debug.localVariable=generate
4 | org.eclipse.jdt.core.compiler.compliance=1.7
5 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate
7 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
8 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
9 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate
10 | eclipse.preferences.version=1
11 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
12 | org.eclipse.jdt.core.compiler.source=1.7
13 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
14 |
--------------------------------------------------------------------------------
/ios/Info.plist.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | ${app.name}
9 | CFBundleExecutable
10 | ${app.executable}
11 | CFBundleIdentifier
12 | ${app.id}
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | ${app.name}
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | ${app.version}
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | ${app.build}
25 | LSRequiresIPhoneOS
26 |
27 | UIViewControllerBasedStatusBarAppearance
28 |
29 | UIStatusBarHidden
30 |
31 | UIDeviceFamily
32 |
33 | 1
34 | 2
35 |
36 | UIRequiredDeviceCapabilities
37 |
38 | armv7
39 | opengles-2
40 |
41 | UISupportedInterfaceOrientations
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationLandscapeLeft
45 | UIInterfaceOrientationLandscapeRight
46 |
47 | CFBundleIcons
48 |
49 | CFBundlePrimaryIcon
50 |
51 | CFBundleIconFiles
52 |
53 | Icon
54 | Icon-72
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/ios/build.gradle:
--------------------------------------------------------------------------------
1 | sourceSets.main.java.srcDirs = [ "src/" ]
2 |
3 | sourceCompatibility = '1.7'
4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
5 |
6 | ext {
7 | mainClassName = "com.orangepixel.planetbusters.IOSLauncher"
8 | }
9 |
10 | launchIPhoneSimulator.dependsOn build
11 | launchIPadSimulator.dependsOn build
12 | launchIOSDevice.dependsOn build
13 | createIPA.dependsOn build
14 |
15 |
16 | eclipse.project {
17 | name = appName + "-ios"
18 | natures 'org.robovm.eclipse.RoboVMNature'
19 | }
--------------------------------------------------------------------------------
/ios/data/Default-375w-667h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default-375w-667h@2x.png
--------------------------------------------------------------------------------
/ios/data/Default-414w-736h@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default-414w-736h@3x.png
--------------------------------------------------------------------------------
/ios/data/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default-568h@2x.png
--------------------------------------------------------------------------------
/ios/data/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default.png
--------------------------------------------------------------------------------
/ios/data/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default@2x.png
--------------------------------------------------------------------------------
/ios/data/Default@2x~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default@2x~ipad.png
--------------------------------------------------------------------------------
/ios/data/Default~ipad.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Default~ipad.png
--------------------------------------------------------------------------------
/ios/data/Icon-72.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Icon-72.png
--------------------------------------------------------------------------------
/ios/data/Icon-72@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Icon-72@2x.png
--------------------------------------------------------------------------------
/ios/data/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Icon.png
--------------------------------------------------------------------------------
/ios/data/Icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/ios/data/Icon@2x.png
--------------------------------------------------------------------------------
/ios/robovm.properties:
--------------------------------------------------------------------------------
1 | app.version=1.0
2 | app.id=com.orangepixel.planetbusters.IOSLauncher
3 | app.mainclass=com.orangepixel.planetbusters.IOSLauncher
4 | app.executable=IOSLauncher
5 | app.build=1
6 | app.name=Planet Busters
7 |
--------------------------------------------------------------------------------
/ios/robovm.xml:
--------------------------------------------------------------------------------
1 |
2 | ${app.executable}
3 | ${app.mainclass}
4 | ios
5 | thumbv7
6 | ios
7 | Info.plist.xml
8 |
9 |
10 | ../android/assets
11 |
12 | **
13 |
14 | true
15 |
16 |
17 | data
18 |
19 |
20 |
21 | com.badlogic.gdx.scenes.scene2d.ui.*
22 | com.badlogic.gdx.graphics.g3d.particles.**
23 | com.android.okhttp.HttpHandler
24 | com.android.okhttp.HttpsHandler
25 | com.android.org.conscrypt.**
26 | com.android.org.bouncycastle.jce.provider.BouncyCastleProvider
27 | com.android.org.bouncycastle.jcajce.provider.keystore.BC$Mappings
28 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi
29 | com.android.org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$Std
30 | com.android.org.bouncycastle.jce.provider.PKIXCertPathValidatorSpi
31 | com.android.org.bouncycastle.crypto.digests.AndroidDigestFactoryOpenSSL
32 | org.apache.harmony.security.provider.cert.DRLCertFactory
33 | org.apache.harmony.security.provider.crypto.CryptoProvider
34 |
35 |
36 | z
37 |
38 |
39 | UIKit
40 | OpenGLES
41 | QuartzCore
42 | CoreGraphics
43 | OpenAL
44 | AudioToolbox
45 | AVFoundation
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/src/com/orangepixel/planetbusters/IOSLauncher.java:
--------------------------------------------------------------------------------
1 | package com.orangepixel.planetbusters;
2 |
3 | import org.robovm.apple.foundation.NSAutoreleasePool;
4 | import org.robovm.apple.uikit.UIApplication;
5 |
6 | import com.badlogic.gdx.backends.iosrobovm.IOSApplication;
7 | import com.badlogic.gdx.backends.iosrobovm.IOSApplicationConfiguration;
8 | import com.orangepixel.planetbusters.myCanvas;
9 |
10 | public class IOSLauncher extends IOSApplication.Delegate {
11 | @Override
12 | protected IOSApplication createApplication() {
13 | IOSApplicationConfiguration config = new IOSApplicationConfiguration();
14 | return new IOSApplication(new myCanvas(), config);
15 | }
16 |
17 | public static void main(String[] argv) {
18 | NSAutoreleasePool pool = new NSAutoreleasePool();
19 | UIApplication.main(argv, null, IOSLauncher.class);
20 | pool.close();
21 | }
22 | }
--------------------------------------------------------------------------------
/local.properties:
--------------------------------------------------------------------------------
1 | # Location of the android SDK
2 | sdk.dir=/Users/pascalbestebroer/Developer/android-sdk-macosx
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include 'desktop', 'android', 'ios', 'core'
--------------------------------------------------------------------------------
/tempgfx/mockup.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/orangepascal/planetbusters/3bc9a527a7fc94cd60c395c81c2963918260d682/tempgfx/mockup.xcf
--------------------------------------------------------------------------------