Compare commits

...

25 Commits

Author SHA1 Message Date
Sylvain PILLOT e8a636d11d Add LICENSE.txt 2024-03-20 20:40:48 +01:00
Sylvain PILLOT 137cf2f6a9 major refactoring of code and project classes phase 2 2023-08-31 13:41:11 +02:00
Sylvain PILLOT df5fcd900d major refactoring of code and project structure phase 1 2023-08-31 09:58:35 +02:00
Sylvain PILLOT 8138a5e554 trajectories can now be shared for several enemies (fleets) + new assets + adjustable background speed + ... 2023-08-30 10:01:20 +02:00
Sylvain PILLOT 5b83f8f2a8 Prepare stuff for mode of Shmup 2023-08-25 10:33:52 +02:00
Sylvain PILLOT 51536e6dcd updated TODO.txt 2023-08-23 22:35:20 +02:00
Sylvain PILLOT 109692b171 added boss tarjectory based on splines + corrected bullet vector trajectory taht was not correctly rounded during num32->int conversion 2023-08-23 20:16:30 +02:00
Sylvain PILLOT ba1c9362b6 update roadmap and completed README.md / TODO.txt accordingly 2023-08-23 09:07:11 +02:00
Sylvain PILLOT a524c5f08e Boss with satellite guns - Bullet Hell versions to test framerate 2023-08-22 23:34:18 +02:00
Sylvain PILLOT 22f087db76 updated TODO.txt + added missing some memory release for MyPlayer and MyBoss 2023-08-16 07:57:55 +02:00
Sylvain PILLOT 47d2075e3c updated TODO.txt 2023-08-14 17:40:49 +02:00
Sylvain PILLOT a1ef2e7ba0 Bosses are now working great 2023-08-14 14:37:52 +02:00
Sylvain PILLOT 32deb536c9 added boss with multiple destructible parts and many explosions 2023-08-14 14:22:53 +02:00
Sylvain PILLOT 36bce711cc Working on implementation of Boss with multiple parts to be exploded [WIP] 2023-08-13 17:33:25 +02:00
Sylvain PILLOT e6c1e93874 made it compatible with latest version of Azur and new command generation structure 2023-08-01 19:01:11 +02:00
Sylvain PILLOT 65c605bd96 update todo list 2023-03-31 21:44:44 +02:00
Sylvain PILLOT 05d84dcb4d update usb_write_sync as per new Lephe's USB driver request @dev 2023-02-10 22:35:19 +01:00
Sylvain PILLOT c9e7801f35 Added the Bonus System 2023-02-05 16:49:56 +01:00
Sylvain PILLOT 28718ae6d0 resynch 2023-02-05 14:07:44 +01:00
Sylvain PILLOT 907639ae1a basic fixed-point math trigonometric functions 2023-02-05 13:53:42 +01:00
Sylvain PILLOT b4203610a0 enemy shoots + scrolable background 2023-02-05 10:05:05 +01:00
Sylvain PILLOT 7df7b70f5d added vertical scrolling of the background for large maps 2023-01-31 23:07:32 +01:00
Sylvain PILLOT bc90a2d6c5 test to create a tilesmap shader 2023-01-30 22:31:33 +01:00
Sylvain PILLOT f4fa7b0c48 changed the background colorsheme of Level1 - made it darker + increase of player speed 2023-01-29 22:39:30 +01:00
Sylvain PILLOT bcea8d061d big tileset and support multi-layer map from Tiled 2023-01-29 19:55:11 +01:00
103 changed files with 3629 additions and 1081 deletions

4
.gitignore vendored
View File

@ -1,6 +1,7 @@
# Build files
/build-fx
/build-cg
/build-cg-push
/*.g1a
/*.g3a
@ -11,3 +12,6 @@
*.sublime-project
*.sublime-workspace
.vscode
*.json

View File

@ -15,12 +15,14 @@ find_package(LibProf 2.4 REQUIRED)
fxconv_declare_converters(assets-cg/converters.py)
add_custom_command(
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/Levels/Level1.json"
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/Levels/Level1.json"
OUTPUT "${CMAKE_CURRENT_LIST_DIR}/assets-cg/Levels/Level2.json"
COMMENT "Convert Tiled TMX map to usable JSON file"
COMMAND tiled --export-tileset json Tileset_Space.tsx Tileset_Space.json
COMMAND find | grep .*.tmx | sed 's/.tmx//g' | xargs -l bash -c 'tiled --export-map json $$0.tmx $$0.json'
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/assets-cg/Levels/
DEPENDS assets-cg/Levels/Level1.tmx
DEPENDS assets-cg/Levels/Level1.tmx
assets-cg/Levels/Level2.tmx
assets-cg/converters.py
assets-cg/Levels/tileset.png
assets-cg/Levels/Tileset_Space.tsx)
@ -28,46 +30,77 @@ add_custom_command(
set(SOURCES
src/main.cpp
src/extrakeyboard.cpp
src/collections.cpp
src/impact.cpp
src/player.cpp
src/utilities.cpp
src/particles.cpp
src/bullet.cpp
src/enemy.cpp
src/starfieldshader.cpp
src/background.cpp
src/point2D.cpp
src/trajectory.cpp
src/utilities/fast_trig.cpp
src/utilities/extrakeyboard.cpp
src/utilities/utilities.cpp
src/utilities/vector2D.cpp
src/shaders/circle.cpp
src/shaders/poly.cpp
src/shaders/filledcircle.cpp
src/shaders/filledpoly.cpp
src/shaders/line.cpp
src/shaders/starfieldshader.cpp
src/shmup/entity.cpp
src/shmup/collections.cpp
src/shmup/impact.cpp
src/shmup/player.cpp
src/shmup/particles.cpp
src/shmup/bullet.cpp
src/shmup/enemy.cpp
src/shmup/background.cpp
src/shmup/bonus.cpp
src/shmup/boss.cpp
src/shmup/trajectory.cpp
# ...
)
set(ASSETS_cg
assets-cg/font.png
#assets-cg/font.png
assets-cg/milifont.png
assets-cg/Sprites/Explosions/firstboom.png
assets-cg/Sprites/Explosions/emp_circ.png
assets-cg/Sprites/Explosions/fill_circ.png
assets-cg/Sprites/Bonus/life_bonus.png
assets-cg/Sprites/Bonus/sat_bonus.png
assets-cg/Sprites/Bullets/bullet_normal.png
assets-cg/Sprites/Bullets/bullet_blue.png
assets-cg/Sprites/Bullets/bullet_laser.png
assets-cg/Sprites/Bullets/bullet_enemy_blue.png
assets-cg/Sprites/Bullets/bullet_enemy_red.png
assets-cg/Sprites/Bullets/bullet_enemy_green.png
assets-cg/Sprites/Players/mainship1.png
assets-cg/Sprites/Players/Satellite_Lvl1.png
assets-cg/Sprites/Players/player_ship1.png
assets-cg/Sprites/Players/player_ship2.png
assets-cg/Sprites/Players/player_ship3.png
assets-cg/Sprites/Players/player_ship4.png
assets-cg/Sprites/Players/player_ship5.png
assets-cg/Sprites/Players/player_ship6.png
assets-cg/Sprites/Players/player_ship7.png
assets-cg/Sprites/Players/player_ship8.png
assets-cg/Sprites/Enemies/Lifebar.png
assets-cg/Sprites/Enemies/mainship2.png
assets-cg/Sprites/Enemies/Enemy_Blue_Lvl1.png
assets-cg/Sprites/Enemies/Enemy_Red_Lvl1.png
assets-cg/Sprites/Boss/Boss1.png
assets-cg/Sprites/Boss/BossGun.png
assets-cg/Levels/tileset.png
assets-cg/Levels/Level1.json
# assets-cg/Levels/Tileset_Space.json
assets-cg/Levels/Level2.json
# assets-cg/Levels/Tileset_Space.json
# ...
)
@ -75,10 +108,10 @@ fxconv_declare_assets(${ASSETS} ${ASSETS_fx} ${ASSETS_cg} WITH_METADATA)
add_executable(shmup ${SOURCES} ${ASSETS} ${ASSETS_${FXSDK_PLATFORM}})
target_compile_options(shmup PRIVATE -Wall -Wextra -Os -std=c++20)
target_link_options(shmup PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage -fpermissive)
target_link_options(shmup PRIVATE -Wl,-Map=Build_Addin.map -Wl,--print-memory-usage -fno-use-cxa-atexit -fpermissive)
target_link_libraries(shmup Azur::Azur -lnum LibProf::LibProf Gint::Gint -lstdc++)
if("${FXSDK_PLATFORM_LONG}" STREQUAL fxCG50)
generate_g3a(TARGET shmup OUTPUT "MyShmup.g3a"
NAME "MyShmup" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
NAME "Shmup v0.4" ICONS assets-cg/icon-uns.png assets-cg/icon-sel.png)
endif()

169
LICENSE.txt Normal file
View File

@ -0,0 +1,169 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for software and other kinds of works.
The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.
Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based on the Program.
To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work.
A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.
The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.
The Corresponding Source for a work in source code form is that same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.
When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified it, and giving a relevant date.
b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices".
c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.
A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:
a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.
d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.
A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.
"Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.
If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).
The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or authors of the material; or
e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.
All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).
However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.
Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.
If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.
A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.
If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.
Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

View File

@ -3,4 +3,87 @@
First attempt to use Lephe's Azur.
Yet it only consists in a Particle Engine able to reproduce some kind of explosions and a starfield moving in the background of the screen.
The particle engine is based on fixed-point maths for update and on Azur shaders for rendering.
The particle engine is based on fixed-point maths for update and on Azur shaders for rendering.
Some pictures of current revision
![Boss with Bullet Hell effect (test)](https://www.planet-casio.com/storage/staff/BulletHell1.png)
![Simple enemy on a Spline Trajectory](https://imgur.com/VdBngl3.png)
[Current video of "gameplay"](https://youtu.be/vJsYjfI_HT4)
Still a lot of missing features.
Please see below what I would like to implement on the long run (sorry in French right now).
# SHMUP Todo list :
## Moteur de jeu
- [DONE] better keyboard management engine for keypressed() and keyreleased() events
- Mettre une système d'ajustement de FPS mini avec switch des niveaux d'overclock à la volée de manière dynamique
## Partie décors :
- [WIP] - animer le décors avec le parallaxe (glissement de la droite vers la gauche pour donner l'avancement du vaisseau).
- animer des éléments du décors (clignotements, sprites animés, ...)
- interaction avec le décors (collisions possibles avec certaines tiles) qui imposent donc de suivre un "chemin" dans le niveau
- [DONE] multiple layers de tiles pour avoir des niveaux plus beaux
## Partie mouvement :
- améliorer le système de trajectoires sur base de Splines pour rendre la vitesse des ennemis plus constante.
- rendre les satellites sur une trajectoire (possibilité d'avoir des patterns plus complexes)
- possibilité de transformer les trajectoires (grossissement/rétrécissement, translation et rotation)
## Partie interaction / gameplay :
- implémenter les tirs ennemis (avec une IA minimale)
- [DONE] implémenter les hits des tirs ennemis sur le joueur
- implémenter les collisions avec les ennemies
- implémenter les collisions de bullets avec les satellites pour que ceux-ci perdent de la vie aussi
- implémenter le tir des satellites
- [DONE] implémenter un système de bonus (points, upgrade tir/satellites/... )
- implémenter un système d'amélioration de compétence de tirs (bullet -> mega bullet -> laser -> )
- implémenter un système d'animation du vaisseau (réacteurs par exemple)
## Bosses
- [DONE] Créer des bosses avec différentes zones, mobiles les unes par rapport aux autres
- [DONE] Créer des hitboxes pour chacune des zones du boss avec différentes sensibilités (par exemple le coeur/générateur = zone critique, mais mieux défendues)
- [DONE] Créer des protections pour certaines zones qui peuvent "sauter" (boucliers qui s'usent)
## Autres :
- [DONE] plein de trucs dont boss "multi-morceaux et multi-hitboxes"
- création de différents levels
- créations de différents ennemis
- créations de différents boss
o boss 1 : "rotating shield" avec multiples cannons
o boss 2 : "threwing saws"
o boss 3 : "Gun Crab"
o boss 4 : "Demoniac Snake"
o boss 5 : "Space Octopus"
- création de séquences avec les boss (différentes phases)
- créations de différentes armes
- [DONE - CAN BE IMPROVED] créations de différents bonus
- création de shields pour se protéger
## Modes spéciaux
- mode menu avec différentes planètes à selectionner pour les différents niveaux
- mode hyperspace travel pour les transitions :
- sous mode : à la "Tie fighter" ?
- sous mode : éviter les astéroïdes
- sous mode classique shmup horizontal
- sous mode classique shmup vertical
- sous mode Danmaku / Bullet Hell (par exemple contre les boss)
## Interface :
- Page d'accueil
- Choix du niveau
- Ecran de titre

103
TODO.txt
View File

@ -1,31 +1,106 @@
The SHMUP Todo list :
# The SHMUP Todo list :
# Engine
- better keyboard management engine for keypressed() and keyreleased() events
## Engine
- [DONE] better keyboard management engine for keypressed() and keyreleased() events
- Mettre une système d'ajustement de FPS mini avec switch des niveaux d'overclock à la volée de manière dynamique
- [DONE] Mettre en place un système de collision en "pixel perfect" pour mode jeu "Asteroids Alert !!!"
- refactoriser les classes des entités "mobiles"
o class Entity (position, box, ID, trajectory)
~~> class Enemy : public Entity (+shoot, +life)
~~> class Boss : public Enemy (+multiple shoots, +multiple life)
~~> class Bonus : public Entity (currentframe)
# Partie décors :
## Partie décors :
- [WIP] - animer le décors avec le parallaxe (glissement de la droite vers la gauche pour donner l'avancement du vaisseau).
- animer des éléments du décors (clignotements, sprites animés, ...)
- interaction avec le décors (collisions possibles avec certaines tiles) qui imposent donc de suivre un "chemin" dans le niveau
- [DONE] multiple layers de tiles pour avoir des niveaux plus beaux
- implémenter des vitesses de défilement variables pour les décors de fond.
Partie mouvement :
## Partie mouvement :
- améliorer le système de trajectoires sur base de Splines pour rendre la vitesse des ennemis plus constante.
- rendre les satellites sur une trajectoire (possibilité d'avoir des patterns plus complexes)
- possibilité de transformer les trajectoires (grossissement/rétrécissement, translation et rotation)
Partie interaction / gameplay :
- implémenter les tirs ennemis (avec une IA minimale)
- implémenter les hits des tirs ennemis sur le joueur
- implémenter les collisions avec les ennemies
- implémenter le tir des satellites
- implémenter un système de bonus (points, upgrade tir/satellites/... )
Autres :
- plein de trucs dont boss "multi-morceaux et multi-hitboxes"
## Partie interaction / gameplay :
- implémenter les tirs ennemis (avec une IA minimale)
- [DONE] implémenter les hits des tirs ennemis sur le joueur
- implémenter les collisions avec les ennemies
- implémenter les collisions de bullets avec les satellites pour que ceux-ci perdent de la vie aussi
- implémenter le tir des satellites
- [DONE] implémenter un système de bonus (points, upgrade tir/satellites/... )
- implémenter un système d'amélioration de compétence de tirs (bullet -> mega bullet -> laser -> mega laser -> bomb -> etc.)
- implémenter un système d'animation du vaisseau (réacteurs par exemple)
- implémenter un système de boost des munitions si on garde le doigt appuyé sur la touche de laser
## Scenario
- implémenter un système de séquences avec des vagues de monstres qui arrivent les unes après les autres
- possibilité d'avoir dans les séquences:
o fond étoilé ou non
o niveau tiled ou non
o eventuellement choix d'un mode alternatif, du genre éviter les rochers
o sequence de monstres avec trajectoires
o boss de fin
o eventuelles récompenses/upgrades de vaisseau
## Bosses
- [DONE] Créer des bosses avec différentes zones, mobiles les unes par rapport aux autres
- [DONE] Créer des hitboxes pour chacune des zones du boss avec différentes sensibilités (par exemple le coeur/générateur = zone critique, mais mieux défendues)
- [DONE] Créer des protections pour certaines zones qui peuvent "sauter" (boucliers qui s'usent)
## Autres :
- [DONE] plein de trucs dont boss "multi-morceaux et multi-hitboxes"
- création de différents levels
- créations de différents ennemis
- créations de différents boss
o boss 1 : "rotating shield" avec multiples cannons
o boss 2 : "threwing saws"
o boss 3 : "Gun Crab"
o boss 4 : "Demoniac Snake"
o boss 5 : "Space Octopus"
o ...
o boss of the boss "Zgrog Master"
- création de séquences avec les boss (différentes phases)
- créations de différentes armes
- créations de différents bonus
- [DONE - CAN BE IMPROVED] créations de différents bonus
- création de shields pour se protéger
## Modes spéciaux
- mode menu avec différentes planètes à selectionner pour les différents niveaux
- mode hyperspace travel pour les transitions :
- sous mode : à la "Tie fighter" ?
- sous mode : éviter les astéroïdes
- sous mode classique shmup horizontal
- sous mode classique shmup vertical
- sous mode Danmaku / Bullet Hell (par exemple contre les boss)
## Interface :
- Page d'accueil
- Choix du niveau/séquence (un écran avec choix de planètes par exemple ou de galaxies)
- Ecran de titre
- transitions style "hyper space" serait vraiment cool
## Histoire (à peaufiner)
En tant de Space Marshall, votre rôle est de faire respecter
la loi intergalactique et de punir les contrevenants afin d'assurer
la paix et le bon vivre ensemble des différentes civilisations aliens
vivant dans votre zone de l'espace à surveiller.
Votre périmètre englobe le Grand Amas de RUZA-25f/s dans ons entièreté
et armé de votre vaisseau, vous devez aider les civilisations
locales en pourchassant et anéantissant les hordes de Zgrog.
Cette race alien robotique s'est donné pour but de coloniser les planètes
et les stations orbitales géantes afin d'y faire disparaître toute
vie organique.
C'est donc un combat sans relâche que de traquer et de détruire cet
envahisseur dénué d'âme.

File diff suppressed because one or more lines are too long

View File

@ -1,25 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.8" tiledversion="1.8.0" orientation="orthogonal" renderorder="right-down" width="102" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
<editorsettings>
<export target="Level1.json" format="json"/>
</editorsettings>
<map version="1.9" tiledversion="1.9.2" orientation="orthogonal" renderorder="right-down" width="90" height="14" tilewidth="16" tileheight="16" infinite="0" nextlayerid="3" nextobjectid="1">
<tileset firstgid="1" source="Tileset_Space.tsx"/>
<layer id="1" name="Calque de Tuiles 1" width="102" height="14">
<layer id="2" name="Background" width="90" height="14">
<data encoding="csv">
52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,
23,19,94,93,22,23,122,124,23,19,20,21,22,23,122,124,23,19,94,93,22,23,122,124,23,19,20,21,22,23,122,124,23,19,94,93,22,23,122,124,23,19,20,21,22,23,122,124,23,19,94,93,22,23,122,124,23,19,20,21,22,23,122,124,23,19,94,93,22,23,122,124,23,19,20,21,22,23,122,124,23,19,94,93,22,23,122,124,23,19,20,21,22,23,122,124,23,19,94,93,22,23,
50,102,82,83,103,50,0,0,50,28,29,30,31,50,0,0,50,102,82,83,103,50,0,0,50,28,29,30,31,50,0,0,50,102,82,83,103,50,0,0,50,28,29,30,31,50,0,0,50,102,82,83,103,50,0,0,50,28,29,30,31,50,0,0,50,102,82,83,103,50,0,0,50,28,29,30,31,50,0,0,50,102,82,83,103,50,0,0,50,28,29,30,31,50,0,0,50,102,82,83,103,50,
134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,0,0,134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,0,0,9,0,0,0,0,9,0,0,134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,0,0,134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,
134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,18,0,0,0,0,18,0,0,134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,
24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,9,0,0,0,0,9,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,0,0,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,
33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,18,0,0,0,0,18,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,
33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,9,0,0,0,0,9,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,0,0,33,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,
42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,18,0,0,0,0,18,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,0,0,42,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,
134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,9,0,0,0,0,9,0,0,134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,0,0,134,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,134,
134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,0,0,134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,0,0,18,0,0,0,0,18,0,0,134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,0,0,134,0,0,0,0,116,0,0,116,0,0,0,0,116,0,0,116,0,0,0,0,134,
23,93,82,83,94,23,0,0,23,37,38,39,40,23,0,0,23,93,82,83,94,23,0,0,23,37,38,39,40,23,0,0,23,93,82,83,94,23,0,0,23,37,38,39,40,23,0,0,23,93,82,83,94,23,0,0,23,37,38,39,40,23,0,0,23,93,82,83,94,23,0,0,23,37,38,39,40,23,0,0,23,93,82,83,94,23,0,0,23,37,38,39,40,23,0,0,23,93,82,83,94,23,
50,46,103,102,49,50,122,124,50,46,47,48,49,50,122,124,50,46,103,102,49,50,122,124,50,46,47,48,49,50,122,124,50,46,103,102,49,50,122,124,50,46,47,48,49,50,122,124,50,46,103,102,49,50,122,124,50,46,47,48,49,50,122,124,50,46,103,102,49,50,122,124,50,46,47,48,49,50,122,124,50,46,103,102,49,50,122,124,50,46,47,48,49,50,122,124,50,46,103,102,49,50,
52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53,52,53
0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,759,760,759,760,759,760,0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,759,760,759,760,759,760,0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,0,1310,0,1310,0,0,0,759,760,759,760,759,760,
0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,791,792,791,792,791,792,0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,791,792,791,792,791,792,0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,0,2003,2003,2003,0,0,0,791,792,791,792,791,792,
834,842,0,0,919,77,921,0,0,0,0,919,77,921,0,0,0,0,919,77,921,0,0,0,919,77,921,919,77,921,834,842,0,0,919,77,921,0,0,0,0,919,77,921,0,0,0,0,919,77,921,0,0,0,919,77,921,919,77,921,834,842,0,0,919,77,921,0,0,0,0,919,77,921,0,0,0,0,919,77,921,0,0,0,919,77,921,919,77,921,
0,810,0,0,919,77,921,601,601,877,0,919,77,921,0,601,601,0,919,77,921,0,601,601,919,77,921,919,77,921,0,810,0,0,919,77,921,601,601,877,0,919,77,921,0,601,601,0,919,77,921,0,601,601,919,77,921,919,77,921,0,810,0,0,919,77,921,601,601,877,0,919,77,921,0,601,601,0,919,77,921,0,601,601,919,77,921,919,77,921,
851,0,0,0,116,533,118,601,601,907,885,116,533,118,886,601,601,885,116,533,118,0,601,601,116,533,118,116,533,118,851,0,0,0,116,533,118,601,601,907,885,116,533,118,886,601,601,885,116,533,118,0,601,601,116,533,118,116,533,118,851,0,0,0,116,533,118,601,601,907,885,116,533,118,886,601,601,885,116,533,118,0,601,601,116,533,118,116,533,118,
627,628,629,630,308,213,310,601,0,629,630,308,213,310,627,628,629,630,308,213,310,0,601,0,308,213,310,308,213,310,627,628,629,630,308,213,310,601,0,629,630,308,213,310,627,628,629,630,308,213,310,0,601,0,308,213,310,308,213,310,627,628,629,630,308,213,310,601,0,629,630,308,213,310,627,628,629,630,308,213,310,0,601,0,308,213,310,308,213,310,
659,660,661,662,919,77,921,601,852,661,662,919,77,921,659,660,661,662,919,77,921,0,601,0,919,77,921,919,77,921,659,660,661,662,919,77,921,601,852,661,662,919,77,921,659,660,661,662,919,77,921,0,601,0,919,77,921,919,77,921,659,660,661,662,919,77,921,601,852,661,662,919,77,921,659,660,661,662,919,77,921,0,601,0,919,77,921,919,77,921,
691,692,693,694,919,77,921,691,692,819,0,919,77,921,691,692,693,694,919,77,921,0,601,0,919,77,921,919,77,921,691,692,693,694,919,77,921,691,692,819,0,919,77,921,691,692,693,694,919,77,921,0,601,0,919,77,921,919,77,921,691,692,693,694,919,77,921,691,692,819,0,919,77,921,691,692,693,694,919,77,921,0,601,0,919,77,921,919,77,921,
723,724,725,726,116,533,118,723,724,0,0,1371,0,1370,723,724,725,726,116,533,118,0,601,0,116,533,118,116,533,118,723,724,725,726,116,533,118,723,724,0,0,1371,0,1370,723,724,725,726,116,533,118,0,601,0,116,533,118,116,533,118,723,724,725,726,116,533,118,723,724,0,0,1371,0,1370,723,724,725,726,116,533,118,0,601,0,116,533,118,116,533,118,
918,0,0,917,308,213,310,918,0,0,620,621,0,618,619,0,0,917,308,213,310,0,0,0,308,213,310,308,213,310,918,0,0,917,308,213,310,918,0,0,620,621,0,618,619,0,0,917,308,213,310,0,0,0,308,213,310,308,213,310,918,0,0,917,308,213,310,918,0,0,620,621,0,618,619,0,0,917,308,213,310,0,0,0,308,213,310,308,213,310,
0,0,0,0,919,77,921,0,0,0,652,653,695,650,651,0,0,0,919,77,921,0,0,0,919,77,921,919,77,921,0,0,0,0,919,77,921,0,0,0,652,653,695,650,651,0,0,0,919,77,921,0,0,0,919,77,921,919,77,921,0,0,0,0,919,77,921,0,0,0,652,653,695,650,651,0,0,0,919,77,921,0,0,0,919,77,921,919,77,921,
0,0,0,0,919,77,921,0,0,811,0,0,727,0,0,810,0,0,919,77,921,0,0,0,919,77,921,919,77,921,0,0,0,0,919,77,921,0,0,811,0,0,727,0,0,810,0,0,919,77,921,0,0,0,919,77,921,919,77,921,0,0,0,0,919,77,921,0,0,811,0,0,727,0,0,810,0,0,919,77,921,0,0,0,919,77,921,919,77,921,
0,0,0,0,0,0,0,0,0,0,0,0,1497,0,0,0,0,0,0,0,0,0,0,0,541,542,509,510,542,543,0,0,0,0,0,0,0,0,0,0,0,0,1497,0,0,0,0,0,0,0,0,0,0,0,541,542,509,510,542,543,0,0,0,0,0,0,0,0,0,0,0,0,1497,0,0,0,0,0,0,0,0,0,0,0,541,542,509,510,542,543,
0,0,0,0,524,756,525,0,0,0,0,0,0,0,0,0,0,0,524,756,525,0,0,0,0,0,0,0,0,0,0,0,0,0,524,756,525,0,0,0,0,0,0,0,0,0,0,0,524,756,525,0,0,0,0,0,0,0,0,0,0,0,0,0,524,756,525,0,0,0,0,0,0,0,0,0,0,0,524,756,525,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="1" name="Foreground" width="90" height="14">
<data encoding="csv">
866,1986,1991,1971,976,1011,977,1971,741,742,1971,976,1011,977,1971,741,742,1971,976,1011,977,1971,1991,1972,0,0,0,0,0,0,866,1986,1991,1971,976,1011,977,1971,741,742,1971,976,1011,977,1971,741,742,1971,976,1011,977,1971,1991,1972,0,0,0,0,0,0,866,1986,1991,1971,976,1011,977,1971,741,742,1971,976,1011,977,1971,741,742,1971,976,1011,977,1971,1991,1972,0,0,0,0,0,0,
898,1986,1991,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,1991,1972,0,0,0,0,0,0,898,1986,1991,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,1991,1972,0,0,0,0,0,0,898,1986,1991,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,773,774,1974,1498,1497,1499,1973,1991,1972,0,0,0,0,0,0,
899,2018,2023,2020,0,0,0,2002,2003,2003,2020,0,0,0,2002,2003,2003,2020,0,0,0,2002,2023,2004,0,0,0,0,0,0,899,2018,2023,2020,0,0,0,2002,2003,2003,2020,0,0,0,2002,2003,2003,2020,0,0,0,2002,2023,2004,0,0,0,0,0,0,899,2018,2023,2020,0,0,0,2002,2003,2003,2020,0,0,0,2002,2003,2003,2020,0,0,0,2002,2023,2004,0,0,0,0,0,0,
612,908,874,877,0,0,0,908,874,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,908,874,877,0,0,0,908,874,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,612,908,874,877,0,0,0,908,874,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
644,0,908,907,0,0,0,0,908,0,877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,644,0,908,907,0,0,0,0,908,0,877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,644,0,908,907,0,0,0,0,908,0,877,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,1398,569,855,908,907,0,0,1398,569,855,854,569,1398,0,265,569,569,855,0,0,0,0,0,0,0,0,0,0,0,0,1398,569,855,908,907,0,0,1398,569,855,854,569,1398,0,265,569,569,855,0,0,0,0,0,0,0,0,0,0,0,0,1398,569,855,908,907,0,0,1398,569,855,854,569,1398,0,265,569,569,855,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,908,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,908,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,908,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,601,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,601,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,601,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,1398,855,0,0,0,5,6,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1398,855,0,0,0,5,6,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1398,855,0,0,0,5,6,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,535,207,537,810,0,0,0,0,0,1398,569,855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,535,207,537,810,0,0,0,0,0,1398,569,855,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,535,207,537,810,0,0,0,0,0,1398,569,855,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,852,0,0,0,0,0,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,0,0,0,0,0,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,852,0,0,0,0,0,842,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,265,819,0,0,0,811,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,265,819,0,0,0,811,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,265,819,0,0,0,811,265,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,37,38,6,38,39,0,0,0,0,265,0,0,0,0,37,38,6,38,39,0,0,0,0,0,0,0,0,0,0,0,37,38,6,38,39,0,0,0,0,265,0,0,0,0,37,38,6,38,39,0,0,0,0,0,0,0,0,0,0,0,37,38,6,38,39,0,0,0,0,265,0,0,0,0,37,38,6,38,39,0,0,0,0,0,0,0,0,
0,0,0,535,503,408,504,537,0,0,0,0,0,0,0,0,0,535,503,408,504,537,0,0,0,0,0,0,0,0,0,0,0,535,503,408,504,537,0,0,0,0,0,0,0,0,0,535,503,408,504,537,0,0,0,0,0,0,0,0,0,0,0,535,503,408,504,537,0,0,0,0,0,0,0,0,0,535,503,408,504,537,0,0,0,0,0,0,0,0
</data>
</layer>
</map>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.9" tiledversion="1.9.2" orientation="orthogonal" renderorder="right-down" width="96" height="30" tilewidth="16" tileheight="16" infinite="0" nextlayerid="4" nextobjectid="1">
<tileset firstgid="1" source="Tileset_Space.tsx"/>
<layer id="2" name="Background" width="96" height="30">
<data encoding="csv">
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,
918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,
0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,
0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,
886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,
883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,
917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,
885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,
884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,
918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,
0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,
0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,915,883,886,
886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,
883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,
917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,884,918,0,0,0,0,
885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,
884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,
918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,
0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,
0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,
886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,
883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,
917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,884,918,0,0,0,0,917,883,915,918,0,0,0,0,917,883,915,918,0,0,0,0,
885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,915,883,886,0,0,0,0,885,884,883,886,0,0,0,0,885,884,883,886,0,0,0,0,
915,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,915,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,915,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,915,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,884,918,917,883,886,0,0,885,
918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,918,0,0,917,883,886,885,884,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
</data>
</layer>
<layer id="1" name="Foreground" width="96" height="30">
<data encoding="csv">
1954,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1956,741,742,741,742,1954,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1956,741,742,741,742,1954,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1956,741,742,741,742,1954,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1956,741,742,741,742,
1986,1987,1990,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,1989,1987,1988,773,774,773,774,1986,1987,1990,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,1989,1987,1988,773,774,773,774,1986,1987,1990,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,1989,1987,1988,773,774,773,774,1986,1987,1990,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,1989,1987,1988,773,774,773,774,
2018,2019,2020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2018,2019,2020,1925,1926,1926,1927,2018,2019,2020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2018,2019,2020,1925,1926,1926,1927,2018,2019,2020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2018,2019,2020,1925,1926,1926,1927,2018,2019,2020,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2018,2019,2020,1925,1926,1926,1927,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,
0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,
0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,
0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,627,628,629,630,0,0,0,0,
659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,659,660,661,662,0,0,0,0,
691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,691,692,693,694,0,0,0,0,
723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,723,724,725,726,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
1954,1955,1956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1954,1955,1956,1925,1926,1926,1927,1954,1955,1956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1954,1955,1956,1925,1926,1926,1927,1954,1955,1956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1954,1955,1956,1925,1926,1926,1927,1954,1955,1956,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1954,1955,1956,1925,1926,1926,1927,
1986,1987,1958,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1957,1987,1988,741,742,741,742,1986,1987,1958,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1957,1987,1988,741,742,741,742,1986,1987,1958,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1957,1987,1988,741,742,741,742,1986,1987,1958,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1955,1957,1987,1988,741,742,741,742,
2018,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2020,773,774,773,774,2018,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2020,773,774,773,774,2018,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2020,773,774,773,774,2018,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2019,2020,773,774,773,774
</data>
</layer>
</map>

View File

@ -1,14 +0,0 @@
{ "columns":9,
"image":"tileset.png",
"imageheight":240,
"imagewidth":144,
"margin":0,
"name":"Level1_Tiles",
"spacing":0,
"tilecount":135,
"tiledversion":"1.8.0",
"tileheight":16,
"tilewidth":16,
"type":"tileset",
"version":"1.8"
}

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.8" tiledversion="1.8.0" name="Level1_Tiles" tilewidth="16" tileheight="16" tilecount="135" columns="9">
<image source="tileset.png" width="144" height="240"/>
<tileset version="1.8" tiledversion="1.8.0" name="Tileset_Space" tilewidth="16" tileheight="16" tilecount="2048" columns="32">
<image source="tileset.png" width="512" height="1024"/>
</tileset>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 138 KiB

Binary file not shown.

View File

@ -0,0 +1,5 @@
*.png:
type: bopti-image
name_regex: (.*)\.png img_\1
section: .data
profile: p8_rgb565a

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@ -0,0 +1,5 @@
*.png:
type: bopti-image
name_regex: (.*)\.png img_\1
section: .data
profile: p8_rgb565a

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1017 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,112 +0,0 @@
{ "frames": {
"asteroide1_12frames 0.ase": {
"frame": { "x": 0, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 1.ase": {
"frame": { "x": 32, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 2.ase": {
"frame": { "x": 64, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 3.ase": {
"frame": { "x": 96, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 4.ase": {
"frame": { "x": 128, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 5.ase": {
"frame": { "x": 160, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 6.ase": {
"frame": { "x": 192, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 7.ase": {
"frame": { "x": 224, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 8.ase": {
"frame": { "x": 256, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 9.ase": {
"frame": { "x": 288, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 10.ase": {
"frame": { "x": 320, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
},
"asteroide1_12frames 11.ase": {
"frame": { "x": 352, "y": 0, "w": 32, "h": 32 },
"rotated": false,
"trimmed": false,
"spriteSourceSize": { "x": 0, "y": 0, "w": 32, "h": 32 },
"sourceSize": { "w": 32, "h": 32 },
"duration": 100
}
},
"meta": {
"app": "https://github.com/LibreSprite/LibreSprite/",
"version": "1.0",
"image": "/home/sylvain/Programmes/Casio/shmup/assets-cg/Sprites/Rocks/asteroide1_12frames.png",
"format": "RGBA8888",
"size": { "w": 384, "h": 32 },
"scale": "1",
"frameTags": [
],
"layers": [
{ "name": "Layer 1", "opacity": 255, "blendMode": "normal" }
]
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

View File

@ -38,7 +38,7 @@ def convert_map(input, output, params, target):
structMap = fxconv.Structure()
structMap += fxconv.u32(w) + fxconv.u32(h)
structMap += fxconv.u32(w) + fxconv.u32(h) + fxconv.u32(nbTilelayer)
structMap += fxconv.ref(f"img_{nameTilesetFree}")
structMap += fxconv.u32(tileset_size)

View File

@ -1,4 +1,8 @@
*.png:
type: bopti-image
name_regex: (.*)\.png img_\1
profile: p8_rgb565a
milifont.png:
name: milifont_prop
type: font
charset: print
width: 3
grid.size: 3x5
grid.padding: 1
proportional: true

BIN
assets-cg/milifont.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

View File

@ -1,21 +0,0 @@
#ifndef MYAZURSHADERS_H
#define MYAZURSHADERS_H
#include "starfield.h"
#include <vector>
void azrp_pixel(int x1, int y1, int color);
void azrp_pixellist(std::vector<Pixel*> const &list, int fragnum );
#define SHOW_PIXELS 1
#define SHOW_STARS 2
void azrp_starfield( void );
void azrp_starfield_init( uint8_t nbstars );
void azrp_starfield_close( void );
void azrp_starfield_USBDEBUG( uint8_t info );
#endif //MYAZURSHADERS_H

View File

@ -1,51 +0,0 @@
#include "background.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
extern struct Map map_Level1;
Background::Background( )
{
}
Background::~Background( )
{
}
void Background::Render( void )
{
int x0 = (int) xlevel;
int shifttile = (int) (16*xlevel.frac());
for(int i=0; i<=25; i++)
{
for(int j=0; j<14; j++)
{
uint16_t index = j * map_Level1.w + (x0+i)%25;
uint16_t currentTile = map_Level1.layers[ index ];
if (currentTile!=0)
{
uint16_t xtile = ((currentTile % 9)-1) * 16;
uint16_t ytile = (currentTile / 9) * 16;
azrp_subimage_p8( i*16-shifttile, j*16, map_Level1.tileset, xtile, ytile, 16, 16, DIMAGE_NONE );
}
}
}
}
void Background::Update( float dt )
{
libnum::num a = libnum::num( dt / 18000.0f );
xlevel += a;
}

View File

@ -1,80 +0,0 @@
#include "bullet.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
extern bopti_image_t img_bullet_normal;
extern bopti_image_t img_bullet_blue;
extern bopti_image_t img_bullet_laser;
Bullet::Bullet( uint16_t lx, uint16_t ly, uint8_t id )
{
x = libnum::num( lx );
y = libnum::num( ly );
ID=id;
if (ID==0)
{
sx = libnum::num( 6 );
sy = 0;
strength = 5;
}
else if (ID==1)
{
sx = libnum::num( 3 );
sy = 0;
strength = 2;
}
else if (ID==2)
{
sx = libnum::num( 3 );
sy = 0;
strength = 1;
}
toberemoved = false;
}
Bullet::~Bullet()
{
}
void Bullet::Update( float dt )
{
libnum::num a = libnum::num( dt / 12000.0f );
x += sx * a;
y += sy * a;
if (x<-10 || x>azrp_width+10 || y<-10 || y>azrp_height+10) toberemoved=true;
}
void Bullet::Render( )
{
uint16_t px = (int) x;
uint16_t py = (int) y;
if (ID==0)
{
azrp_image_p8( px-img_bullet_normal.width/2, py-img_bullet_normal.height/2, &img_bullet_normal, DIMAGE_NONE );
return;
}
else if (ID==1)
{
azrp_image_p8( px-img_bullet_blue.width/2, py-img_bullet_blue.height/2, &img_bullet_blue, DIMAGE_NONE );
return;
}
else if (ID==2)
{
azrp_image_p8( px-img_bullet_laser.width/2, py-img_bullet_laser.height/2, &img_bullet_laser, DIMAGE_NONE );
return;
}
}

12
src/config.h Normal file
View File

@ -0,0 +1,12 @@
#ifndef CONFIG_H
#define CONFIG_H
#define DEBUG_MODE 0
#define USB 0
#define MORE_RAM 1
#define CALCEMU 1
#endif

View File

@ -1,105 +0,0 @@
#include "enemy.h"
#include "bullet.h"
#include <num/num.h>
extern bopti_image_t img_mainship2;
extern bopti_image_t img_Enemy_Blue_Lvl1;
extern bopti_image_t img_Enemy_Red_Lvl1;
Enemy::Enemy( int16_t _x, int16_t _y, uint8_t _id )
{
x = libnum::num( _x );
y = libnum::num( _y );
dirx = 1;
diry = -6;
ID = _id;
if (ID==0)
{
width = img_mainship2.width/2;
height = img_mainship2.height/2;
speed = 1;
}
else if (ID==1)
{
width = img_Enemy_Blue_Lvl1.width/2;
height = img_Enemy_Blue_Lvl1.height/2;
speed = 2;
}
else if (ID==2)
{
width = img_Enemy_Red_Lvl1.width/2;
height = img_Enemy_Red_Lvl1.height/2;
speed = 2;
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
toberemoved = false;
if (ID==0) life = 400;
else if (ID==1) life = 200;
else if (ID==2) life = 100;
}
Enemy::~Enemy()
{
if (hasTrajectory)
delete(pathToFollow);
}
void Enemy::Update( float dt )
{
if (!hasTrajectory)
{
libnum::num a = libnum::num( dt / 60000.0f );
x += a * libnum::num( dirx * speed );
y += a * libnum::num( diry * speed );
if (x<width || x>azrp_width-width) dirx=-1*dirx;
if (y<height || y>azrp_height-height) diry=-1*diry;
}
else
{
pathToFollow->CalculatePosition( dt, speed, true, &x, &y );
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
if (life<=0) toberemoved=true;
}
void Enemy::Render( void )
{
if (ID==0) azrp_image_p8_effect(xmin, ymin, &img_mainship2, DIMAGE_NONE);
if (ID==1) azrp_image_p8_effect(xmin, ymin, &img_Enemy_Blue_Lvl1, DIMAGE_NONE);
if (ID==2) azrp_image_p8_effect(xmin, ymin, &img_Enemy_Red_Lvl1, DIMAGE_NONE);
}
bool Enemy::Test_Impact( Bullet *projectile )
{
if (projectile->x >= xmin && projectile->x <= xmax && projectile->y >= ymin && projectile->y <= ymax )
{
life -= projectile->strength;
projectile->toberemoved = true;
return true;
}
else return false;
}
void Enemy::Set_Speed_Vector( uint8_t _sp, uint8_t _xd, uint8_t _yd)
{
speed = _sp;
dirx = _xd;
diry = _yd;
}

View File

@ -1,45 +0,0 @@
#ifndef ENEMY_H
#define ENEMY_H
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include "bullet.h"
#include "trajectory.h"
class Enemy
{
public:
Enemy( int16_t _x, int16_t _y, uint8_t _id );
~Enemy();
void Update( float dt );
void Render( void );
bool Test_Impact( Bullet *projectile );
void Set_Speed_Vector( uint8_t _sp, uint8_t _xd, uint8_t _yd);
libnum::num x, y; // center position of the ennemy
uint8_t width, height; // width and height -for the hitbox
int16_t xmin, xmax, ymin, ymax; // square hitbox (to speed up the bullet impact calculations)
uint8_t ID;
int16_t life;
uint8_t speed; // speed of this ennemy
bool toberemoved;
bool hasTrajectory = false;
Trajectory *pathToFollow;
private:
int8_t dirx, diry; // vector of the current direction of the ennemy (TODO : to implement more complex displacement pattern)
};
#endif

View File

@ -1,4 +1,4 @@
#define DEBUG_MODE 1
#include "config.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
@ -6,13 +6,17 @@
#include <gint/rtc.h>
#include <gint/clock.h>
#include <gint/kmalloc.h>
#include <gint/keyboard.h>
#if(MORE_RAM)
#include <gint/kmalloc.h>
#endif
#include <libprof.h>
#include <gint/usb.h>
#include <gint/usb-ff-bulk.h>
#if(USB)
#include <gint/usb.h>
#include <gint/usb-ff-bulk.h>
#endif
#include <stdio.h>
#include <string.h>
@ -22,24 +26,29 @@
#include <num/num.h>
#include "collections.h"
#include "utilities/fast_trig.h"
#include "utilities/extrakeyboard.h"
#include "utilities/utilities.h"
#include "shmup/collections.h"
#include "player.h"
#include "utilities.h"
#include "particles.h"
#include "bullet.h"
#include "enemy.h"
#include "MyAzurShaders.h"
#include "impact.h"
#include "background.h"
#include "shaders/MyAzurShaders.h"
#include "trajectory.h"
#include "shmup/player.h"
#include "shmup/particles.h"
#include "shmup/bullet.h"
#include "shmup/enemy.h"
#include "shmup/bonus.h"
#include "shmup/impact.h"
#include "shmup/background.h"
#include "shmup/boss.h"
#include "shmup/trajectory.h"
#include <vector>
#include <algorithm>
#include "extrakeyboard.h"
bool screenshot = false;
@ -59,62 +68,67 @@ uint8_t texttodraw=1;
float elapsedTime = 0.0f;
uint32_t time_update=0, time_render=0;
uint32_t time_update=0, time_render=0;
prof_t perf_update, perf_render;
static kmalloc_arena_t extended_ram = { 0 };
static kmalloc_arena_t *_uram;
kmalloc_gint_stats_t *_uram_stats;
kmalloc_gint_stats_t *extram_stats;
#if(MORE_RAM)
static kmalloc_arena_t extended_ram = { 0 };
static kmalloc_arena_t *_uram;
kmalloc_gint_stats_t *_uram_stats;
kmalloc_gint_stats_t *extram_stats;
#endif
std::vector<Particle*> MyParticles;
std::vector<Bullet*> MyPlayerBullets;
std::vector<Bullet*> MyEnemiesBullets;
std::vector<Enemy*> MyEnemies;
std::vector<Impact*> MyImpacts;
std::vector<Bonus*> MyBonuses;
std::vector<Trajectory*> MyTrajectories;
Background MyBackground;
Starfield *MyStarField;
Player *MyPlayer;
Boss *MyBoss;
KeyboardExtra MyKeyboard;
static void hook_prefrag(int id, void *fragment, int size)
{
if(!screenshot && !record)
return;
/* Screenshot takes precedence */
char const *type = screenshot ? "image" : "video";
#if(USB)
static void hook_prefrag(int id, void *fragment, int size)
{
if(!screenshot && !record)
return;
int pipe = usb_ff_bulk_output();
if(id == 0) {
usb_fxlink_header_t h;
usb_fxlink_image_t sh;
int size = azrp_width * azrp_height * 2;
/* Screenshot takes precedence */
char const *type = screenshot ? "image" : "video";
usb_fxlink_fill_header(&h, "fxlink", type, size + sizeof sh);
sh.width = htole32(azrp_width);
sh.height = htole32(azrp_height);
sh.pixel_format = htole32(USB_FXLINK_IMAGE_RGB565);
int pipe = usb_ff_bulk_output();
usb_write_sync(pipe, &h, sizeof h, 4, false);
usb_write_sync(pipe, &sh, sizeof sh, 4, false);
if(id == 0) {
usb_fxlink_header_t h;
usb_fxlink_image_t sh;
int size = azrp_width * azrp_height * 2;
usb_fxlink_fill_header(&h, "fxlink", type, size + sizeof sh);
sh.width = htole32(azrp_width);
sh.height = htole32(azrp_height);
sh.pixel_format = htole32(USB_FXLINK_IMAGE_RGB565);
usb_write_sync(pipe, &h, sizeof h, false);
usb_write_sync(pipe, &sh, sizeof sh, false);
}
usb_write_sync(pipe, fragment, size, false);
if(id == azrp_frag_count - 1) {
usb_commit_sync(pipe);
screenshot = false;
}
}
usb_write_sync(pipe, fragment, size, 4, false);
if(id == azrp_frag_count - 1) {
usb_commit_sync(pipe);
screenshot = false;
}
}
#endif
static void update( float dt )
{
@ -122,11 +136,10 @@ static void update( float dt )
MyPlayer->Update( dt );
for(unsigned int i=0; i<MyImpacts.size(); i++)
{
MyImpacts[i]->Update( dt );
// Check if the property toberemoved has been set to "true" for particle deletion
if (MyImpacts[i]->toberemoved == true)
{
@ -138,14 +151,37 @@ static void update( float dt )
for(unsigned int i=0; i<MyEnemies.size(); i++)
{
MyEnemies[i]->Update( dt );
// Check if there is a collision with the current enemy
//MyPlayer->Test_Collision( MyEnemies[i] );
// Check if the property toberemoved has been set to "true" for particle deletion
if (MyEnemies[i]->toberemoved == true)
{
Bonus *b = new Bonus( (int) MyEnemies[i]->x, (int) MyEnemies[i]->y, rand() % 2 );
MyBonuses.push_back( b );
Create_Explosion( (int) MyEnemies[i]->x, (int) MyEnemies[i]->y );
delete( MyEnemies[i] );
MyEnemies.erase( MyEnemies.begin() + i );
}
}
if (MyBoss!=nullptr)
{
MyBoss->Update( dt );
if (MyBoss->toberemoved == true)
{
Bonus *b = new Bonus( (int) MyBoss->x, (int) MyBoss->y, rand() % 2 );
MyBonuses.push_back( b );
Create_Explosion( (int) MyBoss->x, (int) MyBoss->y );
delete( MyBoss );
MyBoss=nullptr;
}
}
for(unsigned int i=0; i<MyParticles.size(); i++)
@ -160,7 +196,6 @@ static void update( float dt )
}
}
for(unsigned int i=0; i<MyPlayerBullets.size(); i++)
{
MyPlayerBullets[i]->Update( dt );
@ -174,6 +209,14 @@ static void update( float dt )
}
}
if (MyBoss)
if(MyBoss->Test_Impact(MyPlayerBullets[i])==true)
{
//TODO : we can create a list of impacts here, to be rendered later on
Create_Impact( (int) MyPlayerBullets[i]->x, (int) MyPlayerBullets[i]->y );
}
// Check if the property toberemoved has been set to "true" for particle deletion
if (MyPlayerBullets[i]->toberemoved == true)
{
@ -182,6 +225,42 @@ static void update( float dt )
}
}
for(unsigned int i=0; i<MyEnemiesBullets.size(); i++)
{
MyEnemiesBullets[i]->Update( dt );
if(MyPlayer->Test_Impact(MyEnemiesBullets[i])==true)
{
Create_Impact( (int) MyEnemiesBullets[i]->x, (int) MyEnemiesBullets[i]->y );
}
// Check if the property toberemoved has been set to "true" for particle deletion
if (MyEnemiesBullets[i]->toberemoved == true)
{
delete( MyEnemiesBullets[i] );
MyEnemiesBullets.erase( MyEnemiesBullets.begin() + i );
}
}
for(unsigned int i=0; i<MyBonuses.size(); i++)
{
MyBonuses[i]->Update( dt );
if (MyPlayer->Test_Impact(MyBonuses[i]) == true)
{
// TODO : put stuff to highlight the bonus
}
if (MyBonuses[i]->toberemoved == true)
{
delete( MyBonuses[i] );
MyBonuses.erase( MyBonuses.begin() + i );
}
}
MyBackground.Update( dt );
}
@ -194,37 +273,47 @@ static void render( void )
{
if (drawstars) azrp_starfield();
if (drawback) MyBackground.Render( );
for(auto& b : MyPlayerBullets)
b->Render();
for(auto& b : MyEnemiesBullets)
b->Render();
for(auto& e : MyEnemies)
e->Render();
if (MyBoss!=nullptr)
MyBoss->Render();
for( auto& i : MyImpacts)
i->Render();
for(auto& p : MyParticles)
p->Render();
for(auto& b : MyBonuses)
b->Render();
MyPlayer->Render();
#if(BIAS)
if (texttodraw>=1) Azur_draw_text(1,01, "FPS = %.0f", (float) (1000000.0f / elapsedTime) );
if (texttodraw>=1) Azur_draw_text(1,11, "Part.= %d - Bull.= %d", MyParticles.size(), MyPlayerBullets.size() );
if (texttodraw>=1 && !MyEnemies.empty()) Azur_draw_text(1,21, "Ennmy Life= %d", MyEnemies[0]->life );
if (texttodraw>=2) Azur_draw_text(1,31, "Update = %.0f mc secs", (float) time_update );
if (texttodraw>=2) Azur_draw_text(1,41, "Render = %.0f mc secs", (float) time_render );
if (texttodraw>=2) Azur_draw_text(1,51, ">Total = %.3f ml secs", (float) elapsedTime / 1000.0f );
if (texttodraw>=2) Azur_draw_text(1,61, ">Total = %.0f seconds", (float) elapsedTime );
if (texttodraw>=3) Azur_draw_text(1,81, "Mem Used : %d", _uram_stats->used_memory + extram_stats->used_memory);
if (texttodraw>=3) Azur_draw_text(1,91, "Mem Free : %d", _uram_stats->free_memory + extram_stats->free_memory);
if (texttodraw>=3) Azur_draw_text(1,101, "Mem Peak Used : %d", _uram_stats->peak_used_memory + extram_stats->peak_used_memory );
//if (texttodraw>=1) Azur_draw_text(1,11, "Part.= %d - Bull.= %d", MyParticles.size(), MyPlayerBullets.size() );
//if (texttodraw>=1 && !MyEnemies.empty()) Azur_draw_text(1,21, "Ennmy Life= %d", MyEnemies[0]->life );
if (texttodraw>=2) Azur_draw_text(1,31, "Update = %.3f ms", (float) time_update / 1000.0f );
if (texttodraw>=2) Azur_draw_text(1,41, "Render = %.3f ms", (float) time_render / 1000.0f );
if (texttodraw>=2) Azur_draw_text(1,51, ">Total = %.0f ms", (float) elapsedTime / 1000.0f );
#if(MORE_RAM)
if (texttodraw>=3) Azur_draw_text(1,81, "Mem Used : %d", _uram_stats->used_memory + extram_stats->used_memory);
if (texttodraw>=3) Azur_draw_text(1,91, "Mem Free : %d", _uram_stats->free_memory + extram_stats->free_memory);
if (texttodraw>=3) Azur_draw_text(1,101, "Mem Peak Used : %d", _uram_stats->peak_used_memory + extram_stats->peak_used_memory );
#endif
#endif
}
@ -232,43 +321,47 @@ static void render( void )
static void get_inputs( float dt )
{
uint8_t speed = 4;
uint32_t tempshoot = rtc_ticks();
if(MyKeyboard.IsKeyPressed(MYKEY_F1))
{
if (MyPlayer->Shoot_OK(tempshoot, 0)) Create_Player_Shoot(0);
if (MyPlayer->Shoot_OK(tempshoot, BULLET_NORMAL)) Create_Player_Shoot(0);
}
if(MyKeyboard.IsKeyPressed(MYKEY_F2))
{
if (MyPlayer->Shoot_OK(tempshoot, 1)) Create_Player_Shoot(1);
if (MyPlayer->Shoot_OK(tempshoot, BULLET_BLUE)) Create_Player_Shoot(1);
}
if(MyKeyboard.IsKeyPressedEvent(MYKEY_F3))
{
if (MyPlayer->Shoot_OK(tempshoot, 2)) Create_Player_Shoot(2);
if (MyPlayer->Shoot_OK(tempshoot, BULLET_LASER)) Create_Player_Shoot(2);
}
if (MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyHoldPressed(MYKEY_EXIT)) {exitToOS = true; };
#if(DEBUG_MODE)
if(MyKeyboard.IsKeyPressedEvent(MYKEY_7) && usb_is_open() ) {screenshot = true;};
if(MyKeyboard.IsKeyPressedEvent(MYKEY_8) && usb_is_open()) {record = true; };
if(MyKeyboard.IsKeyPressedEvent(MYKEY_9) && usb_is_open()) {record = false; };
if(MyKeyboard.IsKeyPressedEvent(MYKEY_DEL) && usb_is_open()) {textoutput = true;};
#endif
#if(USB)
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_7) && usb_is_open() ) {screenshot = true;};
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_8) && usb_is_open()) {record = true; };
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_9) && usb_is_open()) {record = false; };
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_DEL) && usb_is_open()) {textoutput = true;};
#endif
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_F1)) {texttodraw=0;}
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_F2)) {texttodraw=1;}
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_F3)) {texttodraw=2;}
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_F4)) {texttodraw=3;}
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_F5))
{
drawback = !drawback;
drawstars = ! drawstars;
}
if(MyKeyboard.IsKeyPressed(MYKEY_SHIFT) && MyKeyboard.IsKeyPressedEvent(MYKEY_F6))
{
azrp_starfield_close( );
azrp_starfield_init( 250 );
}
}
if(MyKeyboard.IsKeyPressed(MYKEY_LEFT)) { MyPlayer->Go_Left( dt ); }
if(MyKeyboard.IsKeyPressed(MYKEY_RIGHT)) { MyPlayer->Go_Right( dt ); }
@ -280,90 +373,160 @@ static void get_inputs( float dt )
bool AddMoreRAM( void )
{
/* allow more RAM */
char const *osv = (char*) 0x80020020;
#if(MORE_RAM && !CALCEMU)
/* allow more RAM */
char const *osv = (char*) 0x80020020;
if((!strncmp(osv, "03.", 3) && osv[3] <= '6') && gint[HWCALC] == HWCALC_FXCG50) // CG-50
{
extended_ram.name = "extram";
extended_ram.is_default = true;
extended_ram.start = (void *)0x8c200000;
extended_ram.end = (void *)0x8c4e0000 ;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
return true;
}
else if (gint[HWCALC] == HWCALC_PRIZM) // CG-10/20
{
extended_ram.name = "extram";
extended_ram.is_default = true;
uint16_t *vram1, *vram2;
dgetvram(&vram1, &vram2);
dsetvram(vram1, vram1);
extended_ram.start = vram2;
extended_ram.end = (char *)vram2 + 396*224*2;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
return false;
}
else if (gint[HWCALC] == HWCALC_FXCG_MANAGER) // CG-50 EMULATOR
{
extended_ram.name = "extram";
extended_ram.is_default = true;
extended_ram.start = (void *)0x88200000;
extended_ram.end = (void *)0x884e0000 ;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
return true;
}
#elif (MORE_RAM && CALCEMU)
if((!strncmp(osv, "03.", 3) && osv[3] <= '6') && gint[HWCALC] == HWCALC_FXCG50) // CG-50
{
extended_ram.name = "extram";
extended_ram.is_default = true;
extended_ram.start = (void *)0x8c200000;
extended_ram.end = (void *)0x8c500000 ;
extended_ram.end = (void *)0x8c4e0000 ;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
return true;
}
else if (gint[HWCALC] == HWCALC_PRIZM) // CG-10/20
{
extended_ram.name = "extram";
extended_ram.is_default = true;
#else
uint16_t *vram1, *vram2;
dgetvram(&vram1, &vram2);
dsetvram(vram1, vram1);
extended_ram.start = vram2;
extended_ram.end = (char *)vram2 + 396*224*2;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
return false;
}
else if (gint[HWCALC] == HWCALC_FXCG_MANAGER) // CG-50 EMULATOR
{
#endif
extended_ram.name = "extram";
extended_ram.is_default = true;
extended_ram.start = (void *)0x88200000;
extended_ram.end = (void *)0x88500000 ;
kmalloc_init_arena(&extended_ram, true);
kmalloc_add_arena(&extended_ram );
return true;
}
return false;
}
void FreeMoreRAM( void )
{
memset(extended_ram.start, 0, (char *)extended_ram.end - (char *)extended_ram.start);
#if(MORE_RAM)
memset(extended_ram.start, 0, (char *)extended_ram.end - (char *)extended_ram.start);
#endif
}
/*
#define DBGCRSH 1
#include <gint/keyboard.h>
int a=0;
void debug_crash( int value )
{
dprint( 1, 1+a*10, C_BLACK, "point = %d : REACHED", value );
a++;
dupdate();
getkey();
}
extern bopti_image_t img_Enemy_Red_Lvl1;
void debug_crash_msg( char *chain )
{
dprint( 1, 1+a*10, C_BLACK, "point = %s : REACHED", chain );
a++;
dupdate();
getkey();
}
*/
int main(void)
{
exitToOS = false;
#if(MORE_RAM)
_uram = kmalloc_get_arena("_uram");
#endif
_uram = kmalloc_get_arena("_uram");
bool canWeAllocate3Mb = AddMoreRAM();
bool canWeAllocateMoreRam = AddMoreRAM();
__printf_enable_fp();
__printf_enable_fixed();
azrp_config_scale(SCALE_PIXEL);
azrp_shader_clear_configure();
azrp_shader_image_rgb16_configure();
azrp_shader_image_p8_configure();
azrp_shader_image_p4_configure();
azrp_hook_set_prefrag(hook_prefrag);
#if(USB)
azrp_hook_set_prefrag(hook_prefrag);
#endif
azrp_starfield_init( 250 );
Create_Ennemies( );
Create_Enemies( );
MyPlayer = new Player( azrp_width/4, azrp_height/2, 0);
/*
MyBoss = new Boss( 3*azrp_width/4, azrp_height/2, 0);
Point2D *A = new Point2D( 348, 112 );
Point2D *B = new Point2D( 371, 199 );
Point2D *C = new Point2D( 198, 149 );
Point2D *D = new Point2D( 25, 199 );
Point2D *E = new Point2D( 25, 25 );
Point2D *F = new Point2D( 198, 75 );
Point2D *G = new Point2D( 371, 25 );
Trajectory *MyTrajectory= new Trajectory();
MyTrajectory->AddPoint( A );
MyTrajectory->AddPoint( B );
MyTrajectory->AddPoint( C );
MyTrajectory->AddPoint( D );
MyTrajectory->AddPoint( E );
MyTrajectory->AddPoint( F );
MyTrajectory->AddPoint( G );
MyBoss->hasTrajectory = true;
MyBoss->pathToFollow = MyTrajectory;
*/
/*
#if(DBGCRSH)
debug_crash( 1 );
#endif
*/
#if(USB)
usb_interface_t const *interfaces[] = { &usb_ff_bulk, NULL };
usb_open(interfaces, GINT_CALL_NULL);
#endif
prof_init();
@ -383,8 +546,10 @@ int main(void)
update( elapsedTime );
// update the RAM consumption status
_uram_stats = kmalloc_get_gint_stats(_uram);
extram_stats = kmalloc_get_gint_stats(&extended_ram);
#if(MORE_RAM)
_uram_stats = kmalloc_get_gint_stats(_uram);
extram_stats = kmalloc_get_gint_stats(&extended_ram);
#endif
}
prof_leave(perf_update);
@ -399,7 +564,8 @@ int main(void)
render();
azrp_update();
azrp_update();
}
prof_leave(perf_render);
@ -407,12 +573,17 @@ int main(void)
elapsedTime = ((float) (time_update+time_render));
#if(DEBUG_MODE)
#if(DEBUG_MODE && USB)
if (textoutput && usb_is_open())
{
// to add here what must be sent to USB for Text mode debugging
char texttosend[1024];
sprintf( texttosend, "%s", "Hello !!!" );
usb_fxlink_text(texttosend, 0);
textoutput = false;
}
#endif
@ -423,14 +594,21 @@ int main(void)
Clean_Everything();
// TODO - make it clean for the future
delete( MyBoss );
delete( MyPlayer );
azrp_starfield_close( );
prof_quit();
#if(USB)
usb_close();
#endif
FreeMoreRAM( );
if (canWeAllocateMoreRam) FreeMoreRAM( );
return 1;
}

View File

@ -1,21 +0,0 @@
#include "point2D.h"
Point2D::Point2D( )
{
x = libnum::num( 0 );
y = libnum::num( 0 );
}
Point2D::Point2D( int16_t _x, int16_t _y )
{
x = libnum::num( _x );
y = libnum::num( _y );
}
Point2D::~Point2D( )
{
}

View File

@ -1,19 +0,0 @@
#ifndef POINT2D_H
#define POINT2D_H
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
class Point2D
{
public:
libnum::num x, y;
Point2D( );
Point2D( int16_t _x, int16_t _y );
~Point2D( );
};
#endif

View File

@ -0,0 +1,39 @@
#ifndef MYAZURSHADERS_H
#define MYAZURSHADERS_H
#include <vector>
#define SHOW_PIXELS 1
#define SHOW_STARS 2
void azrp_starfield( void );
void azrp_starfield_init( uint8_t nbstars );
void azrp_starfield_close( void );
void azrp_shader_line_configure(void);
void azrp_shader_circle_configure(void);
void azrp_shader_filledcircle_configure(void);
void azrp_shader_filledpoly_configure(void);
void azrp_shader_poly_configure(void);
/* azrp_line(): Draw a line with clipping to the screen resolution between point (x1,y1) and (x2,y2) */
void azrp_line( int x1, int y1, int x2, int y2, uint16_t color );
/* azrp_circle() : Draw a circle with clipping to the screen resolution with a center (xc,yc) and a radius rad */
void azrp_circle( int xc, int yx, uint16_t rad, uint16_t color );
/* azrp_filledcircle() : Draw a filled circle with clipping to the screen resolution with a center (xc,yc) and a radius rad */
void azrp_filledcircle( int xc, int yx, uint16_t rad, uint16_t color );
/* azrp_poly() : Draw a polygon with clipping*/
void azrp_poly(int *x, int *y, int nb_vertices, uint16_t color);
/* azrp_filledpoly() : Draw a filled polygon with clipping*/
void azrp_filledpoly(int *x, int *y, int nb_vertices, uint16_t color);
#endif //MYAZURSHADERS_H

147
src/shaders/circle.cpp Normal file
View File

@ -0,0 +1,147 @@
#include <azur/gint/render.h>
uint8_t AZRP_SHADER_CIRCLE = -1;
static void azrp_shader_circle_configure(void)
{
azrp_set_uniforms(AZRP_SHADER_CIRCLE, (void *)azrp_width);
}
__attribute__((constructor))
static void register_shader(void)
{
extern azrp_shader_t azrp_shader_circle;
AZRP_SHADER_CIRCLE = azrp_register_shader(azrp_shader_circle, azrp_shader_circle_configure);
}
static int min(int x, int y)
{
return (x < y) ? x : y;
}
static int max(int x, int y)
{
return (x > y) ? x : y;
}
//---
#define TABLE_WIDTH 256
struct command {
uint8_t shader_id;
uint16_t color;
uint8_t curr_frag;
uint16_t NbPixels[14]; // Nunmber of pixels in each fragment
uint16_t DataPixelsX[14*TABLE_WIDTH]; // 14 fragments each able to store as much pixels as width
uint16_t DataPixelsY[14*TABLE_WIDTH]; // 14 fragments each able to store as much pixels as width
};
void AddPixelCircle( int16_t xp, int16_t yp, struct command *cmd )
{
if (xp >= 0 && xp < azrp_width && yp >= 0 && yp < azrp_height)
{
uint8_t cfrag = yp / azrp_frag_height;
uint16_t nbpixinfrag = cmd->NbPixels[ cfrag ];
uint16_t index = cfrag * TABLE_WIDTH + nbpixinfrag;
cmd->DataPixelsX[ index ] = xp;
cmd->DataPixelsY[ index ] = yp & 15;
cmd->NbPixels[ cfrag ]++;
}
}
void azrp_circle(int xc, int yc, uint16_t rad, uint16_t color)
{
prof_enter(azrp_perf_cmdgen);
int xmin = xc - rad;
int xmax = xc + rad;
int ymin = yc - rad;
int ymax = yc + rad;
// The circle is fully outside the screen
if ((xmax < 0) || (xmin >= azrp_width) || (ymax < 0) || (ymin >= azrp_height))
{
prof_leave(azrp_perf_cmdgen);
return;
}
int ytop = max( ymin, 0 );
int ybot = min( ymax, azrp_height-1 );
int frag_first = ytop / azrp_frag_height;
int frag_last = ybot / azrp_frag_height;
int frag_count = frag_last - frag_first + 1;
struct command *cmd = (struct command *) azrp_new_command(sizeof *cmd, frag_first, frag_count);
if(!cmd) {
prof_leave(azrp_perf_cmdgen);
return;
}
cmd->shader_id = AZRP_SHADER_CIRCLE;
cmd->color = color;
cmd->curr_frag = frag_first;
// reset the point counters in each cell of the table
for( int i = 0; i < 14; i++ )
cmd->NbPixels[i]=0;
int x = 0;
int y = rad;
int m = 5 - 4*rad;
while (x <= y)
{
AddPixelCircle( xc+x, yc+y, cmd );
AddPixelCircle( xc+y, yc+x, cmd );
AddPixelCircle( xc-x, yc+y, cmd );
AddPixelCircle( xc-y, yc+x, cmd );
AddPixelCircle( xc+x, yc-y, cmd );
AddPixelCircle( xc+y, yc-x, cmd );
AddPixelCircle( xc-x, yc-y, cmd );
AddPixelCircle( xc-y, yc-x, cmd );
if (m > 0)
{
y--;
m -= 8*y;
}
x++;
m += 8*x + 4;
}
prof_leave(azrp_perf_cmdgen);
}
void azrp_shader_circle( void *uniforms, void *comnd, void *fragment )
{
struct command *cmd = (struct command *) comnd;
uint16_t *frag = (uint16_t *) fragment;
uint16_t *taille = (uint16_t *) cmd->NbPixels;
uint16_t *DX = (uint16_t *) cmd->DataPixelsX;
uint16_t *DY = (uint16_t *) cmd->DataPixelsY;
uint16_t nbpix = taille[ cmd->curr_frag ];
int BaseAdress = cmd->curr_frag * TABLE_WIDTH;
for( int i = 0; i < nbpix; i++ )
{
uint16_t X = DX[ BaseAdress + i ];
uint16_t Y = DY[ BaseAdress + i ];
frag[ azrp_width * Y + X ] = cmd->color;
}
cmd->curr_frag++;
}

View File

@ -0,0 +1,124 @@
#include <azur/gint/render.h>
uint8_t AZRP_SHADER_FILLEDCIRCLE = -1;
static void azrp_shader_filledcircle_configure(void) {
azrp_set_uniforms(AZRP_SHADER_FILLEDCIRCLE, (void *)azrp_width);
}
__attribute__((constructor)) static void register_shader(void) {
extern azrp_shader_t azrp_shader_filledcircle;
AZRP_SHADER_FILLEDCIRCLE = azrp_register_shader(azrp_shader_filledcircle, azrp_shader_filledcircle_configure);
}
static int min(int x, int y) { return (x < y) ? x : y; }
static int max(int x, int y) { return (x > y) ? x : y; }
//---
#define TABLE_WIDTH
struct command {
uint8_t shader_id;
uint16_t color;
uint8_t curr_frag;
int16_t DataFilling[2 * 224]; // Each line of the screen can have a xmin and
// a xmax value
};
void AddPixelFilledCircle(int16_t xpmin, int16_t xpmax, int16_t yp,
struct command *cmd) {
if (yp >= 0 && yp < azrp_height) {
if (xpmin >= 0)
cmd->DataFilling[2 * yp] = xpmin;
else
cmd->DataFilling[2 * yp] = 0;
if (xpmax < azrp_width)
cmd->DataFilling[2 * yp + 1] = xpmax;
else
cmd->DataFilling[2 * yp + 1] = azrp_width - 1;
}
}
void azrp_filledcircle(int xc, int yc, uint16_t rad, uint16_t color) {
prof_enter(azrp_perf_cmdgen);
int xmin = xc - rad;
int xmax = xc + rad;
int ymin = yc - rad;
int ymax = yc + rad;
// The circle is fully outside the screen
if ((xmax < 0) || (xmin >= azrp_width) || (ymax < 0) ||
(ymin >= azrp_height)) {
prof_leave(azrp_perf_cmdgen);
return;
}
int ytop = max(ymin, 0);
int ybot = min(ymax, azrp_height - 1);
int frag_first = ytop / azrp_frag_height;
int frag_last = ybot / azrp_frag_height;
int frag_count = frag_last - frag_first + 1;
struct command *cmd = (struct command *) azrp_new_command(sizeof *cmd, frag_first, frag_count);
if(!cmd) {
prof_leave(azrp_perf_cmdgen);
return;
}
cmd->shader_id = AZRP_SHADER_FILLEDCIRCLE;
cmd->color = color;
cmd->curr_frag = frag_first;
// reset the point counters in each cell of the table
for (int i = 0; i < 224; i++) {
cmd->DataFilling[2 * i] = -1; // reset with value equels -1
cmd->DataFilling[2 * i + 1] = -1; // reset with value equals -1
}
int x = 0;
int y = rad;
int m = 5 - 4 * rad;
while (x <= y) {
AddPixelFilledCircle(xc - x, xc + x, yc - y, cmd);
AddPixelFilledCircle(xc - y, xc + y, yc - x, cmd);
AddPixelFilledCircle(xc - x, xc + x, yc + y, cmd);
AddPixelFilledCircle(xc - y, xc + y, yc + x, cmd);
if (m > 0) {
y--;
m -= 8 * y;
}
x++;
m += 8 * x + 4;
}
prof_leave(azrp_perf_cmdgen);
}
void azrp_shader_filledcircle(void *uniforms, void *comnd, void *fragment) {
struct command *cmd = (struct command *)comnd;
uint16_t *frag = (uint16_t *)fragment;
int16_t *data = (int16_t *)cmd->DataFilling;
int BaseAdress = cmd->curr_frag * azrp_frag_height * 2;
for (int i = 0; i < azrp_frag_height; i++) {
int16_t Xmin = data[BaseAdress + 2 * i];
int16_t Xmax = data[BaseAdress + 2 * i + 1];
if (Xmin != -1 && Xmax != -1)
for (int j = Xmin; j <= Xmax; j++)
frag[azrp_width * i + j] = cmd->color;
}
cmd->curr_frag++;
}

171
src/shaders/filledpoly.cpp Normal file
View File

@ -0,0 +1,171 @@
#include <azur/gint/render.h>
#include <cstdlib>
uint8_t AZRP_SHADER_FILLEDPOLY = -1;
static void azrp_shader_filledpoly_configure(void) {
azrp_set_uniforms(AZRP_SHADER_FILLEDPOLY, (void *)azrp_width);
}
__attribute__((constructor)) static void register_shader(void) {
extern azrp_shader_t azrp_shader_filledpoly;
AZRP_SHADER_FILLEDPOLY = azrp_register_shader(azrp_shader_filledpoly, azrp_shader_filledpoly_configure);
}
static int min(int x, int y) { return (x < y) ? x : y; }
static int max(int x, int y) { return (x > y) ? x : y; }
//---
#define TABLE_WIDTH
struct command {
uint8_t shader_id;
uint16_t color;
uint8_t curr_frag;
int16_t xmin[224];
int16_t xmax[224];
uint8_t empty[224];
};
void AddPixelFilledPoly(int16_t xpmin, int16_t xpmax, int16_t yp,
struct command *cmd) {
if (yp >= 0 && yp < azrp_height) {
if (xpmin >= 0)
cmd->xmin[yp] = xpmin;
else
cmd->xmin[yp] = 0;
if (xpmax < azrp_width)
cmd->xmax[yp] = xpmax;
else
cmd->xmax[yp] = azrp_width - 1;
}
}
void azrp_filledpoly(int *x, int *y, int nb_vertices, uint16_t color) {
prof_enter(azrp_perf_cmdgen);
int i, ymin, ymax, xmin2, xmax2, *xmin, *xmax;
char *empty;
if(nb_vertices < 3) {
prof_leave(azrp_perf_cmdgen);
return;
}
ymin = ymax = y[0];
xmin2 = xmax2 = x[0];
for(i=0 ; i<nb_vertices ; i++) {
if(y[i] < ymin) ymin = y[i];
if(y[i] > ymax) ymax = y[i];
if(x[i] < xmin2) xmin2 = x[i];
if(x[i] > xmax2) xmax2 = x[i];
}
// The polygon is fully outside the screen
if ((xmax2 < 0) || (xmin2 >= azrp_width) || (ymax < 0) ||
(ymin >= azrp_height)) {
prof_leave(azrp_perf_cmdgen);
return;
}
xmin = (int*) malloc((ymax-ymin+1)*sizeof(int));
xmax = (int*) malloc((ymax-ymin+1)*sizeof(int));
empty = (char*) malloc(ymax-ymin+1);
int ytop = max(ymin, 0);
int ybot = min(ymax, azrp_height - 1);
int frag_first = ytop / azrp_frag_height;
int frag_last = ybot / azrp_frag_height;
int frag_count = frag_last - frag_first + 1;
struct command *cmd = (struct command *) azrp_new_command(sizeof *cmd, frag_first, frag_count);
if(!cmd) {
prof_leave(azrp_perf_cmdgen);
return;
}
cmd->shader_id = AZRP_SHADER_FILLEDPOLY;
cmd->color = color;
cmd->curr_frag = frag_first;
// reset the point counters in each cell of the table
for (int i = 0; i < 224; i++) {
cmd->xmin[i] = -1; // reset with value equels -1
cmd->xmax[i] = -1; // reset with value equals -1
}
if(xmin && xmax && empty) {
for(i=0 ; i<ymax-ymin+1 ; i++) empty[i] = 1;
for(i=0 ; i<nb_vertices ; i++) {
int j, px, py, dx, dy, sx, sy, cumul;
px = x[i];
py = y[i];
dx = x[(i+1)%nb_vertices]-px;
dy = y[(i+1)%nb_vertices]-py;
sx = (dx > 0) ? 1 : -1;
sy = (dy > 0) ? 1 : -1;
dx = (dx > 0) ? dx : -dx;
dy = (dy > 0) ? dy : -dy;
if(empty[py-ymin]) xmax[py-ymin]=xmin[py-ymin]=px, empty[py-ymin]=0; else xmax[py-ymin]=px;
if(dx > dy) {
cumul = dx >> 1;
for(j=1 ; j<dx ; j++) {
px += sx;
cumul += dy;
if(cumul > dx) cumul -= dx, py += sy;
if(empty[py-ymin]) xmax[py-ymin]=xmin[py-ymin]=px, empty[py-ymin]=0; else xmax[py-ymin]=px;
}
} else {
cumul = dy >> 1;
for(j=1 ; j<dy ; j++) {
py += sy;
cumul += dx;
if(cumul > dy) cumul -= dy, px += sx;
if(empty[py-ymin]) xmax[py-ymin]=xmin[py-ymin]=px, empty[py-ymin]=0; else xmax[py-ymin]=px;
}
}
}
for(i=0 ; i<ymax-ymin+1 ; i++)
AddPixelFilledPoly(xmin[i], xmax[i], ymin+i, cmd);
}
free(xmin);
free(xmax);
free(empty);
prof_leave(azrp_perf_cmdgen);
}
void azrp_shader_filledpoly(void *uniforms, void *comnd, void *fragment) {
struct command *cmd = (struct command *)comnd;
uint16_t *frag = (uint16_t *)fragment;
int16_t *Xmindata = (int16_t *)cmd->xmin;
int16_t *Xmaxdata = (int16_t *)cmd->xmax;
int BaseAdress = cmd->curr_frag * azrp_frag_height;
for (int i = 0; i < azrp_frag_height; i++)
{
int16_t Xmin = Xmindata[BaseAdress + i];
int16_t Xmax = Xmaxdata[BaseAdress + i];
if (Xmin != -1 && Xmax != -1)
{
if (Xmin<=Xmax)
for (int j = Xmin; j <= Xmax; j++) frag[azrp_width * i + j] = cmd->color;
else
for (int j = Xmax; j <= Xmin; j++) frag[azrp_width * i + j] = cmd->color;
}
}
cmd->curr_frag++;
}

211
src/shaders/line.cpp Normal file
View File

@ -0,0 +1,211 @@
#include <azur/gint/render.h>
uint8_t AZRP_SHADER_LINE = -1;
static void azrp_shader_line_configure(void)
{
azrp_set_uniforms(AZRP_SHADER_LINE, (void *)azrp_width);
}
__attribute__((constructor))
static void register_shader(void)
{
extern azrp_shader_t azrp_shader_line;
AZRP_SHADER_LINE = azrp_register_shader(azrp_shader_line, azrp_shader_line_configure );
}
//---
struct command {
uint8_t shader_id;
uint16_t color;
uint16_t curr_y;
uint16_t curr_x;
int16_t dx, dy, sx, sy;
int16_t cumul;
int16_t i;
};
int ABS( int x1 )
{
if (x1 >= 0) return x1;
else return (-1 * x1);
}
int SGN( int x1 )
{
if (x1 > 0) return 1;
else if (x1 == 0) return 0;
else return -1;
}
void azrp_line(int xA, int yA, int xB, int yB, uint16_t color)
{
prof_enter(azrp_perf_cmdgen);
//clipping algorithm as per "Another Simple but Faster Method for 2D Line Clipping"
//from Dimitrios Matthes and Vasileios Drakopoulos
//International Journal of Computer Graphics & Animation (IJCGA) Vol.9, No.1/2/3, July 2019
int xmin = 0;
int xmax = azrp_width-1;
int ymin = 0;
int ymax = azrp_height-1;
//step 1 line are fully out of the screen
if ((xA<xmin && xB<xmin) || (xA>xmax && xB>xmax) || (yA<ymin && yB<ymin) || (yA>ymax && yB>ymax)) {
prof_leave(azrp_perf_cmdgen);
return;
}
int x1, x2, y1, y2;
// step 1.5 - specific to Azur fragment approach
// we swap to always start with the point on top as the fragment are updated from top to bottom
// (x1,y1) is the most top point and (x2,y2) is the most bottom point (rankig as per y values only
if (yA <= yB) {
x1 = xA; y1 = yA;
x2 = xB; y2 = yB;
}
else {
x1 = xB; y1 = yB;
x2 = xA; y2 = yA;
}
//step 2 line clipping within the box (xmin,ymin) --> (xmax,ymax)
int x[2];
int y[2];
x[0] = x1; x[1] = x2;
y[0] = y1; y[1] = y2;
for(int i=0; i<2; i++) {
if (x[i] < xmin) {
x[i] = xmin; y[i] = ((y2-y1) * (xmin-x1)) / (x2-x1) + y1;
}
else if (x[i] > xmax) {
x[i] = xmax; y[i] = ((y2-y1) * (xmax-x1)) / (x2-x1) + y1;
}
if (y[i] < ymin) {
x[i] = ((x2-x1) * (ymin-y1)) / (y2-y1) + x1; y[i] = ymin;
}
else if (y[i] > ymax) {
x[i] = ((x2-x1) * (ymax-y1)) / (y2-y1) + x1; y[i] = ymax;
}
}
if((x[0] < xmin && x[1] < xmin) || (x[0] > xmax && x[1] > xmax)) {
prof_leave(azrp_perf_cmdgen);
return;
}
x1 = x[0];
y1 = y[0];
x2 = x[1];
y2 = y[1];
int frag_first = y1 / azrp_frag_height;
int frag_last = y2 / azrp_frag_height;
int frag_count = frag_last - frag_first + 1;
struct command *cmd = (struct command *) azrp_new_command(sizeof *cmd, frag_first, frag_count);
if(!cmd) {
prof_leave(azrp_perf_cmdgen);
return;
}
cmd->shader_id = AZRP_SHADER_LINE;
cmd->color = color;
cmd->curr_x = x1;
cmd->curr_y = y1 & 15;
cmd->dx = ABS(x2-x1);
cmd->sx = SGN(x2-x1);
cmd->dy = ABS(y2-y1);
cmd->sy = SGN(y2-y1);
cmd->i = 0;
cmd->cumul = (cmd->dx >= cmd->dy) ? cmd->dx/2 : cmd->dy/2;
prof_leave(azrp_perf_cmdgen);
}
void azrp_shader_line( void *uniforms, void *comnd, void *fragment )
{
struct command *cmd = (struct command *) comnd;
uint16_t *frag = (uint16_t *) fragment;
frag[ azrp_width * cmd->curr_y + cmd->curr_x ] = cmd->color;
int i;
if (cmd->dy == 0)
{
for( i = cmd->i; i < cmd->dx ; i++ )
{
cmd->curr_x += cmd->sx;
frag[ azrp_width * cmd->curr_y + cmd->curr_x ] = cmd->color;
}
}
else if (cmd->dx == 0)
{
for( i = cmd->i; i < cmd->dy ; i++ )
{
cmd->curr_y += cmd->sy;
// if curr_y=16, this means we are changing to next fragment
if (cmd->curr_y == azrp_frag_height) break;
frag[ azrp_width * cmd->curr_y + cmd->curr_x ] = cmd->color;
}
}
else if (cmd->dx >= cmd->dy)
{
for( i = cmd->i; i < cmd->dx; i++ )
{
cmd->curr_x += cmd->sx;
cmd->cumul += cmd->dy;
if (cmd->cumul > cmd->dx)
{
cmd->cumul -= cmd->dx;
cmd->curr_y += cmd->sy;
}
// if curr_y=16, this means we are changing to next fragment
if (cmd->curr_y == azrp_frag_height ) break;
frag[ azrp_width * cmd->curr_y + cmd->curr_x ] = cmd->color;
}
}
else
{
for( i = cmd->i; i < cmd->dy; i++ )
{
cmd->curr_y += cmd->sy;
cmd->cumul += cmd->dx;
if (cmd->cumul > cmd->dy)
{
cmd->cumul -= cmd->dy;
cmd->curr_x += cmd->sx;
}
// if curr_y=16, this means we are changing to next fragment
if (cmd->curr_y == azrp_frag_height) break;
frag[ azrp_width * cmd->curr_y + cmd->curr_x ] = cmd->color;
}
}
cmd->curr_y = cmd->curr_y & 15;
cmd->i = i+1;
}

16
src/shaders/poly.cpp Normal file
View File

@ -0,0 +1,16 @@
#include <azur/gint/render.h>
#include "MyAzurShaders.h"
void azrp_poly(int *x, int *y, int nb_vertices, uint16_t color) {
prof_enter(azrp_perf_cmdgen);
for( int i=0 ; i<nb_vertices ; i++) {
int px = x[i];
int py = y[i];
int px2 = x[(i+1)%nb_vertices];
int py2 = y[(i+1)%nb_vertices];
azrp_line( px, py, px2, py2, color );
}
prof_leave(azrp_perf_cmdgen);
}

View File

@ -1,11 +1,11 @@
#include "../config.h"
#include <azur/gint/render.h>
#include "MyAzurShaders.h"
#include <cstdlib>
#include <cstdio>
#include <gint/rtc.h>
#include <gint/usb.h>
#include <gint/usb-ff-bulk.h>
#include <vector>
@ -52,42 +52,17 @@ std::vector<particle*> pixels;
std::vector<star*> starfield;
__attribute__((constructor))
static void register_shader(void)
{
extern azrp_shader_t azrp_shader_starfield;
AZRP_SHADER_STARFIELD = azrp_register_shader(azrp_shader_starfield);
}
void azrp_shader_starfield_configure(void)
static void azrp_shader_starfield_configure(void)
{
azrp_set_uniforms(AZRP_SHADER_STARFIELD, (void *)azrp_width);
}
void azrp_starfield_USBDEBUG( uint8_t info )
__attribute__((constructor))
static void register_shader(void)
{
char texttosend[1024];
int nbpixelcumulated = 0;
if (info==SHOW_PIXELS)
for(unsigned int i=0; i<pixels.size(); i++)
{
sprintf( texttosend, "Pixel %d : x=%d : y=%d : s=%d : f=%d : c=%d : o=%d\n", i, pixels[i]->x, pixels[i]->y, pixels[i]->s, pixels[i]->frag, pixels[i]->c, pixels[i]->off );
usb_fxlink_text(texttosend, 0);
}
else if (info==SHOW_STARS)
for(unsigned int i=0; i<starfield.size(); i++)
{
if (starfield[i]->n==1 || starfield[i]->n==2) nbpixelcumulated+=4;
else if (starfield[i]->n==3) nbpixelcumulated+=9;
else if (starfield[i]->n==4) nbpixelcumulated+=21;
sprintf( texttosend, "Star %d : x=%d : y=%d : s=%d : n=%d : t=%d : cumul=%d\n", i, starfield[i]->x, starfield[i]->y, starfield[i]->s, starfield[i]->n, starfield[i]->t, nbpixelcumulated );
usb_fxlink_text(texttosend, 0);
}
extern azrp_shader_t azrp_shader_starfield;
AZRP_SHADER_STARFIELD = azrp_register_shader(azrp_shader_starfield, azrp_shader_starfield_configure );
}
@ -273,23 +248,29 @@ void azrp_starfield( void )
{
prof_enter(azrp_perf_cmdgen);
struct command cmd;
cmd.shader_id = AZRP_SHADER_STARFIELD;
cmd.current_frag = 0;
cmd.nbpixel = pixels.size();
cmd.data = pixels.data();
int fragmin = 0;
int fragcount = (223 >> 4) + 1;
for(int i=0; i<pixels.size(); i++)
struct command *cmd = (struct command *) azrp_new_command(sizeof *cmd, fragmin, fragcount);
if(!cmd) {
prof_leave(azrp_perf_cmdgen);
return;
}
cmd->shader_id = AZRP_SHADER_STARFIELD;
cmd->current_frag = 0;
cmd->nbpixel = pixels.size();
cmd->data = pixels.data();
for(unsigned int i=0; i<pixels.size(); i++)
{
pixels[i]->x = (pixels[i]->x - pixels[i]->s) % 396;
pixels[i]->frag = pixels[i]->y / 16;
pixels[i]->off = pixels[i]->y & 15;
}
int fragmin = 0;
int fragcount = (223 >> 4) + 1;
azrp_queue_command(&cmd, sizeof cmd, fragmin, fragcount);
prof_leave(azrp_perf_cmdgen);
}

104
src/shmup/background.cpp Normal file
View File

@ -0,0 +1,104 @@
#include "../config.h"
#include "background.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
extern struct Map map_Level1;
extern struct Map map_Level2;
Map *map_Level;
Background::Background( )
{
map_Level = &map_Level1;
speed = libnum::num(1.0);
}
Background::~Background( )
{
}
void Background::Render( void )
{
int x0 = (int) xlevel;
int xshifttile = (int) (16*xlevel.frac());
int y0 = (int) ylevel;
int yshifttile = (int) (16*ylevel.frac());
for(int u=0; u<map_Level->nblayers;u++)
for(int i=0; i<=25; i++)
{
for(int j=0; j<=14; j++)
{
uint16_t index = (j+y0) * map_Level->w + (x0+i) % map_Level->w;
uint16_t currentTile = map_Level->layers[u][ index ];
if (currentTile!=0)
{
uint16_t xtile = ((currentTile % map_Level->tileset_size)-1) * 16;
uint16_t ytile = (currentTile / map_Level->tileset_size) * 16;
azrp_subimage_p8( i*16-xshifttile, j*16-yshifttile, map_Level->tileset, xtile, ytile, 16, 16, DIMAGE_NONE );
}
}
}
/* int x0 = (int) xlevel;
int shifttile = (int) (16*xlevel.frac());
uint16_t tilemap[25*14]={0};
for(int u=0; u<map_Level->nblayers;u++)
{
for(int j=0; j<14; j++)
{
for(int i=0; i<=25; i++)
{
uint16_t index = j * map_Level->w + (x0+i) % map_Level->w;
tilemap[25*j+i]= cmap_Level->layers[u][ index ];
}
}
azrp_tilesmap( shifttile, tilemap, map_Level->tileset, map_Level->tileset_size);
}
*/
}
void Background::Update( float dt )
{
libnum::num a = libnum::num( dt / 90000.0f); //18000.0f );
xlevel += speed*a;
}
void Background::SetSpeed(libnum::num s)
{
speed = s;
}
void Background::IncXCoordinate( libnum::num x )
{
xlevel += x ;
}
void Background::IncYCoordinate( libnum::num y )
{
ylevel += y ;
if (ylevel<0) ylevel=libnum::num(0);
if (ylevel>map_Level->h-14) ylevel=libnum::num(map_Level->h-14);
}
int Background::GetXCoordinate( void )
{
return (int) xlevel;
}
int Background::GetYCoordinate( void )
{
return (int) ylevel;
}

View File

@ -12,14 +12,14 @@
struct Map {
/*width, height and the number of layer of the map*/
int w, h;
int w, h, nblayers;
/*the tileset to use*/
bopti_image_t *tileset;
int tileset_size;
/*list of all the tiles*/
short *layers;
short *layers[];
};
@ -32,8 +32,17 @@ class Background
void Update( float dt );
void Render( );
void IncXCoordinate( libnum::num x );
void IncYCoordinate( libnum::num y );
int GetXCoordinate( void );
int GetYCoordinate( void );
void SetSpeed( libnum::num s );
private:
libnum::num xlevel, ylevel;
libnum::num speed;
};

87
src/shmup/bonus.cpp Normal file
View File

@ -0,0 +1,87 @@
#include "../config.h"
#include "bonus.h"
#include "entity.h"
#include <num/num.h>
#include <gint/rtc.h>
extern bopti_image_t img_emp_circ;
extern bopti_image_t img_life_bonus;
extern bopti_image_t img_sat_bonus;
Bonus::Bonus( int16_t _x, int16_t _y, uint8_t _id ) : Entity( _x, _y, _id )
{
if (ID==0)
{
width = img_life_bonus.width/2;
height = img_life_bonus.height/2;
speed = 0;
}
else if (ID==1)
{
width = img_sat_bonus.width/2;
height = img_sat_bonus.height/2;
speed = 0;
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
currentframe = libnum::num(0);
}
Bonus::~Bonus()
{
if (hasTrajectory)
pathToFollow->DeleteRegistry();
}
void Bonus::Update( float dt )
{
if (!hasTrajectory)
{
/*
libnum::num a = libnum::num( dt / 60000.0f );
x += a * libnum::num( dirx * speed );
y += a * libnum::num( diry * speed );
if (x<width || x>azrp_width-width) dirx=-1*dirx;
if (y<height || y>azrp_height-height) diry=-1*diry;
*/
}
else
{
pathToFollow->CalculatePosition( &accumulatedTime, dt, speed, true, &x, &y );
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
libnum::num a = libnum::num( dt / 150000.0f );
currentframe += a;
if (currentframe >7 ) currentframe = libnum::num(0);
}
void Bonus::Render( void )
{
uint8_t dximg = (int) currentframe * 15;
uint8_t sz = (int) currentframe;
azrp_subimage_p8( (int) x-sz, (int) y-sz, &img_emp_circ, dximg+7-sz, 7-sz, sz*2+1, sz*2+1, DIMAGE_NONE );
if (ID==0)
{
azrp_image_p8_effect(xmin, ymin, &img_life_bonus, DIMAGE_NONE);
}
else if (ID==1)
{
azrp_image_p8_effect(xmin, ymin, &img_sat_bonus, DIMAGE_NONE);
}
}

34
src/shmup/bonus.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef BONUS_H
#define BONUS_H
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include "trajectory.h"
#include "entity.h"
class Bonus : public Entity
{
public:
Bonus( int16_t _x, int16_t _y, uint8_t _id );
~Bonus();
virtual void Update( float dt ) override;
virtual void Render( void ) override;
private:
int8_t dirx, diry;
libnum::num currentframe;
};
#endif

428
src/shmup/boss.cpp Normal file
View File

@ -0,0 +1,428 @@
#include "../config.h"
#include "boss.h"
#include "bullet.h"
#include <cstdint>
#include <num/num.h>
#include <gint/rtc.h>
#include <sys/types.h>
#include "../utilities/fast_trig.h"
#include <gint/gint.h>
#include "collections.h"
#include "player.h"
#include "../utilities/vector2D.h"
extern bopti_image_t img_Lifebar;
extern bopti_image_t img_Boss1;
extern bopti_image_t img_BossGun;
extern font_t milifont_prop;
extern std::vector<Bullet*> MyEnemiesBullets;
extern Player *MyPlayer;
#define NB_PIECES_BOSS 12
#define NB_GUNS 12
libnum::num XdataBossInternal[NB_PIECES_BOSS];
libnum::num YdataBossInternal[NB_PIECES_BOSS];
libnum::num XdataBossExternal[NB_PIECES_BOSS];
libnum::num YdataBossExternal[NB_PIECES_BOSS];
BossPart Pieces[NB_PIECES_BOSS*2];
libnum::num xGuns[NB_GUNS];
libnum::num yGuns[NB_GUNS];
BossGun Guns[NB_GUNS];
#include <stdio.h>
void savedata( void )
{
FILE* exportfp = fopen("databosPtxt", "w" );
if(exportfp)
{
fprintf(exportfp, "Points : \n" );
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
fprintf(exportfp, "Ext[ %d ] : X= %d - Y= %d \n", i, (int) XdataBossExternal[i], (int) YdataBossExternal[i] );
}
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
fprintf(exportfp, "Int[ %d ] : X= %d - Y= %d \n", i, (int) XdataBossInternal[i], (int) YdataBossInternal[i] );
}
fprintf(exportfp, "Triangles : \n" );
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
fprintf(exportfp, "Tri ext[ %d ] : P1= %d - P2= %d - P3= %d \n", i, Pieces[2*i].P1, Pieces[2*i].P2, Pieces[2*i].P3 );
}
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
fprintf(exportfp, "Tri int[ %d ] : P1= %d - P2= %d - P3= %d \n", i, Pieces[2*i+1].P1, Pieces[2*i+1].P2, Pieces[2*i+1].P3 );
}
fclose( exportfp );
}
}
bool Is_Point_Inside_Triangle( int Px, int Py, int P1x, int P1y, int P2x, int P2y, int P3x, int P3y )
{
int as_x = Px - P1x;
int as_y = Py - P1y;
bool s_ab = (P2x - P1x) * as_y - (P2y - P1y) * as_x > 0;
if (((P3x - P1x) * as_y - (P3y - P1y) * as_x > 0) == s_ab)
return false;
if (((P3x - P2x) * (Py - P2y) - (P3y - P2y)*(Px - P2x) > 0) != s_ab)
return false;
return true;
}
Boss::Boss( int16_t _x, int16_t _y, uint8_t _id ) : Enemy( _x, _y, _id )
{
speed = 1;
width = img_Boss1.width/2;
height = img_Boss1.height/2;
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
if (ID==0)
{
life = 1000;
life0 = 1000;
}
hasTrajectory=false;
lastshoot0 = rtc_ticks();
lastshoot1 = rtc_ticks();
radiusInt = libnum::num( 80 );
radiusExt = libnum::num( 90 );
rotAngle = 0.0f;
rotSpeed = 2;
this->Update(0.0f);
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
Pieces[i*2].P1 = i%NB_PIECES_BOSS; //exterior circle
Pieces[i*2].P2 = (i+1)%NB_PIECES_BOSS; //exterior circle
Pieces[i*2].P3 = (i+1)%NB_PIECES_BOSS; //interior circle
Pieces[i*2].life = 100;
Pieces[i*2].toberemoved = false;
Pieces[i*2].color = 0xbdf7; //light gray
Pieces[i*2+1].P1 = i%NB_PIECES_BOSS; //interior circle
Pieces[i*2+1].P2 = (i+1)%NB_PIECES_BOSS; //interior circle
Pieces[i*2+1].P3 = i%NB_PIECES_BOSS; //exterior circle
Pieces[i*2+1].life = 100;
Pieces[i*2+1].toberemoved = false;
Pieces[i*2+1].color = 0x528a; //darker gray
}
for( int i=0; i<NB_GUNS; i++ )
{
Guns[i].life = 100;
Guns[i].toberemoved = false;
}
}
Boss::~Boss()
{
}
void Boss::Update( float dt )
{
if (hasTrajectory)
{
pathToFollow->CalculatePosition( &accumulatedTime, dt, speed, true, &x, &y );
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
rotAngle += rotSpeed * dt / 25000.0f;
if (rotAngle>360.0f) rotAngle-=360.0f;
/* Management of the shield part of the boss (rotating circles made of triangles)*/
uint16_t angleint = (uint16_t) rotAngle;
uint16_t angledelta = (uint16_t) (360/NB_PIECES_BOSS);
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
XdataBossInternal[ i ] = this->x + this->radiusInt * FastCosInt( angleint );
YdataBossInternal[ i ] = this->y + this->radiusInt * FastSinInt( angleint );
angleint += angledelta;
if (angleint>=360) angleint -= 360;
}
// Pour le cercle Exterieur on se décale d'un demi-incrément d'angle pour le sommet du triangle
angleint = (uint16_t) rotAngle + angledelta/2;
if (angleint>=360) angleint -= 360;
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
XdataBossExternal[ i ] = this->x + this->radiusExt * FastCosInt( angleint );
YdataBossExternal[ i ] = this->y + this->radiusExt * FastSinInt( angleint );
angleint += angledelta;
if (angleint>=360) angleint -= 360;
}
/* Management of the Guns part of the boss (rotating cannons made of sprites)*/
angledelta = (uint16_t) (360/NB_GUNS);
angleint = (uint16_t) rotAngle + angledelta/2;
if (angleint>=360) angleint -= 360;
for( int i=0; i<NB_GUNS; i++ )
{
xGuns[i] = this->x + (this->radiusInt + this->radiusExt) / 2 * FastCosInt( angleint );
yGuns[i] = this->y + (this->radiusInt + this->radiusExt) / 2 * FastSinInt( angleint );
angleint += angledelta;
if (angleint>=360) angleint -= 360;
}
uint32_t tempshoot = rtc_ticks();
bool hasExternalGun = false;
if (Shoot_OK( tempshoot, BULLET_ENEMY_RED ))
{
/* shoot from the rotating cannons (aiming directly the position of the player )*/
for( int i=0; i<NB_GUNS; i++ )
{
if (Guns[i].toberemoved==false)
{
Vector2D shootDirection( MyPlayer->x - xGuns[i], MyPlayer->y - yGuns[i] );
shootDirection.Normalise();
Bullet *b = new Bullet( xGuns[i] , yGuns[i], shootDirection.x, shootDirection.y, BULLET_ENEMY_RED );
MyEnemiesBullets.push_back( b );
hasExternalGun = true;
}
}
}
if (hasExternalGun==false)
if(Shoot_OK( tempshoot, BULLET_ENEMY_GREEN ))
{
/* central shoot from the main ship only if no more other gun shooting */
Bullet *b0 = new Bullet( xmin, (int) y, -3, 0, BULLET_ENEMY_GREEN );
MyEnemiesBullets.push_back( b0 );
Bullet *b1 = new Bullet( xmin, (int) y, -2, -2, BULLET_ENEMY_BLUE );
MyEnemiesBullets.push_back( b1 );
Bullet *b2 = new Bullet( xmin, (int) y, -2, 2, BULLET_ENEMY_BLUE );
MyEnemiesBullets.push_back( b2 );
Bullet *b3 = new Bullet( xmin, (int) y, -3, -1, BULLET_ENEMY_GREEN );
MyEnemiesBullets.push_back( b3 );
Bullet *b4 = new Bullet( xmin, (int) y, -3, 1, BULLET_ENEMY_GREEN );
MyEnemiesBullets.push_back( b4 );
}
}
void Boss::Render( void )
{
if (toberemoved==false)
{
for( int i=0; i<NB_PIECES_BOSS; i++ )
{
if (Pieces[i*2].toberemoved == false)
{
azrp_triangle( (int) XdataBossExternal[ Pieces[i*2].P1 ], (int) YdataBossExternal[ Pieces[i*2].P1 ],
(int) XdataBossExternal[ Pieces[i*2].P2 ], (int) YdataBossExternal[ Pieces[i*2].P2 ],
(int) XdataBossInternal[ Pieces[i*2].P3 ], (int) YdataBossInternal[ Pieces[i*2].P3 ],
Pieces[i*2].color );
#if(DEBUG_MODE)
dfont( &milifont_prop );
int X = (int) ((XdataBossExternal[ Pieces[i*2].P1 ] + XdataBossExternal[ Pieces[i*2].P2 ] + XdataBossInternal[ Pieces[i*2].P3 ]) / 3);
int Y = (int) ((YdataBossExternal[ Pieces[i*2].P1 ] + YdataBossExternal[ Pieces[i*2].P2 ] + YdataBossInternal[ Pieces[i*2].P3 ]) / 3);
azrp_print( X, Y, C_WHITE, "%d", Pieces[i*2].life );
#endif
}
if (Pieces[i*2+1].toberemoved == false)
{
azrp_triangle( (int) XdataBossInternal[ Pieces[i*2+1].P1 ], (int) YdataBossInternal[ Pieces[i*2+1].P1 ],
(int) XdataBossInternal[ Pieces[i*2+1].P2 ], (int) YdataBossInternal[ Pieces[i*2+1].P2 ],
(int) XdataBossExternal[ Pieces[i*2+1].P3 ], (int) YdataBossExternal[ Pieces[i*2+1].P3 ],
Pieces[i*2+1].color );
#if(DEBUG_MODE)
dfont( &milifont_prop );;
int X = (int) ((XdataBossInternal[ Pieces[i*2+1].P1 ] + XdataBossInternal[ Pieces[i*2+1].P2 ] + XdataBossExternal[ Pieces[i*2+1].P3 ]) / 3);
int Y = (int) ((YdataBossInternal[ Pieces[i*2+1].P1 ] + YdataBossInternal[ Pieces[i*2+1].P2 ] + YdataBossExternal[ Pieces[i*2+1].P3 ]) / 3);
azrp_print( X, Y, C_WHITE, "%d", Pieces[i*2+1].life );
#endif
}
}
for( int i=0; i<NB_GUNS; i++ )
{
if (Guns[i].toberemoved==false)
{
azrp_image_p8_effect( (int) xGuns[i] - img_BossGun.width/2,
(int) yGuns[i] - img_BossGun.height/2,
&img_BossGun, DIMAGE_NONE);
#if(DEBUG_MODE)
dfont( &milifont_prop );;
int X = (int) xGuns[i] - img_BossGun.width/2 + 15 ;
int Y = (int) yGuns[i] - img_BossGun.height/2 +15;
azrp_print( X, Y, C_WHITE, "%d", Guns[i].life );
#endif
}
}
azrp_image_p8_effect(xmin, ymin, &img_Boss1, DIMAGE_NONE);
if (life>life0*2/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 7, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
else if (life>life0/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 12, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
else azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 17, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
};
}
bool Boss::Test_Impact( Bullet *projectile )
{
/* We check if the bullet collides with teh shield of the boss */
for( int i=0; i< NB_PIECES_BOSS; i++ )
{
if (Pieces[i*2].toberemoved == false)
{
if (Is_Point_Inside_Triangle( (int) projectile->x, (int) projectile->y,
(int) XdataBossExternal[ Pieces[i*2].P1 ], (int) YdataBossExternal[ Pieces[i*2].P1 ],
(int) XdataBossExternal[ Pieces[i*2].P2 ], (int) YdataBossExternal[ Pieces[i*2].P2 ],
(int) XdataBossInternal[ Pieces[i*2].P3 ], (int) YdataBossInternal[ Pieces[i*2].P3 ] ))
{
Pieces[i*2].life -= projectile->strength;
if (Pieces[i*2].life<=0)
{
Pieces[i*2].toberemoved = true;
Create_Explosion( (int) projectile->x, (int) projectile->y );
}
projectile->toberemoved = true;
return true;
}
}
if (Pieces[i*2+1].toberemoved == false)
{
if (Is_Point_Inside_Triangle( (int) projectile->x, (int) projectile->y,
(int) XdataBossInternal[ Pieces[i*2+1].P1 ], (int) YdataBossInternal[ Pieces[i*2+1].P1 ],
(int) XdataBossInternal[ Pieces[i*2+1].P2 ], (int) YdataBossInternal[ Pieces[i*2+1].P2 ],
(int) XdataBossExternal[ Pieces[i*2+1].P3 ], (int) YdataBossExternal[ Pieces[i*2+1].P3 ] ))
{
Pieces[i*2+1].life -= projectile->strength;
if (Pieces[i*2+1].life<=0)
{
Pieces[i*2+1].toberemoved = true;
Create_Explosion( (int) projectile->x, (int) projectile->y );
}
projectile->toberemoved = true;
return true;
}
}
}
/* We check if the bullet collides with the cannons of the boss */
for( int i=0; i<NB_GUNS; i++ )
{
if (Guns[i].toberemoved==false)
{
if (projectile->x >= (int) xGuns[i] - img_BossGun.width/2 &&
projectile->x <= (int) xGuns[i] + img_BossGun.width/2 &&
projectile->y >= (int) yGuns[i] - img_BossGun.height/2 &&
projectile->y <= (int) yGuns[i] + img_BossGun.height/2 )
{
Guns[i].life -= projectile->strength;
if (Guns[i].life<0)
{
Guns[i].toberemoved = true;
Create_Explosion( (int) projectile->x, (int) projectile->y );
}
projectile->toberemoved = true;
return true;
}
}
}
/* We check if the bullet collides with the main ship part of the boss */
if (projectile->x >= xmin && projectile->x <= xmax && projectile->y >= ymin && projectile->y <= ymax )
{
life -= projectile->strength;
if (life<0)
{
this->toberemoved = true;
Create_Explosion( (int) projectile->x, (int) projectile->y );
}
projectile->toberemoved = true;
return true;
}
else return false;
}
bool Boss::Shoot_OK( uint32_t tempshoot, uint8_t shootID )
{
if (shootID==BULLET_ENEMY_RED)
{
if(tempshoot-lastshoot0>1)
{
lastshoot0=tempshoot;
return true;
}
else return false;
}
else if (shootID==BULLET_ENEMY_GREEN)
{
if(tempshoot-lastshoot1>1)
{
lastshoot1=tempshoot;
return true;
}
else return false;
}
else return false;
}

57
src/shmup/boss.h Normal file
View File

@ -0,0 +1,57 @@
#ifndef BOSS_H
#define BOSS_H
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include <sys/types.h>
#include "bullet.h"
#include "enemy.h"
#include "trajectory.h"
typedef struct
{
uint8_t P1, P2, P3;
int16_t life;
bool toberemoved;
int color;
} BossPart;
typedef struct
{
int16_t life;
bool toberemoved;
} BossGun;
class Boss : public Enemy
{
public:
Boss( int16_t _x, int16_t _y, uint8_t _id );
~Boss();
virtual void Update( float dt ) override;
virtual void Render( void ) override;
virtual bool Test_Impact( Bullet *projectile ) override;
uint32_t lastshoot = 0;
uint8_t rotSpeed;
private:
float rotAngle;
libnum::num radiusInt, radiusExt;
uint32_t lastshoot0 = 0;
uint32_t lastshoot1 = 0;
virtual bool Shoot_OK( uint32_t tempshoot, uint8_t shootID ) override;
};
#endif

147
src/shmup/bullet.cpp Normal file
View File

@ -0,0 +1,147 @@
#include "../config.h"
#include "bullet.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
extern bopti_image_t img_bullet_normal;
extern bopti_image_t img_bullet_blue;
extern bopti_image_t img_bullet_laser;
extern bopti_image_t img_bullet_enemy_blue;
extern bopti_image_t img_bullet_enemy_red;
extern bopti_image_t img_bullet_enemy_green;
Bullet::Bullet( uint16_t lx, uint16_t ly, int16_t dx, int16_t dy, uint8_t id )
{
x = libnum::num( lx );
y = libnum::num( ly );
sx = libnum::num( dx );
sy = libnum::num( dy );
ID=id;
if (ID==BULLET_NORMAL)
{
strength = 5;
}
else if (ID==BULLET_BLUE)
{
strength = 2;
}
else if (ID==BULLET_LASER)
{
strength = 1;
}
else if (ID==BULLET_ENEMY_BLUE)
{
strength = 2;
}
else if (ID==BULLET_ENEMY_RED)
{
strength = 3;
}
else if (ID==BULLET_ENEMY_GREEN)
{
strength = 5;
}
toberemoved = false;
}
Bullet::Bullet( libnum::num lx, libnum::num ly, libnum::num dx, libnum::num dy, uint8_t id )
{
x = lx;
y = ly;
sx = dx;
sy = dy;
ID=id;
if (ID==BULLET_NORMAL)
{
strength = 5;
}
else if (ID==BULLET_BLUE)
{
strength = 2;
}
else if (ID==BULLET_LASER)
{
strength = 1;
}
else if (ID==BULLET_ENEMY_BLUE)
{
strength = 2;
}
else if (ID==BULLET_ENEMY_RED)
{
strength = 3;
}
else if (ID==BULLET_ENEMY_GREEN)
{
strength = 5;
}
toberemoved = false;
}
Bullet::~Bullet()
{
}
void Bullet::Update( float dt )
{
libnum::num a = libnum::num( dt / 12000.0f );
x += sx * a;
y += sy * a;
if (x<-10 || x>azrp_width+10 || y<-10 || y>azrp_height+10) toberemoved=true;
}
void Bullet::Render( )
{
int16_t px = (int) x;
int16_t py = (int) y;
if (ID==BULLET_NORMAL)
{
azrp_image_p8( px-img_bullet_normal.width/2, py-img_bullet_normal.height/2, &img_bullet_normal, DIMAGE_NONE );
return;
}
else if (ID==BULLET_BLUE)
{
azrp_image_p8( px-img_bullet_blue.width/2, py-img_bullet_blue.height/2, &img_bullet_blue, DIMAGE_NONE );
return;
}
else if (ID==BULLET_LASER)
{
azrp_image_p8( px-img_bullet_laser.width/2, py-img_bullet_laser.height/2, &img_bullet_laser, DIMAGE_NONE );
return;
}
else if (ID==BULLET_ENEMY_BLUE)
{
azrp_image_p8( px-img_bullet_enemy_blue.width/2, py-img_bullet_enemy_blue.height/2, &img_bullet_enemy_blue, DIMAGE_NONE );
return;
}
else if (ID==BULLET_ENEMY_RED)
{
azrp_image_p8( px-img_bullet_enemy_red.width/2, py-img_bullet_enemy_red.height/2, &img_bullet_enemy_red, DIMAGE_NONE );
return;
}
else if (ID==BULLET_ENEMY_GREEN)
{
azrp_image_p8( px-img_bullet_enemy_green.width/2, py-img_bullet_enemy_green.height/2, &img_bullet_enemy_green, DIMAGE_NONE );
return;
}
}

View File

@ -4,10 +4,23 @@
#include <cstdint>
#include <num/num.h>
enum
{
BULLET_NORMAL,
BULLET_BLUE,
BULLET_LASER,
BULLET_ENEMY_BLUE,
BULLET_ENEMY_RED,
BULLET_ENEMY_GREEN,
};
class Bullet
{
public:
Bullet( uint16_t lx, uint16_t ly, uint8_t id );
Bullet( uint16_t lx, uint16_t ly, int16_t dx, int16_t dy, uint8_t id );
Bullet( libnum::num lx, libnum::num ly, libnum::num dx, libnum::num dy, uint8_t id );
~Bullet();
void Update( float dt );
void Render();

View File

@ -1,4 +1,7 @@
#include "../config.h"
#include "collections.h"
#include "trajectory.h"
#include <vector>
#include <gint/rtc.h>
@ -6,9 +9,10 @@
extern std::vector<Particle*> MyParticles;
extern std::vector<Bullet*> MyPlayerBullets;
extern std::vector<Bullet*> MyEnemiesBullets;
extern std::vector<Enemy*> MyEnemies;
extern std::vector<Impact*> MyImpacts;
extern Starfield *MyStarField;
extern std::vector<Trajectory*> MyTrajectories;
extern Player *MyPlayer;
@ -16,34 +20,36 @@ extern Player *MyPlayer;
void Create_Player_Shoot( uint8_t id )
{
if (id==0)
if (id==BULLET_NORMAL)
{
Bullet *b = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, id );
Bullet *b = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, 6, 0, id );
MyPlayerBullets.push_back( b );
}
else if (id==1)
else if (id==BULLET_BLUE)
{
Bullet *b1 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, id );
Bullet *b1 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, 5, 0, id );
MyPlayerBullets.push_back( b1 );
Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, id );
Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, 5, 0, id );
MyPlayerBullets.push_back( b2 );
}
else if (id==2)
else if (id==BULLET_LASER)
{
Bullet *b1 = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, id );
Bullet *b1 = new Bullet( (int) MyPlayer->x+21, (int) MyPlayer->y, 3, 0, id );
MyPlayerBullets.push_back( b1 );
Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, id );
Bullet *b2 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y-17, 3, 0, id );
MyPlayerBullets.push_back( b2 );
Bullet *b3 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, id );
Bullet *b3 = new Bullet( (int) MyPlayer->x, (int) MyPlayer->y+17, 3, 0, id );
MyPlayerBullets.push_back( b3 );
}
}
void Create_Ennemies( void )
void Create_Enemies( void )
{
/*
Enemy* e1 = new Enemy( 348, 112, 0);
e1->Set_Speed_Vector( 1, 1, -6 );
MyEnemies.push_back( e1 );
@ -59,32 +65,51 @@ void Create_Ennemies( void )
Enemy* e4 = new Enemy( 348, 112, 1);
e4->Set_Speed_Vector( 1, 3, 3 );
MyEnemies.push_back( e4 );
*/
Point2D *A = new Point2D( 348, 112 );
Point2D *B = new Point2D( 371, 199 );
Point2D *C = new Point2D( 198, 149 );
Point2D *D = new Point2D( 25, 199 );
Point2D *E = new Point2D( 25, 25 );
Point2D *F = new Point2D( 198, 75 );
Point2D *G = new Point2D( 371, 25 );
Vector2D *A = new Vector2D( 348, 112 );
Vector2D *B = new Vector2D( 371, 199 );
Vector2D *C = new Vector2D( 198, 149 );
Vector2D *D = new Vector2D( 25, 199 );
Vector2D *E = new Vector2D( 25, 25 );
Vector2D *F = new Vector2D( 198, 75 );
Vector2D *G = new Vector2D( 371, 25 );
Trajectory *MyTrajectory= new Trajectory();
MyTrajectory->AddPoint( A );
MyTrajectory->AddPoint( B );
MyTrajectory->AddPoint( C );
MyTrajectory->AddPoint( D );
MyTrajectory->AddPoint( E );
MyTrajectory->AddPoint( F );
MyTrajectory->AddPoint( G );
Trajectory *MyPath= new Trajectory();
MyPath->AddPoint( A );
MyPath->AddPoint( B );
MyPath->AddPoint( C );
MyPath->AddPoint( D );
MyPath->AddPoint( E );
MyPath->AddPoint( F );
MyPath->AddPoint( G );
MyTrajectories.push_back( MyPath );
Enemy* e5 = new Enemy( 348, 112, 2);
e5->hasTrajectory = true;
e5->pathToFollow = MyTrajectory;
e5->pathToFollow = MyPath;
MyPath->AddRegistry();
e5->Set_Accumulated_Time(0.0f);
Enemy* e6 = new Enemy( 348, 112, 2);
e6->hasTrajectory = true;
e6->pathToFollow = MyPath;
MyPath->AddRegistry();
e6->Set_Accumulated_Time(-1.0f);
Enemy* e7 = new Enemy( 348, 112, 2);
e7->hasTrajectory = true;
e7->pathToFollow = MyPath;
MyPath->AddRegistry();
e7->Set_Accumulated_Time(-2.0f);
MyEnemies.push_back( e5 );
MyEnemies.push_back( e6 );
MyEnemies.push_back( e7 );
}
@ -130,6 +155,28 @@ void Clean_Everything( void )
MyPlayerBullets.erase( MyPlayerBullets.begin() + i );
}
MyPlayerBullets.clear();
for(unsigned int i=0; i<MyEnemiesBullets.size(); i++)
{
delete( MyEnemiesBullets[i] );
MyEnemiesBullets.erase( MyEnemiesBullets.begin() + i );
}
MyEnemiesBullets.clear();
for(unsigned int i=0; i<MyImpacts.size(); i++)
{
delete( MyImpacts[i] );
MyImpacts.erase( MyImpacts.begin() + i );
}
MyImpacts.clear();
for(unsigned int i=0; i<MyTrajectories.size(); i++)
{
delete( MyTrajectories[i] );
MyTrajectories.erase( MyTrajectories.begin() + i );
}
MyTrajectories.clear();
}

View File

@ -3,17 +3,17 @@
#include "player.h"
#include "utilities.h"
#include "../utilities/utilities.h"
#include "particles.h"
#include "bullet.h"
#include "enemy.h"
#include "MyAzurShaders.h"
#include "../shaders/MyAzurShaders.h"
#include "impact.h"
#include "trajectory.h"
void Create_Player_Shoot( uint8_t id );
void Create_Ennemies( void );
void Create_Enemies( void );
void Create_Explosion( uint16_t xexplosion, uint16_t yexplosion );
void Create_Impact( uint16_t ximpact, uint16_t yimpact );

169
src/shmup/enemy.cpp Normal file
View File

@ -0,0 +1,169 @@
#include "../config.h"
#include "enemy.h"
#include "bullet.h"
#include <num/num.h>
#include <gint/rtc.h>
extern bopti_image_t img_Lifebar;
extern bopti_image_t img_mainship2;
extern bopti_image_t img_Enemy_Blue_Lvl1;
extern bopti_image_t img_Enemy_Red_Lvl1;
extern std::vector<Bullet*> MyEnemiesBullets;
Enemy::Enemy( int16_t _x, int16_t _y, uint8_t _id ) : Entity( _x, _y, _id )
{
dirx = 1;
diry = -6;
if (ID==0)
{
width = img_mainship2.width/2;
height = img_mainship2.height/2;
speed = 1;
life = 400;
}
else if (ID==1)
{
width = img_Enemy_Blue_Lvl1.width/2;
height = img_Enemy_Blue_Lvl1.height/2;
speed = 2;
life = 200;
}
else if (ID==2)
{
width = img_Enemy_Red_Lvl1.width/2;
height = img_Enemy_Red_Lvl1.height/2;
speed = 2;
life = 100;
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
lastshottime = 0;
}
Enemy::~Enemy()
{
}
void Enemy::Update( float dt )
{
if (!hasTrajectory)
{
libnum::num a = libnum::num( dt / 60000.0f );
x += a * libnum::num( dirx * speed );
y += a * libnum::num( diry * speed );
if (x<width || x>azrp_width-width) dirx=-1*dirx;
if (y<height || y>azrp_height-height) diry=-1*diry;
}
else
{
pathToFollow->CalculatePosition( &accumulatedTime, dt, speed, true, &x, &y );
}
xmin = (int) x - width;
xmax = (int) x + width;
ymin = (int) y - height;
ymax = (int) y + height;
uint32_t tempshoot = rtc_ticks();
if (Shoot_OK( tempshoot, 0 ))
{
if ( ID==0 )
{
Bullet *b = new Bullet( xmin, (int) y, -3, 0, BULLET_ENEMY_BLUE );
MyEnemiesBullets.push_back( b );
}
else if ( ID==1 )
{
Bullet *b1 = new Bullet( xmin, (int) y, -5, 0, BULLET_ENEMY_BLUE );
MyEnemiesBullets.push_back( b1 );
Bullet *b2 = new Bullet( xmin, (int) y, -5, 0, BULLET_ENEMY_BLUE );
MyEnemiesBullets.push_back( b2 );
}
else if ( ID==2 )
{
Bullet *b = new Bullet( xmin, (int) y, -1, 0, BULLET_ENEMY_BLUE );
MyEnemiesBullets.push_back( b );
}
}
if (life<=0) toberemoved=true;
}
void Enemy::Render( void )
{
azrp_subimage_p8_effect( (int) x - img_Lifebar.width/2, ymin - 10, &img_Lifebar, 0, 0, img_Lifebar.width, 7, DIMAGE_NONE );
int life0=100;
if (ID==0)
{
azrp_image_p8_effect(xmin, ymin, &img_mainship2, DIMAGE_NONE);
life0 = 400;
}
else if (ID==1)
{
azrp_image_p8_effect(xmin, ymin, &img_Enemy_Blue_Lvl1, DIMAGE_NONE);
life0 = 200;
}
else if (ID==2)
{
azrp_image_p8_effect(xmin, ymin, &img_Enemy_Red_Lvl1, DIMAGE_NONE);
life0 = 100;
}
if (life>life0*2/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 7, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
else if (life>life0/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 12, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
else azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 17, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
}
bool Enemy::Test_Impact( Bullet *projectile )
{
if (projectile->x >= xmin && projectile->x <= xmax && projectile->y >= ymin && projectile->y <= ymax )
{
life -= projectile->strength;
projectile->toberemoved = true;
return true;
}
else return false;
}
void Enemy::Set_Speed_Vector( uint8_t _sp, uint8_t _xd, uint8_t _yd )
{
speed = _sp;
dirx = _xd;
diry = _yd;
}
void Enemy::Set_Accumulated_Time( float value )
{
accumulatedTime = value;
}
bool Enemy::Shoot_OK( uint32_t tempshoot, uint8_t shootID )
{
if(tempshoot-lastshottime>15)
{
lastshottime=tempshoot;
return true;
}
else return false;
}

40
src/shmup/enemy.h Normal file
View File

@ -0,0 +1,40 @@
#ifndef ENEMY_H
#define ENEMY_H
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include "bullet.h"
#include "entity.h"
#include "trajectory.h"
class Enemy : public Entity
{
public:
Enemy( int16_t _x, int16_t _y, uint8_t _id );
~Enemy();
virtual void Update( float dt ) override;
virtual void Render( void ) override;
virtual bool Test_Impact( Bullet *projectile ) override;
void Set_Speed_Vector( uint8_t _sp, uint8_t _xd, uint8_t _yd);
virtual void Set_Accumulated_Time( float value );
private:
int8_t dirx, diry; // vector of the current direction of the ennemy (TODO : to implement more complex displacement pattern)
uint32_t lastshottime;
virtual bool Shoot_OK( uint32_t tempshoot, uint8_t shootID );
};
#endif

34
src/shmup/entity.cpp Normal file
View File

@ -0,0 +1,34 @@
#include "entity.h"
#include <num/num.h>
Entity::Entity( int16_t _x, int16_t _y, uint8_t _id )
{
x = libnum::num(_x);
y = libnum::num(_y);
ID = _id;
toberemoved = false;
hasTrajectory = false;
accumulatedTime = 0.0f;
}
Entity::~Entity( void )
{
if (hasTrajectory)
pathToFollow->DeleteRegistry();
}
void Entity::Update( float dt )
{
}
void Entity::Render( void )
{
}
bool Entity::Test_Impact( Bullet *projectile )
{
}

39
src/shmup/entity.h Normal file
View File

@ -0,0 +1,39 @@
#ifndef ENTITY_H
#define ENTITY_H
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include <sys/types.h>
#include "bullet.h"
#include "trajectory.h"
class Entity
{
public:
Entity( int16_t _x, int16_t _y, uint8_t _id );
virtual ~Entity();
virtual void Update( float dt );
virtual void Render( void );
virtual bool Test_Impact( Bullet *projectile );
libnum::num x, y; // center position of the boss
uint8_t width, height; // width and height -for the hitbox
int16_t xmin, xmax, ymin, ymax; // square hitbox (to speed up the bullet impact calculations)
uint8_t ID;
uint8_t speed; // speed of the boss
int16_t life;
bool toberemoved;
bool hasTrajectory = false;
Trajectory *pathToFollow;
float accumulatedTime;
int16_t life0;
};
#endif

View File

@ -1,3 +1,5 @@
#include "../config.h"
#include "impact.h"

View File

@ -1,3 +1,5 @@
#include "../config.h"
#include "particles.h"
#include <azur/azur.h>

View File

@ -1,27 +1,41 @@
#include "../config.h"
#include "player.h"
#include "bullet.h"
#include "enemy.h"
#include <num/num.h>
#include <gint/rtc.h>
#include <math.h>
#include "../utilities/fast_trig.h"
#include "background.h"
extern bopti_image_t img_mainship1;
extern bopti_image_t img_Lifebar;
extern bopti_image_t *img_mainship1;
extern bopti_image_t img_player_ship1;
extern bopti_image_t img_player_ship2;
extern bopti_image_t img_player_ship3;
extern bopti_image_t img_player_ship4;
extern bopti_image_t img_player_ship5;
extern bopti_image_t img_player_ship6;
extern bopti_image_t img_player_ship7;
extern bopti_image_t img_player_ship8;
extern bopti_image_t img_Satellite_Lvl1;
static int16_t cosTable[360], sinTable[360];
#define PI 3.141592
extern Background MyBackground;
Player::Player( int16_t _x, int16_t _y, uint8_t _id )
{
img_mainship1 = &img_player_ship7;
x = libnum::num(_x);
y = libnum::num(_y);
ID = _id;
width = img_mainship1.width/2;
height = img_mainship1.height/2;
speed = 5;
width = img_mainship1->width/2;
height = img_mainship1->height/2;
speed = 10;
xmin = (int) x - width;
xmax = (int) x + width;
@ -36,16 +50,10 @@ Player::Player( int16_t _x, int16_t _y, uint8_t _id )
satellites = true;
satLevel = 1;
satNumber = 6;
satNumber = 3;
satAngle = 0;
satRadius = 50;
satSpeed = 2;
for(int u=0; u<360; u++)
{
cosTable[u] = (int16_t) (satRadius*cos( u * PI / 180 ));
sinTable[u] = (int16_t) (satRadius*sin( u * PI / 180 ));
}
}
Player::~Player()
@ -70,7 +78,9 @@ void Player::Update( float dt )
void Player::Render( void )
{
if (ID==0) azrp_image_p8_effect(xmin, ymin, &img_mainship1, DIMAGE_NONE);
azrp_subimage_p8_effect( (int) x - img_Lifebar.width/2, ymin - 10, &img_Lifebar, 0, 0, img_Lifebar.width, 7, DIMAGE_NONE );
if (ID==0) azrp_image_p8_effect(xmin, ymin, img_mainship1, DIMAGE_NONE);
int w = img_Satellite_Lvl1.width/2;
int h = img_Satellite_Lvl1.height/2;
@ -83,11 +93,18 @@ void Player::Render( void )
{
int angle = (int) satAngle + u*incangle;
angle = angle % 360;
int xsat = (int) x + cosTable[angle];
int ysat = (int) y + sinTable[angle];
int xsat = (int) (x + FastCosInt( angle ) * libnum::num( satRadius) );
int ysat = (int) (y + FastSinInt( angle ) * libnum::num( satRadius) );
azrp_image_p8_effect(xsat-w, ysat-h, &img_Satellite_Lvl1, DIMAGE_NONE);
}
}
int16_t life0=1000;
if (life>life0*2/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 7, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
else if (life>life0/3) azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 12, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
else azrp_subimage_p8_effect((int) x - img_Lifebar.width/2, ymin - 9, &img_Lifebar, 0, 17, (img_Lifebar.width*life)/life0, 5, DIMAGE_NONE );
}
@ -102,7 +119,20 @@ bool Player::Test_Impact( Bullet *projectile )
else return false;
}
bool Player::Test_Impact( Enemy *adverseship )
bool Player::Test_Impact( Bonus *bonus )
{
if (bonus->x >= xmin && bonus->x <= xmax && bonus->y >= ymin && bonus->y <= ymax )
{
if (bonus->ID==0) life = 1000;
else if (bonus->ID==1) satNumber++;
bonus->toberemoved = true;
return true;
}
else return false;
}
bool Player::Test_Collision( Enemy *adverseship )
{
if (adverseship->xmax >= xmin && adverseship->xmin <= xmax && adverseship->ymax >= ymin && adverseship->ymin <= ymax )
{
@ -120,7 +150,7 @@ void Player::Set_Speed( uint8_t _sp )
bool Player::Shoot_OK( uint32_t tempshoot, uint8_t shootID )
{
if (shootID==0)
if (shootID==BULLET_NORMAL)
{
if(tempshoot-lastshoot0>8)
{
@ -129,7 +159,7 @@ bool Player::Shoot_OK( uint32_t tempshoot, uint8_t shootID )
}
else return false;
}
else if (shootID==1)
else if (shootID==BULLET_BLUE)
{
if(tempshoot-lastshoot1>15)
{
@ -138,7 +168,7 @@ bool Player::Shoot_OK( uint32_t tempshoot, uint8_t shootID )
}
else return false;
}
else if (shootID==2)
else if (shootID==BULLET_LASER)
{
if(tempshoot-lastshoot2>2)
{
@ -178,6 +208,12 @@ void Player::Go_Up( float dt )
y -= a * libnum::num( speed );
this->Update( 0.0f );
}
if (y<azrp_height/4)
{
libnum::num a = libnum::num( -1.0f * dt / 90000.0f );
MyBackground.IncYCoordinate( a );
}
}
void Player::Go_Down( float dt )
@ -186,6 +222,12 @@ void Player::Go_Down( float dt )
{
libnum::num a = libnum::num( dt / 60000.0f );
y += a * libnum::num( speed );
this->Update( 0.0f );
this->Update( 0.0f );
}
if (y>3*azrp_height/4)
{
libnum::num a = libnum::num( dt / 90000.0f );
MyBackground.IncYCoordinate( a );
}
}

View File

@ -10,7 +10,7 @@
#include <num/num.h>
#include "bullet.h"
#include "enemy.h"
#include "bonus.h"
class Player
{
@ -21,8 +21,9 @@ class Player
void Update( float dt );
void Render( void );
bool Test_Impact( Bullet *projectile );
bool Test_Impact( Enemy *adverseship );
bool Test_Impact( Bullet *projectile );
bool Test_Impact( Bonus *bonus );
bool Test_Collision( Enemy *adverseship );
void Set_Speed( uint8_t _sp );
bool Shoot_OK( uint32_t tempshoot, uint8_t shootID );

View File

@ -1,45 +1,59 @@
#include "../config.h"
#include "trajectory.h"
Trajectory::Trajectory( )
{
accumulatedTime = 0.0f;
registration = 0;
//accumulatedTime = 0.0f;
}
Trajectory::~Trajectory( )
{
for( auto& p : ControlPoints )
delete( p );
ControlPoints.clear();
for( auto& p : ControlPoints )
delete( p );
ControlPoints.clear();
}
void Trajectory::AddPoint( Point2D *p )
void Trajectory::AddPoint( Vector2D *p )
{
ControlPoints.push_back( p );
}
void Trajectory::CalculatePosition( float time, uint16_t speed, bool looped, libnum::num *xreturn, libnum::num *yreturn )
void Trajectory::AddRegistry( void )
{
accumulatedTime += speed * time / 2000000.0f;
if (accumulatedTime>ControlPoints.size()) accumulatedTime-=ControlPoints.size();
registration++;
}
libnum::num t = libnum::num( accumulatedTime - (int) accumulatedTime );
void Trajectory::DeleteRegistry( void )
{
registration--;
}
void Trajectory::CalculatePosition( float *accumulatedTime, float time, uint16_t speed, bool looped, libnum::num *xreturn, libnum::num *yreturn )
{
*accumulatedTime += speed * time / 2000000.0f;
if (*accumulatedTime>ControlPoints.size()) *accumulatedTime-=ControlPoints.size();
if (*accumulatedTime<0) *accumulatedTime+=ControlPoints.size();
libnum::num t = libnum::num( *accumulatedTime - (int) *accumulatedTime );
int p0, p1, p2, p3;
if (!looped)
{
p1 = (int) accumulatedTime + 1;
p1 = (int) *accumulatedTime + 1;
p2 = p1 + 1;
p3 = p2 + 1;
p0 = p1 - 1;
}
else
{
p1 = (int) accumulatedTime;
p1 = (int) *accumulatedTime;
p2 = (p1 + 1) % ControlPoints.size();
p3 = (p2 + 1) % ControlPoints.size();
p0 = p1 >= 1 ? p1 - 1 : ControlPoints.size() - 1;

33
src/shmup/trajectory.h Normal file
View File

@ -0,0 +1,33 @@
#ifndef TRAJECTORY_H
#define TRAJECTORY_H
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include <vector>
#include "../utilities/vector2D.h"
#include "num/num.h"
class Trajectory
{
public:
Trajectory( );
~Trajectory( );
void AddPoint( Vector2D *p );
void AddRegistry( void );
void DeleteRegistry( void );
void CalculatePosition( float *accumulatedTime, float time, uint16_t speed, bool looped, libnum::num *xreturn, libnum::num *yreturn );
std::vector<Vector2D*> ControlPoints;
bool isLoop;
uint16_t registration;
//float accumulatedTime;
};
#endif

View File

@ -1,159 +0,0 @@
#include "starfield.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <cstdint>
#include <stdlib.h>
#include <gint/rtc.h>
#include <num/num.h>
#include "MyAzurShaders.h"
Star::Star( void )
{
x = libnum::num( rand() % 396 );
y = libnum::num( rand() % 224 );
size = 1 + ( rand() % 4 );
sx = libnum::num( -1*size );
sy = 0;
int colorrandom = rand() % 4;
color = 0xFFFF;
/*
if (colorrandom==0) color = 0xFFFF;
else if (colorrandom==1) color = 0xFFE0;
else if (colorrandom==2) color = 0xFB80;
else color = 0xF80D;
*/
}
Star::~Star()
{
}
void Star::Update( libnum::num dt )
{
//libnum::num a = libnum::num( dt / 12000.0f );
//y += sy * a;
x += sx * dt;
y += sy * dt;
if (y<-3 || y > 226 || x<-3 || x>398)
{
x = 396;
y = libnum::num( rand() % 224 );
}
}
Starfield::Starfield( )
{
srand(rtc_ticks());
for(int i=0; i<100; i++)
{
Star *s = new Star( );
MyStars.push_back( s );
}
}
Starfield::~Starfield( )
{
for(auto& s : MyStars)
delete(s);
for(auto& list : PixelListPerFragment)
{
for(auto& p : list)
delete(p);
list.clear();
}
MyStars.clear();
}
void Starfield::Update( float dt )
{
libnum::num a = libnum::num( dt / 50000.f );
for(auto& s : MyStars)
s->Update( a );
}
void Starfield::AddPixel( int x, int y, int c )
{
// check if the point is in the range screen
if(x >= azrp_width || x < 0 || y >= azrp_height || y < 0)
return;
uint8_t current_frag = y >> 4; // each fragment is 16pixel high : so fragment number for the current point is y/16 or y>>4
Pixel *MyPix = new Pixel( x, y & 15, c ); // consider the local offset of the point in the current fragment (y & 15)
PixelListPerFragment[ current_frag ].push_back( MyPix ); // add the pixel to the appropriate list
}
void Starfield::Render( void )
{
for(auto& list : PixelListPerFragment)
{
for(auto& p : list)
{
delete(p);
}
list.clear();
}
for(auto& s : MyStars)
{
//TODO :The only considered case is for a small star 1x1 pixel
//TODO :Other sizes to be added right after this case
if (s->size==1)
{
AddPixel( s->x, (int) s->y, s->color );
}
else if (s->size==2)
{
AddPixel( s->x, (int) s->y, s->color );
AddPixel( s->x+1, (int) s->y, s->color );
AddPixel( s->x, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y+1, s->color );
}
else if (s->size==3)
{
AddPixel( s->x+1, (int) s->y, s->color );
AddPixel( s->x-1, (int) s->y+1, s->color );
AddPixel( s->x, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y+2, s->color );
}
else if (s->size==4)
{
AddPixel( s->x-1, (int) s->y-1, s->color );
AddPixel( s->x-1, (int) s->y, s->color );
AddPixel( s->x-1, (int) s->y+1, s->color );
AddPixel( s->x, (int) s->y-1, s->color );
AddPixel( s->x, (int) s->y, s->color );
AddPixel( s->x, (int) s->y+1, s->color );
AddPixel( s->x+1, (int) s->y-1, s->color );
AddPixel( s->x+1, (int) s->y, s->color );
AddPixel( s->x+1, (int) s->y+1, s->color );
}
}
// call the PixelList shader with the appropriate lists
for(unsigned int i=0; i<14; i++)
//for(unsigned int i=0; i<PixelListPerFragment.size(); i++)
if (!PixelListPerFragment[i].empty())
azrp_pixellist( PixelListPerFragment[i], i );
}

View File

@ -1,57 +0,0 @@
#ifndef STARS_H
#define STARS_H
#include <cstdint>
#include <num/num.h>
#include <vector>
#include <array>
class Star
{
public:
Star();
~Star();
//void Update( float dt );
void Update( libnum::num dt );
libnum::num x;
libnum::num y;
libnum::num sx;
libnum::num sy;
uint8_t size;
uint16_t color;
};
class Pixel
{
public:
int x, y, c;
Pixel( int _x, int _y, int _c)
{
x = _x;
y = _y;
c = _c;
};
~Pixel() {};
};
class Starfield
{
public:
// the Star collection
std::vector<Star*> MyStars;
// list of all pixels to be rendered by Azur pixel shader fragment by fragment
std::array<std::vector<Pixel*>,14> PixelListPerFragment;
Starfield( );
~Starfield( );
void Update( float dt );
void Render( void );
private:
void AddPixel( int x, int y, int c );
};
#endif //STARS_H

View File

@ -1,27 +0,0 @@
#ifndef TRAJECTORY_H
#define TRAJECTORY_H
#include <cstdint>
#include <stdlib.h>
#include <num/num.h>
#include <vector>
#include "point2D.h"
#include "num/num.h"
class Trajectory
{
public:
Trajectory( );
~Trajectory( );
void AddPoint( Point2D *p );
void CalculatePosition( float time, uint16_t speed, bool looped, libnum::num *xreturn, libnum::num *yreturn );
std::vector<Point2D*> ControlPoints;
bool isLoop;
float accumulatedTime;
};
#endif

View File

@ -1,27 +0,0 @@
#include <azur/azur.h>
#include <azur/gint/render.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fxlibc/printf.h>
/* Render text with Azur images - quite bad, but I don't have time lol. */
void Azur_draw_text(int x, int y, char const *fmt, ...)
{
char str[128];
va_list args;
va_start(args, fmt);
vsnprintf(str, 128, fmt, args);
va_end(args);
extern bopti_image_t img_font;
for(int i = 0; str[i]; i++) {
if(str[i] < 32 || str[i] >= 0x7f) continue;
int row = (str[i] - 32) >> 4;
int col = (str[i] - 32) & 15;
azrp_subimage(x + 5 * i, y, &img_font, 7 * col + 1, 9 * row + 1, 6, 8, DIMAGE_NONE);
}
}

View File

@ -1,6 +0,0 @@
#ifndef UTILITIES_H
#define UTILITIES_H
void Azur_draw_text(int x, int y, char const *fmt, ...);
#endif

View File

@ -1,3 +1,5 @@
#include "../config.h"
#include "extrakeyboard.h"
#include <gint/keyboard.h>
#include <gint/rtc.h>

183
src/utilities/fast_trig.cpp Normal file
View File

@ -0,0 +1,183 @@
#include "fast_trig.h"
#include "num/num.h"
static libnum::num cosTable[360];
static libnum::num sinTable[360];
static bool is_fast_trig_initialised = false;
void Fast_Trig_Init( void )
{
for(int u=0; u<360; u++)
{
cosTable[u] = libnum::num( cos( u * PI / 180 ) );
sinTable[u] = libnum::num( sin( u * PI / 180 ) );
}
is_fast_trig_initialised = true;
}
libnum::num FastCosInt( int16_t angle )
{
if (!is_fast_trig_initialised) Fast_Trig_Init();
if (angle>=0 and angle<360) return cosTable[ angle ];
else
{
int16_t input = angle;
if (input<0)
{
while (input<0) input+=360;
return cosTable[ input ];
}
else
{
while (input>=360) input-=360;
return cosTable[ input ];
}
}
}
libnum::num FastSinInt( int16_t angle )
{
if (!is_fast_trig_initialised) Fast_Trig_Init();
if (angle>=0 and angle<360) return sinTable[ angle ];
else
{
int16_t input = angle;
if (input<0)
{
while (input<0) input+=360;
return sinTable[ input ];
}
else
{
while (input>=360) input-=360;
return sinTable[ input ];
}
}
}
libnum::num FastTanInt( int16_t angle )
{
if (!is_fast_trig_initialised) Fast_Trig_Init();
int16_t input = angle;
if (input<0)
{
while (input<0) input+=360;
}
else if (input>=360)
{
while (input>=360) input-=360;
}
libnum::num value;
if (input==90)
{
value.v = INT32_MAX;
return value;
}
else if (input==270)
{
value.v = INT32_MIN;
return value;
}
else
{
value = FastSinInt(input) / FastCosInt(input);
return value;
}
}
libnum::num32 sqrt_num32(libnum::num32 v) {
uint32_t t, q, b, r;
r = v.v;
b = 0x40000000;
q = 0;
while (b > 0x40) {
t = q + b;
if (r >= t) {
r -= t;
q = t + b;
}
r <<= 1;
b >>= 1;
}
q >>= 8;
libnum::num32 ret;
ret.v = q;
return ret;
}
/* TO DO : rework these functions for sine and cosine calculation */
libnum::num32 cos_num32(libnum::num32 angle) {
// Taylor serie for cos(x) = 1 - x²/2! + x⁴/4! + x⁶/6! + x⁸/8! + ...
// Cosine function is even
if (angle < libnum::num32(0))
return cos_num32(-angle);
// Look for an angle in the range [0, 2*pi [
libnum::num32 anglereduced = angle;
while (anglereduced >= libnum::num32(2 * PI))
anglereduced -= libnum::num32(2 * PI);
// Exploit the symetry for angle and angle+Pi to reduce the order of the
// limited developpement
if (anglereduced >= libnum::num(PI))
return -cos_num32(anglereduced - libnum::num(PI));
libnum::num32 sum = libnum::num32(1);
libnum::num32 angle2 = anglereduced * anglereduced;
// set first value of the Taylor serie : x⁰/0! = 1/1
libnum::num32 numerator = libnum::num32(1);
libnum::num32 denominator = libnum::num32(1);
for (int i = 2; i <= 8; i += 2) {
numerator *= (-angle2);
denominator *= libnum::num32(i - 1) * libnum::num32(i);
sum += (numerator / denominator);
}
return sum;
}
libnum::num32 sin_num32(libnum::num32 angle) {
// Taylor serie for cos(x) = x/1! - x³/3! + x⁵/5! - x⁷/7! + x⁹/9! + ...
// Sine function is odd
if (angle < libnum::num32(0))
return -sin_num32(-angle);
// Look for an angle in the range [0, 2*pi [
libnum::num32 anglereduced = angle;
while (anglereduced >= libnum::num32(2 * PI))
anglereduced -= libnum::num32(2 * PI);
// Exploit the symetry for angle and angle+Pi to reduce the order of the
// limited developpement
if (anglereduced >= libnum::num(PI))
return -sin_num32(anglereduced - libnum::num(PI));
libnum::num32 sum = anglereduced;
libnum::num32 angle2 = anglereduced * anglereduced;
// set first value of the Taylor serie : x¹/1! = x/1
libnum::num32 numerator = anglereduced;
libnum::num32 denominator = libnum::num32(1);
for (int i = 2; i <= 8; i += 2) {
numerator *= (-angle2);
denominator *= libnum::num32(i) * libnum::num32(i + 1);
sum += (numerator / denominator);
}
return sum;
}

22
src/utilities/fast_trig.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef FAST_TRIG_H
#define FAST_TRIG_H
#include <cmath>
#include <num/num.h>
#define PI 3.14159265
void Fast_Trig_Init( void );
libnum::num FastCosInt( int16_t angle );
libnum::num FastSinInt( int16_t angle );
libnum::num FastTanInt( int16_t angle );
libnum::num32 sqrt_num32(libnum::num32 v);
libnum::num32 cos_num32(libnum::num32 angle);
libnum::num32 sin_num32(libnum::num32 angle);
#endif

214
src/utilities/utilities.cpp Normal file
View File

@ -0,0 +1,214 @@
#include "../config.h"
#include <azur/azur.h>
#include <azur/gint/render.h>
#include "utilities.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <fxlibc/printf.h>
#include <sys/types.h>
extern font_t milifont_prop;
void Azur_draw_text(int x, int y, char const *fmt, ...)
{
char str[128];
va_list args;
va_start(args, fmt);
vsnprintf(str, 128, fmt, args);
va_end(args);
dfont( &milifont_prop );
azrp_text( x, y, C_WHITE, str );
}
bool AABB_Collision( SpriteLocator image1, SpriteLocator image2 )
{
if( (image2.x >= image1.x + image1.image->width)
|| (image2.x + image2.image->width <= image1.x)
|| (image2.y >= image1.y + image1.image->height)
|| (image2.y + image2.image->height <= image1.y) )
return false;
// no need to do pixel perfect detection
return true;
}
bool Pixel_Perfect_Collision( SpriteLocator image1, SpriteLocator image2 )
{
if( !AABB_Collision( image1, image2 ) )
return false; // bounding boxes not overlapping, impossible to have collision
/* if we reach that point, this means that we need to perform pixel perfect collsion detection */
/* First we will calculate the corners of the zone to be tested for collision */
/* as it is not usefull to check for all the surface of the image, only the */
/* overlapping area will be verified */
/* WARNING !! */
/* P4 format is not supported yet has it is currently focused on use with Azur */
/* that is mostly P8/RGB565 oriented for ultra fast performances */
if ( IMAGE_IS_P4(image1.image->format) || IMAGE_IS_P4(image2.image->format) )
return false;
int astartx, aendx;
int astarty, aendy;
int adeltax, adeltay;
int bstartx, bendx;
int bstarty, bendy;
int bdeltax, bdeltay;
int rows, columns;
if (image1.x <= image2.x)
{
adeltax = image2.x - image1.x;
columns = MIN(image1.image->width - adeltax, image2.image->width);
bdeltax = 0;
}
else
{
bdeltax = image1.x - image2.x;
columns = MIN(image2.image->width - bdeltax, image1.image->width);
adeltax = 0;
}
if (image1.y <= image2.y)
{
adeltay = image2.y - image1.y;
rows = MIN(image1.image->height - adeltay, image2.image->height);
bdeltay = 0;
}
else
{
bdeltay = image1.y - image2.y;
rows = MIN(image2.image->height - bdeltay, image1.image->height);
adeltay = 0;
}
/* if BOTH images are in a 16bits color format, we will not use masks and will quicken the process */
if ( IMAGE_IS_RGB16(image1.image->format) && IMAGE_IS_RGB16(image2.image->format) )
{
void *data1 = image1.image->data + adeltay * image1.image->stride;
void *data2 = image2.image->data + bdeltay * image2.image->stride;
uint16_t *data_u16_1 = (uint16_t *) data1;
uint16_t *data_u16_2 = (uint16_t *) data2;
int transp1 = image_alpha(image1.image->format);
int transp2 = image_alpha(image2.image->format);
for( int j=0; j<rows; j++)
{
for (int i=0; i<columns; i++)
{
if( (data_u16_1[ adeltax + i ] != transp1 )
&& (data_u16_2[ bdeltax + i ] != transp2 ) )
return true;
}
data1 += image1.image->stride;
data_u16_1 = (uint16_t *) data1;
data2 += image2.image->stride;
data_u16_2 = (uint16_t *) data2;
}
return false;
}
/* if BOTH images are in a 8bits color format, we will not use masks and will quicken the process */
if ( IMAGE_IS_P8(image1.image->format) && IMAGE_IS_P8(image2.image->format) )
{
void *data1 = image1.image->data + adeltay * image1.image->stride;
void *data2 = image2.image->data + bdeltay * image2.image->stride;
int8_t *data_u8_1 = (int8_t *) data1;
int8_t *data_u8_2 = (int8_t *) data2;
int transp1 = image_alpha(image1.image->format);
int transp2 = image_alpha(image2.image->format);
for( int j=0; j<rows; j++)
{
for (int i=0; i<columns; i++)
{
if( (data_u8_1[ adeltax + i ] != transp1 )
&& (data_u8_2[ bdeltax + i ] != transp2 ) )
return true;
}
data1 += image1.image->stride;
data_u8_1 = (int8_t *) data1;
data2 += image2.image->stride;
data_u8_2 = (int8_t *) data2;
}
return false;
}
/* if we reach that point, this means that images have differnt format and we need to manage this */
uint8_t d1;
uint8_t d2;
void *data1 = image1.image->data + adeltay * image1.image->stride;
void *data2 = image2.image->data + bdeltay * image2.image->stride;
int8_t *data_u8_1 = (int8_t *) data1;
uint16_t *data_u16_1 = (uint16_t *) data1;
int8_t *data_u8_2 = (int8_t *) data2;
uint16_t *data_u16_2 = (uint16_t *) data2;
int transp1 = image_alpha(image1.image->format);
int transp2 = image_alpha(image2.image->format);
bool im1_P16 = IMAGE_IS_RGB16(image1.image->format);
bool im1_P8 = IMAGE_IS_P8(image1.image->format);
bool im2_P16 = IMAGE_IS_RGB16(image2.image->format);
bool im2_P8 = IMAGE_IS_P8(image2.image->format);
for( int j=0; j<rows; j++)
{
for (int i=0; i<columns; i++)
{
/* d1 is set to 1 if pixel of image1 is not transparent and to 0 if transparent */
/* need to be format dependant here so quite time consumming test at each loop :( )*/
if (im1_P16)
d1 = data_u16_1[ adeltax + i ] == transp1 ? 0 : 1;
else if (im1_P8)
d1 = data_u8_1[ adeltax + i ] == transp1 ? 0 : 1;
/* d2 is set to 1 if pixel of image2 is not transparent and to 0 if transparent */
/* need to be format dependant here so quite time consumming test at each loop :( )*/
if (im2_P16)
d2 = data_u16_2[ bdeltax + i ] == transp2 ? 0 : 1;
else if (im2_P8)
d2 = data_u8_2[ bdeltax + i ] == transp2 ? 0 : 1;
/* if d1 + d2 = 2 means that both coincident pixels are not transparent and then we have collision*/
if (d1 + d2 == 2) return true;
}
/* we move the pointer to the next line of both images */
data1 += image1.image->stride;
data2 += image2.image->stride;
data_u8_1 = (int8_t *) data1;
data_u8_2 = (int8_t *) data2;
data_u16_1 = (uint16_t *) data1;
data_u16_2 = (uint16_t *) data2;
}
return false;
}

Some files were not shown because too many files have changed in this diff Show More