diff options
Diffstat (limited to 'archive/blr2')
43 files changed, 15181 insertions, 0 deletions
diff --git a/archive/blr2/COPYING b/archive/blr2/COPYING new file mode 100644 index 0000000..bf98efc --- /dev/null +++ b/archive/blr2/COPYING @@ -0,0 +1,51 @@ +BLRII itself distributes under the terms of the BSD license. +Varieties of hge-unix and hge included in the source code distribution are still zlib-licensed. +Here's the text of the BSD license and the zlib license. +============================================================================================== +Copyright (c) 2014, Chris Xiong +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of "Chrisoft" nor the names of its contributors may + be used to endorse or promote products derived from this software + without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL CHRIS XIONG BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +============================================================================================== +Copyright (c) 2003-2008 Relish Games + 2011 Ryan C. Gordon + 2013-2014 Chris Xiong + + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from +the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + +2. Altered source versions must be plainly marked as such, and must not + be misrepresented as being the original software. + +3. This notice may not be removed or altered from any source distribution. diff --git a/archive/blr2/ChangeLog b/archive/blr2/ChangeLog new file mode 100755 index 0000000..cbd158e --- /dev/null +++ b/archive/blr2/ChangeLog @@ -0,0 +1,728 @@ +=================================================================== +Next version: +The final release is just there!! +Todo's: +Bug fixes. +Tests. + +Known bugs: +Blue bullets appearing in Vortex of leaves.//don't know why... + +Wishlist: <-strikethrough +~~Now Playing(Music Room)~~ +~~BLR script virtual machine~~(Now working for BLR3) + +Releases: + +1.0.0-0 (r101) +Fix a bug in the hgeft library, and try git... + +1.0.0-0 (r100) +Rev. 100!!! +This is the final release. +No more major changes will be made. +Further changes of BLR2 will only be bug fixes (BGM addition +excluded). + +Changes: +Fix screenshot excluding the info panel. +Make Lv-2P4 harder (reporter: BLumia). +If it is the first time you start BLR in Windows, resolution in +the options menu will be "?". Fixed now. +Fixed a critical bug in scorec.h. + +Pre-Released versions: + +0.9.9-0 (r99) +Rev. 99! WTF? +THIS IS THE FINAL RELEASE CANDIDATE!!! +Everything is frozen, that means no more new features will be +added and no big changes will be made after this revision. Only +bug fixes will be provided. +//Again, "frozen" is a term borrowed from the Debian project and +//is completely unrelated to Cirno! + +Tweak bullet9, shrink its removal border. +Change Multpo texture, add spawning effect. +Fix stubbed rankings. +Update sprite sheet. +Store assessment total elapsed time in the score file. Score +files from older revisions shouldn't cause any errors but you may +get "Time elapsed 0.00" in highscore details. If you've got any +sort of OCD (Obsessive-compulsive disorder), just remove it. +Document!!! + +0.9.8-0 (r98) +Dear Pre-Release Candidate version(RC-0). + +CLR will collect multiplier +1's in range now. +Multiplier +1's caught by player won't disappear now. +Add/Move background transitions. +Add volume control to options. This make the configuration file +not compatible with older versions. Just delete it! +Modify hge's API so that it can handle real volume and pan values. +Volume value varys from 0 to 1, pan value varys from -1 to 1. +Document... + +0.9.7-0 (r97) +Fix: small semi-coll bullets are collected by clr... +Add Multpo's for Level 7/-1. +Do slight changes to level -1... +Distribute CLRs for level 1~-1. + +0.9.6-0 (r96) +Fix bug that cause you unable to charge if you try to use clr directly +after your clr's used up. +Add Multpo's for Level 3/4/5/6, and level 7 partically. +Fix stupid bug in Level4Part2 and other similiar parts. +Fix several bugs in level 5/6. +Reduce given-away score in level "Sine Wave". It wassssSssss too long! +Fix typo... +Blinking HangUpText *should* be fixed now... + +0.9.5-0 (r95) +Change configuration and score file names. Files with their names +begin with "." may be annoying in Windows though... +If we find a score file during first start up, assume it's valid and +don't overwrite it. +Fix the problem that in-game music won't be resumed when back from pause. +Fix the problem that Multpo's won't be removed if a new game is created. +Fix the problem that the first tip is not shown correctly if the game +is restarted. +(Probably) fixed the problem that the sound is played out of game. +Prevent Multpo's from "escaping". This happens when fps is extremely low... +Adding Multpo for Level2. +Update CanonTechno. + +0.9.2-0 (r94) +Mod, mod, mod...! +Assessment mode is mostly frozen now. +I'll make a pre-release at r99 and that revision will be set to +0.9.9-0. +Write the document... That's really tiring. + +~~0.9.1-4 (r94)~~ +Ooooooooops... I've forgotten to commit this one! +So this is merged to the revision above, actually. +================================================================================= +Modify a couple of levels. (Making them easier...) +Fix about scene text rendering out of the window. +(Probably) fixed Level3Part3 by making them temporarily invulnerable... +Are we bug-free now? + +0.9.1-4 (r93) +Picking it up after almost one month... I'm now lost in my code... +--------------------------------------------------------------------------------- +Add player position display into debug display. +Rewrite pinball, adding collision between the balls... +The collision code is based on Kollision (a game included in KDE SC). + +0.9.1-3 (r92) +I installed Archlinux alongside Debian recently. Now we officially support +Archlinux and Debian. +Archlinux doesn't eat my CPU or try to destroy it... So further development will +be made mainly under archlinux... +--------------------------------------------------------------------------------- +Content freeze -- nothing will be added or removed any more (music etc excluded). +Fix build failure in Archlinux. +Fix font issue in Archlinux. +realloc may change the base address... That's the cause of the crashes... +--now removing all Bullet* based implementations. +Affected parts: +Assessment: Constant patterns, pinball +All parts in level 2. +L4P2, and more +L5P5~6 +L-1P17 +L-1P19 +L3P3 +L7P12 +L7P14 +L7P25 +Avoid memory leaks... I don't know if they have been really fixed... + +0.9.1-2 (r91) +Add built-in help. +Now the pause menu should be fixed... +Compress resources again. + +0.9.1-1 (r90) +Fix a bug in the credit scene. +Now the pause menu shouldn't be broken now...(It's so hard to reproduce +that I have to assume it *has* been fixed.(IT STILL HAPPENS!!!) +Close the "infinity CLR" "bug". +(Huge) Code cleanup, mainly removing duplicate code. +Allocate bullets dynamically. The array is freed every time a new game +is started. +Add a signal handler, print back trace on error(currently only available +for linux...). + +0.9.1-1 (r89) +Fix a critical bug in Score_Initailize. +Modify level pinball. +Drop "_PR" in version string. +Partly rewrite the credit scene, displaying accurate version +details. +Remove some warnings from hgewin. +A set of basic tests are done on a Intel+Nvidia desktop computer. +Add a simple build script(instead of makefile). +Reduce the Windows version executable size...(local work, recompile +freetype using reduced features enabled.) +Current tested (by me) and worked plantforms: +Debian sid x86_64/Windows 8.1 @Intel core i7-2670QM, 8GiB RAM, +Intel HD3000. +Debian sid x86_64 @Intel Core2 Quad Q8300, 8GiB RAM, nvidia GT320. +Windows XP x64 @VirutalBox, Dualcore Virtual CPU, 1.5GiB RAM, VBox +Addons installed. +Windows XP @Intel core i3-3240, 4GiB RAM, Intel HD3000. + +0.9.1-1_PR (r88) +%lld seems to work with mingw-w64(also VS2005+)... +So let's remove all %I64d. +Change point bullet behaviour. +Fix a minor multiplier problem. +Mark the source code as C++. +Re-document levels(not done). +Update wiki. + +0.9.1-1_PR (r87) +Disable screenshot when you're entering your honourable name. It's +not tested so we could only hope that will work... +Add crappy sounds to (part of) the menus. + +Replace a level in assessment mode. The original one was meanless.. +The menu sounds are too crappy... remove them temporarily. However, +let's complete the code base so that we won't waste time writing +it... + +0.9.1-1_PR (r86) +Port highscore view and details menu. Menu rewrite is almost done! +Disable select key while transferring. +Fix "typo" caused bugs. +Hopefully fix small bugs in the new menu system. +Rename several files. Add some additional files. +Remove legacy menu components. + +0.9.1-0_PR (r85) +Port death menu, complete menu and new highscore menu to the new +menu code base. +Clean up old menu code. +Update wiki. + +0.9.1-0_PR (r84) +Port player preference menu, pause menu and return to title menu +to the new menu code base. +Add shake effect to player preference menu. +Make effects faster... +Press esc in a menu will select back/exit now. +Add several background transfers. +Fix possible memory leaks in HangUpText. +Remove some commented statements. + +0.9.1-0_PR (r83) +Now you can change the game resolution. +Some resources are not re-made so they may look blurred... +Make font bigger for higher resolution. +Add command line option for changing the resolution. +Complete the option menu rewrite. + +0.9.1-0_PR (r82) +Add missing file menus.png... +Finish the start menu rewrite. +Modify "Lunatic Lunar", however it's not done... +Modify resource unpacking of Windows version. + +0.9.1-0_PR (r81) +Start menu rewrite... +Add information about the built time. + +0.9.1-0_PR (r80) +Remove "high FPS mode", it won't reach 500 FPS on my computer any +more. Replace it with Vsync mode. +Add float HGE::Timer_GetFPSf(). The return value will be updated +every 1000ms. + +0.9.0-1_PR (b79/r79) +Bump version! +BLR will use revision number instead of build number one day... +==changelog here== +New assessment level "density test"... +New assessment level "pinball"... +New assessment level "Road blocks"... +New assessment level "Extreme speeds"... +New assessment level "Messed up"... +New assessment level "Bonus - Lunatic Lunar!", finishing assessment +mode! +Laser extentions, add LineLaser for two-point laser inheriting all +Laser interfaces. +Modify laser collision parameters. +Level corrections. +Improve density test. +Add screen shot. Press S for a screen shot. +Fix the upside down screen shot output. +Fix stubbed HGE::System_Launch. + +0.9.0-0_PR (b78) +First two assessment levels. +Two more assessment levels... +Tow _more_ assessment levels...... +Another assessment level... +Yet another level for assessment mode... why don't I bump the +version? +Modify player attribute. +Allow bullet to kill itself at a certain point. +Add extborder attribute. +Finish assessment system framework. +Add circ2pnt. + +0.8.1-1_PR (b77) +All parts from level -1 to 7 are completed! +Fixed the crash in the mingw-w64 build. +Switch to mingw-w64 for building Windows version now. +Complete GUI bring back. +Fix a bug appeared after the cross-plantform port(when forked +from BLRI). +Prepare for assessment mode. + +0.8.1-0_PR (b76) +New level "Sink over the horizon". +New level "Gravity vortex". +New level "Double reflective". +Make point bullet additive blending. +Allow bullets to pause before being accelerated. +Modify "Gravity vortex". +Modify "Achromatopsia". (Thanks to my classmate's advice...) +Report build and version in the log file. +Add command line argument support. Use "--help" for usage. +Add freetype support to hge. It's still pretty buggy. (and make +the executable extremely big!) +Add experimental support for cross compiling with mingw-w64. +(Mingw-w64 build *will* be the official build in the future.) +Fix blinking HangUpText. +Fix crashes in mingw-64 build. +Change numeric characters to monospace. +Modify player speed settings. +Beewx still messes up memory... fixed now. +Exit 1 if not terminated correctly. + +0.8.0-1_PR (b75) +New level Supernova. +New level (still unnamed). +Support additive blending bullets(for Supernova). +Add some additional tips. +Move levels to level -1. +Fix blinking of HGE::Gfx_SetTransform in OpenGL. +Fix includes like " #include "../../include/..." " that would +cause errors. +Extend libcgh again. Adding operator ^ and method l(). +Modify clearrange behaviour in level hyper-threading. +Modify the corresponding score bullet. + +0.8.0-0_PR (b74) +New level Achromatopsia. +New level hyper-threading. +Tower8 partly rewritten, dropping tdir. +Fix a small problem in level 2. +Move levels to level -1. <-typo fixed +Modify the semi-coll threshold of laser. +SCEffect_Attatch now take a optional parameter. +Global varibles cleanup. +Fix a bug in bullet8 caused by RandomEngine port. +Rename "Minesweeper"->"Spiky", add noname2pnt. +Add achroma2pnt. + +0.7.3-0_PR (b73) +This is a pre-release version of 0.7.2-2_PR. +This version is released to public for level previewing. +This release contains level 1~7 (while level -1/-2 are still +"imaginary") +Changes: +Compress several png files. +Merge code for Windows. +Fixed compile problems of Windows version. +Small fixes of level2. +This build will be short-lived. + +0.7.2-2_PR (b72) +New level "return to void". That's a 3 in 1 class. I used +particularly many "return(void)(...);" in this level (which I +always love to use). +This indicates all "normal" levels are completed. +Multiplier system was fully adopted into BLR. +Implement a RandomEngine, replacing all rand(). +Rewrite Leaf_Anim using std::list, won't cause crashes now. +Fixed: Trypophobia stops if too many CLR's are used. +Fixed the problem in All2pnt(). +Fixed blinking target. +Fixed Hexagon loops memory leak (the pointer array is too small...) +Tests under Windows were done, all gameplay features ran perfectly. +Make Laser::GetDist() private to avoid misusage. +Fixed several background problems. +Remove unused statements: +DWORD ColTrans(DWORD,DWORD,DWORD): replaced by +DWORD ColorTransfer(DWORD,DWORD). +void SaySomethingAndBye(char*): useless. +void DirectBullet(Bullet&,double): this has been coexisted with +the same method in the Bullet class for a long time. Now it's +replaced by Bullet::setdir(double). +A Small bug in the Windows build is fixed. +File list in the Windows build is updated. + +0.7.2-1_PR (b71) +(Level7 will be almost twice longer than Level6!) +I'm extremely tired these days, I can't even keep my eyes open +while typing... +Some of my classmates helped testing several levels and found +some bugs, thanks a lot! + +After a short test, I found that the Windows build is almost +broken... Crashes and misbehaves are everywhere! + +Maybe Windows is noble and won't run this garbage:( +===Real changelog starts from here=== +New level "Trypophobia", however it seems that this level won't +cause trypophobia at all! +New level "Photon fusion", using a slightly modified Tower8. +Rewrote laser distance detection using vector2d calculations, +extending libcgh and bump its version at the same time.(*2) +Put the new level to the correct place. +Bring back "Minesweeper" level, adjust it to the new interfaces. +Convert Bullet from struct to class. +Bring back Classic Mode. There are no "easy", "normal" or "hard" +now, there's only "classic"! Fix problems with the classic mode in +the new code base. +Fixed a bug appeared after the levels were put together. +Other minor changes to the level WOP. +Minor cleanups and code style adjustments. Add missing free's and +delete's. +Remake the credits page, it grows from 350KiB to 6MiB. (And so I'll +enable PNG compression later.) + +0.7.2-0_PR (b70) +I wasn't willing to bump the build number because I want the svn +revision to chase the build number. +However it wouldn't be appropriate to put three new levels into one +build... +The real changelog is here: +New level "interference" (it's another small class "SimpleThing"). +New level "diffraction" (yet another dull class), hopefully fixed a +memory leak in this level (by using more memory!) +Rearrange levels to the order they will appear in the final version. +New background interface, use background pictures easily. +Make "Tiled" background mode work. +Add SetScale to background class. Make you dizzy easily... +Fix a small glitch in Level3Part3-4. This level won't run correctly +under Low FPS Mode. +Minor code cleanups. +Removed more useless comments, my code is still hard to comprehend, +though. +Fix the misbehave of modulo with minus numbers... +Small interface and behaviour changes: +-If a bullet is effect-attatched and the effect is running, it won't +die. +-Bullet::redir now always make dist=1, for some bullet processing +doesn't use dist now. +Don't copyleft, it's radical. + +0.7.1-6_PR (b69) +Finish some new levels ("Great Circle" bring back & "rainbow +appearance"). +Fusion bullet first work draft. +Fix some of the warnings from the compiler. +Adjust level difficulty. It was indeed too easy... +Remake some resources with GIMP. +Merge great circles and finish it. +Small code cleanups. + +0.7.1-5_PR (b68) +Draft new level. (Another level threatening you using circles!) +Update some old interfaces from BLR1. + +0.7.1-4_PR (b67) +New level (name and placement undetermined). +Fix level transition mismatches. +Improved accelerated bullets. + +0.7.1-3_PR (b66) +Fix a few glitches. Removing some useless interfaces for BLR I. +Change "Dangerous Target" for proper difficulty. + +0.7.1-2_PR (b65) +Bullet death effect, applied to Wave of Photon. It seems buggy. +Fixed something left for debuging in the last commit. + +0.7.1-1_PR (b64) +New level: Wave of Photon. A lazy level again. Despite of a new +class, it's a copy of "photon school". +Level improved: Cross threaten. Make it impossible to pass this +part without crossing those blue bullets. +libcgh improvement. Added new interfaces to vector2d struct. So the +libcgh version was bumped. Was it worth doing that? + +0.7.1-0_PR (b63) +New level: Rainbow bullets - nauty photon (in fact it's a lazy +level! I must have seen the same thing some where else...) +The last "photon school" level was put to where it should be. +Rewrite some silly parts of the Changelog. +I ran out of my AppEngine quota today... So I can't commit that to +svn as planned... + +0.7.0-9_PR (b62) +Performed a couple of tests, under both full FPS mode and low FPS +mode. +New background is used by now. + +0.7.0-8_PR (b61) +Improved the rendering code. More tests are required... +That made the rendering more efficient. It also eats less RAM then. +--Okay it's now tested. Another bug in FPS independent bullets +fixed. No (big) bugs were found in the new rendering code. + +0.7.0-7_PR (b60) +Spring Festival commit... +One level is rewritten. +Ready to sync this to svn... + +0.7.0-6_PR (b59) +Fixed 3D clouds background. New background components added. +Experimental FPS independent bullets. + +0.7.0-5_PR (b58) +Fixed another critical bug in laser collision detection +implementation... Laser is almost perfect now...//Still, it's +inefficient. + +0.7.0-4_PR (b57) +Fixed a critical bug in laser implementation and another awful +memory leak bug... + +0.7.0-3_PR (b56) +A new level is going to be complete... + +0.7.0-2_PR (b55) +Auto pause and do not make game suspend if focus is lost. + +0.7.0-1_PR (b54) +First two parts for level7. + +0.7.0-0_PR (b53) +New background for level7. Preparing interfaces for level7. + +0.6.2-2_PR (b52) +Level6 is frozen now. It's the longest level ever... (in blr!) + +0.6.2-1_PR (b51) +Completing level6! +Spring is coming? (Well, not really...) + +0.6.2-0_PR (b50) +Completing && improving hexagon. +Bumped the minor version for the sixth level is almost complete. + +0.6.1-4_PR (b49) +New level hexagon. + +0.6.1-3_PR (b48) +New level...(Avalanche) +Spotlight: Supporting BGM loop points(using my new hge +interfaces...)! +I have no idea on new levels (except "hyper fluid", that's a well- +planned part...). Maybe I've spent too much time staring at the +desktop? I feel like void these days. +The build count is bumped four times a day, you enough! + +0.6.1-2_PR (b47) +New level "Wriggle Nightbug-like"?... + +0.6.1-1_PR (b46) +Implemented several unimplemented audio interfaces of hge (OpenAL). +A Windows build to check compatibility is planned. + +0.6.1-0_PR (b45) +Now we have 11 parts in level6... +A BGM called Canon Techno is completed around here... + +0.6.0-0_PR (b44) +Starting level 6! +//We are in 2014 now. I'm regretful for I didn't have the dates +recorded. + +0.5.3-2_PR (b43) +Optimizing memory usage... (first step...)[*] +Borrowed "the unbreakable jail" from old code... +//[*]Note @ 0.6.1-3 && @ 0.7.0-9: +//1. I found this useless. +//2. This may cause SIGSEGV! +//3. It's completely removed after b61. Because they are not used +// any longer + +0.5.3-1_PR (b42) +Final(the second last..) level for level 5, fish in a barrel? + +0.5.3-0_PR (b41) +Small fixes and levels as usual... + +0.5.2-3_PR (b40) +New minor parts for level5, fixed a bug in Player_Clear_Rotate. + +0.5.2-2_PR (b39) +Several patches on new clear range. +Changing interfaces for new levels. + +0.5.2-1_PR (b38) +New trigger method for clear range... + +0.4.4-0_PRG (b37a) +Regression version for releasing... +------------------------------------------------------------- +This will be released as a official Preview Release version.<-obsolete +------------------------------------------------------------- + +0.5.2-0_PR (b37) +New part for level5. Now I'm working on the regression 0.4.x. + +0.5.1-1_PR (b36) +Several fixes including: +-Fading info panel when approaching. +-Sending mult. inc. indicator layer up. + +0.5.1-0_PR (b35) +First two levels of level5. + +0.5.0-0_PR (b34) +Starting level5... Crazy Autumn... + +A regression is planned to release a 0.4.x-x_PR version as +official pre-released version. However it's still nowhere in sight +that if I could use Windows these days. + +0.4.3-0_PR (b33) +Level4 is almost complete. Now I'm using LOW FPS Mode for +development because I just want to cool my laptop down without +using my own power. //However I stopped that at the next version... + +0.4.2-0_PR (b32) +A new level... without using *ANY* old code (from level.h). + +0.4.1-2_PR (b31) +Level4 is now 18 parts... + +0.4.1-1_PR (b30) +Transfered sevel old levels here. + +0.4.1-0_PR (b29) +Optimizing old code for level4. + +0.4.0-0_PR (b28) +Now let's move to level4... + +0.3.2-0_PR (b27) +New levels for level3. In fact, it's almost completed now... + +0.3.1-2_PR (b26) +Improved bullet clearing method, avoiding hidden bullets +completely!(Just by converting them all to score points...) + +0.3.1-1_PR (b25) +A new "big" level for level3. +Added several new interfaces to tower&bullet section. + +0.3.1-0_PR (b24) +Complete the first two parts of level3. + +0.3.0-0_PR (b23) +Starting the development of level3... + +0.2.9-2_PR (b22) +Completing level2... + +0.2.9-1_PR (b21) +New parts for level2. level2 is almost completed now. +PlayerLockX/Y implemented. +------------------------------------------------------------- +This will be released as a official Preview Release version.<-obsolete +------------------------------------------------------------- +BLR will be licensed under WTFPL from now. +(WTF?) +............................................................. +No it's now licensed under the BSD license... + +0.2.9_PR (b20) +Level 2 is frozen "by heart". (How? By heart?) + +0.2.5_PR (b19) +Optimizing the second level to a "realistic" state... Added two +extra musics(although still remain not used). + +0.2.2_PR (b18) +The main development has been transferred to Linux. Optimizing +code for Linux. +//Revision count is not important. + +0.2.0_PR (b17) +Level 2?... + +0.1.7-2_PR (b16) +The first level is almost completed now... + +0.1.7-1_PR (b15) +Fixed several serious bug in Low FPS Mode. Fixed FPS Level option +code. + +0.1.7_PR (b14) +Updated the only level to synchronize with the In-Game Music. +Added "Multiplier +1" into the game system. Added an unimportant +loading screen.//In fact, it's loading nothing. May be unpacking +resource pack in Windows version... + +0.1.4_PR (b13) +libcghEx has been made independent and can apply to any other +projects. This is also the first BLR version that includes +In-Game Music. libcghEx has been extended with LinearProgresser +and HangUpText. + +0.1.1_PR (b12) +Added auto-multiplier system. libcghEx (Chrisoft Game Helper +Extras Library) is included in this version with CircleIndicator. + +0.1.0_PR (b11) +Creation of the Pre-Released Version. Removed all old level code. +Bourne-again!//Can you imagine what I was thinking when deleting +the result of 3 months' work?... +================================================================= +TestBed versions: + +TB130907 (b10) +A "Noname" level. Laser implementation partly rewritten. + +TB130903 (b9) +Additional backgrounds + +TB130827 (b8) +Laser implementation, Cheers! + +TB130818 (b7) +New Levels such as rainbow towers and squashing levels. + +TB130802 (b6) +Discarding old code, rewrite of part of the code. + +TB130718 (b5) +Bullet creation effects, sync code back to BLR1. + +TB130714 (b4) +Target indicator completed. + +TB130705 (b3) +New level and bullet creation code for orange bullets. + +TB130703 (b2) +Completing Orange Towers. + +TB130620 (b1) +Completing Deep Blue Towers.//Well, "Dark Blue" right? Or more formally, "Navy". +//However, they are all not the real color. I used #0000FF, which is just "Blue", +//it just seems dark. + +TB130610 (b0) +Creation of Testbed version. diff --git a/archive/blr2/Extras b/archive/blr2/Extras new file mode 100644 index 0000000..0368e7e --- /dev/null +++ b/archive/blr2/Extras @@ -0,0 +1,133 @@ +BulletLabRemix II, Extras +2014-06-06 + +Content +------------------------------------------------------------------------------------ +About the source code +About resources used in the game +The development + +About the source code +------------------------------------------------------------------------------------ +I'm not a rigorous coder. All sources are written casually. +You can even find two code chunks in one file with different styles... +But generally, I: + Use tabs (width=4) and indent in Allman style; + Don't like extra spaces; + Prefer commas if possible; + Don't like very long names. + +And, the source code is bloated. global.h defined ~200 lines of global variables. +Imagine that. + +Well, the reason is that BLRI start as a huge monolithic source file - main.cpp. +It's once a ~100KiB file, and have more than 10k lines of code. One day I found it +impossible to maintain such code and split it into several .h file. BLRII took the +code base of BLRI. That's why. BLRIII will be a complete rewrite and I hope this +would fix the problem. + +Well, let's observe each source file. + +background.h Defines and implies background animation. +effects.h implement several simple in-game effects. +global.h Defines global variables and routines. +hgeft.h Free type interface for HGE. It's considered buggy and + incomplete now... +levels.h implement the levels. +libcgh.h Chris' Game Helper interfaces. +loading.h Resources for the loading screen. +menus.h implement the menus. +music.h Music playback and looping. +scorec.h Record highscores. +scoresystem.h The BLR Multiplier scoring system. +towernbullet.h implement towers and bullets. +hgeft.cpp Free type interface for HGE. This is the implementation. +libcghEx.cpp Extra routines for the CGH. +main.cpp Contains main(int,char**), and player controls. + +About resources used in the game +------------------------------------------------------------------------------------ +Most resources are self-made... + +b_diff.png A café wall illusion background +b_inter.png A swirl illusion background +b_leaves.png Taken from a Windows 3.1 desktop background, unused +b_null.png Simple white background +blnsns.png Font file. Font name "Berlin sans" +credits.png Resources used in the credits screen. +e_leaf.png Texture for leaves background effect. Taken from a Windows 3.1 + dekstop background. +e_sflake.png A snow texture for background effect. Taken from public domain. +e_skyitem.png Sky background resources. Taken from HGE tutorial. Cloud is + from public domain. +help.png Built-in help. +menus.png Menu textures. +ss.png Sprite Sheet. Taken from BLRI. Made with inkscape. +title.png Title sprite. Pre-processed with inkscape. +All resources are processed or made with GIMP. + +menuin.ogg Menu effect. Made with OpenMPT. +menuout.ogg Ditto. +tap.ogg Widely used. Taken frome HGE. + +BLR2_TR01.ogg Background music for level1. Original by Noby. +BLR2_TR07.ogg Background music for level7. Original by Chris Jarvis. +BLR2_TR09.ogg Background music for credits scene. Taken frome BLR2_TR07. +CanonTechno.ogg Bonus? Made by Chris Xiong. +Softwares used: OpenMPT, Rosegarden, Cakewalk Sonar 6. +Syntheis: QSynth+Fluid R3 sf, Roland Groove Synth, Cakewalk TTS-1, Roland +Super Quartet. +Proprietary softwares are all cracked. I can't afford them now. + +The development +------------------------------------------------------------------------------------ +As a student, developing such a game will never be supported... +So, the development is "well hidden". +The post-0.2.2 development are mostly done under Windows(8/8.1). After that, I +migrated the main platform to Debian GNU/Linux. I'm using the unstable distribution. +I'm not a true developer but I'm really one of those who like to like on the edge. +Recently I installed Archlinux, which has taken me to the "bleeding edge". "Edges" +are different from "borders", they are more sharp! + +Well, I first played BulletLAB when I was 13. It's easy enough and I passed the easy +levels without any trouble. Then I tried normal and hard, all done without much +difficulty. Then comes the "Extreme" mode, in which you have to pass the whole game +without misses. That took me a long time... + +In March 2013, I was pretty bored (in fact, preparing a contest). And I found the +small flash game again. I decompiled it, and started modifing it. Soon I found this +interesting, and made the game VERY difficult. I even "released" that. + +However, flash is really inefficient. As the bullet number grows, FPS falls +violently. So a rewrite is planned. + +First things first, how to draw so many objects on a screen? An STG game that has a +file "hge.dll" in its directory came to my mind. I could still see the fancy effects +it has. I googled for hge and found that it's a hardware accelerated game engine. + +Well, that's it! I wrote several simple scenes as practices, then BLRI started. I +found HGE really powerful and can draw 2000 objects in 1000FPS. F***in' awesome! + +BLRI's source code growed rapidly. Soon it's almost 100KiB. It's almost impossible +for me to maintain so big a file. That's why the source code is presented in many +headers. + +When BLRI reached 0.8.6, BLRII was forked from it. BLRII started as a level testbed +for BLRI. However, BLRI was frozen (this term is borrowed from the debian project, and +is not at all releated to Cirno) before these levels can be added to it. If they +*were* added, the source code of BLRI would no longer be human-readable. + +As BLRI was released (as 1.0.3SR), I can relax myself a bit. During that I found +hge-unix, which can port almost any hge-based game to UNIX. I tried it and it works! + +Then I started modifing hge: migrating the Windows version to DirectX 9, implement +stubbed functions in hge-unix, deprecating libbass and migrating to OpenAL... + +Soon I completed them all. Then I picked up BLRII (around Oct. 2013), which already +has free-shaped lasers implemented. + +To declare my ambition to change BLR, the whole level.h was removed (with a backup +of course). + +However this didn't change too much. Almost all levels were ported back to the +current version later.
\ No newline at end of file diff --git a/archive/blr2/FAQ b/archive/blr2/FAQ new file mode 100644 index 0000000..9935458 --- /dev/null +++ b/archive/blr2/FAQ @@ -0,0 +1,168 @@ +===Under Construction=== +In fact, these Q&A's are not asked frequently at all. +They all came from the messed up mind of the author! + +Q: It complains about a missing dll? +A: The Windows version was built against d3dx9_43.dll, which can + only be found in the latest DirectX runtime. Make sure you have the + latest DirectX runtime installed. + Other dlls required by the default Windows version are all bundled + with your Windows installation plus the DirectX runtime. You + shouldn't blame me if your system is incomplete. + +Q: I JUST CAN'T start it! (I can't see even a window!) +A: Something must went wrong. There are two general causes. + 1. Failed to load a shared library. + 2. Initialization Failure. + If the first one happened, BLRLOG.TXT will not even be created. + To solve it, install the required runtime libs. + If the second one happened, you can find out what really happened in + BLRLOG.txt. Read the rest part of this document for more information. + + However, the first one is not likely to happen. The official Windows + build doesn't have too much external dependencies. + +Q: (In Windows) + "Can't create D3D interface" + "Can't determine desktop video mode" + "Can't find appropriate full screen video mode" + "Can't create D3D device" + and it ends after this... +A: DirectX initialization failed. + If you get this message after changing an option, the cause might + be your option is not supported by your computer. You can purge + the config file (back up your score and remove .blrrc) and + restart the game. + If you get this message on the first startup, you are just unlucky. + HGE, which is the render engine used in BLR is really low-ended + and will even work on a 1998's computer. Again, you are just unlucky! + +Q: (In linux or custom Windows builds) + "OpenGL implementation must be at least version 1.2" +A: If you build a custom Windows build with OpenGL, this may occur, for + Windows' OpenGL implementation is 1.1. For a work around, see the + SDL website or build the DirectX version. + If this happens in a Linux build, you are just unlucky. OpenGL 1.2 + is released in 1998... + Similiar problems may also happens if your X display is not a GL visual + or you haven't installed drivers properly. + It's also possible that you are using OpenGL Soft, which is not + supported. + +Q: "******** failed, using no sound", and it's silent... +A: OpenAL initialization failed. + Your system may not support OpenAL software version (it's so hard to + find such a computer). To dismiss this message, start the game with + "--nosound". + +Q: The screen suddenly messed up... + Something terrible happened... + Is the player square screwed? + I can't move it! +A: This might be a internal problem. Please make a bug report if this + happened. + +Q: It crashed! +A: This program may crash at any time. + If it crashed, you can post your problem with BLRLOG.txt attatched + to google code issue tracker. I'll try to fix the problem if I can + reproduce it. + +Q: "Cannot decompress resources!" (Windows only) +A: I've compressed the resources of the game for Windows. As the game + starts, it will create two folders and decompress the resources + into them. If that failed, this problem will be reported. + Restarting the game may solve the problem. If it still fails, check + if expand.exe exists in your system(It's an essential system file!). + +Q: Your code cannot compile! +A: I'm pretty sure that it CAN compile(on my machine). + Check if you have all required sdks installed and if you have + configured the project correctly. + Additionally, if you checked out an older revision from svn, I + cannot guarantee that it can compile! + +Q: What are BLRData.dtp and BLRMusic.dtp? +A: As the name tells, these are archives containing the game data. + You can decompress them with expand.exe (which may be found in + the mystery folder "system32"). + +Q: It's blurred? +A: The game was designed for 800x600, and if you are using a resolution + other than 800x600 or running in fullscreen, this problem may occur. + +Q: I can't see the bullets when paused? +A: That depends on the implementation of the level where you are. + Some levels are implemented using the silly "SimpleBullet" class + which I once think it brilliant. These bullets won't be displayed + during the pause. + Pause menu was not introduced in BLR I until version 0.8.9 alpha. + The reason was I thought a menu for the pause scene was really + useless... + BTW, if you've ever played the official version of the Touhou series, + you might have found the pause scene there more annoying. The author + has stated that he made it deliberately (see TH06 FAQ 25). + +Q: I don't think the graphics are being rendered correctly. +A: I don't know much about DirectX, for I left hge DirectX untouched. + However it shouldn't differ too much from the OpenGL version. + All quads are rendered as triangles, and uses vertex buffer. + Maybe there are "graphics driver dependent" contents, I'll correct them + later. + +Q: It's sssSssso hard! +A: It's supposed to be hard! The only solution is to practice more. + However you can get more CLRs in player preference settings (with + a sacrifice of moving speed). + +Q: I can't get those "+1"'s... +A: It's designed to be so! Some of the "+1"'s are only for adventurers! + +Q: Tell me the history. +A: Changelog tracked a full history of this project (Although it's not + detailed). + By the way, this project started as a fork of BLR I, which is already + closed by me now. + +Q: Are there command line options? +A: Yes. It's documented in README.txt. + BTW, --start and --fast came up for debug purpose only. + However they are a hidden bonus for cheaters. + So, I won't remove that in the final version. I promise. + (P.S.: misusage of --start may cause severe problems!) + +Q: Rankings of this game? +A: If you can reach level 1~3... + --You are not suitable playing this sort of game. + If you can reach level 4~6... + --You are a normal human-being. + If you can pass level 6 or reach level 7... + --You are unusual. + If you can pass level 7... + --Are you "nobody"? + If you can pass level -1... + --Tell me the reason why you come to Earth... + +Q: Why can't I play all levels, it tells me "It Ends Here"! Do I have to pay + you for it? +A: Of course not! 'Cause You just restarted too many times or had too many + collisions. The detailed requirements is listed below. + Level Restarts allowed Collisions allowed + level 2 N/A N/A + level 3 1 10 + level 4 2 40 + level 5 3 75 + level 6 5 125 + level 7 8 200 + level -1 2 50 + + For example, to enter level 6 you can restart 5 times at most (classical + mode), or have 125 collisions at most (FreePlay Mode). + + Level -2 can only be accessed in assessment mode or "--start" option. + +Q: Are there other awards? +A: Sorry, no... + You won't get anything but the ranking even you've passed level -1 without + collisions. + So... enjoy it yourself. diff --git a/archive/blr2/FAQ.zh b/archive/blr2/FAQ.zh new file mode 100644 index 0000000..f6561f5 --- /dev/null +++ b/archive/blr2/FAQ.zh @@ -0,0 +1,141 @@ +===建设中=== +In fact, these Q&A's are not asked frequently at all. +They all came from the messed up mind of the author! + +Q: 它说缺少什么dll? +A: Windows版本是依赖d3dx9_43.dll的。你只能在最新的DirectX库中找到它。 + 所以确认你是否已经安装了最新版的DirectX运行库。 + 其他所有需要的dll都是Windows/DirectX运行库自带的。如果你的系统不完整, + 就不要来找我了… + +Q: 我就是不能启动它!(我连个窗口都看不见!) +A: 一定有什么东西出错了。大约是以下两个原因中的一个: + 1. 无法加载某个共享库。 + 2. 初始化失败。 + 如果发生的情况是第一种,那么BLRLOG.txt甚至都不会被创建。 + 解决方法是安装所需的运行库。 + 如果第二种发生了,你可以从BLRLOG.txt中看到到底是什么出了问题。 + + 不过,第一种情况发生的可能性非常小。发布的Windows版没有那么多外部依赖。 + +Q: (Windows中) + "Can't create D3D interface" + "Can't determine desktop video mode" + "Can't find appropriate full screen video mode" + "Can't create D3D device" + 然后就什么都没有了... +A: DirectX没能正常初始化。 + 如果你在修改了一个设置之后出现了这样的问题,原因可能是你的电脑不支持这种设置。 + 你可以清除配置文件(备份你的分数文件,然后删除BLR.cfg)然后重新启动游戏。 + 如果第一次启动就出现了这种情况,那就是你太不幸了。BLR的渲染引擎(hge)在1998 + 年的电脑都可以正常工作。重复一遍,你还是太不幸了… + +Q: (linux或者非官方的Windows版本中) + "OpenGL implementation must be at least version 1.2" +A: 如果你自己编译了一个使用OpenGL的Windows版,就有可能发生这种情况。因为Windows的 + OpenGL版本是1.1的。为了获取一个解决办法,你可以看看SDL的官网或者编译一个使用 + DirectX的版本。 + 如果这发生在Linux版上,你还是太不幸了。OpenGL 1.2是1998年发布的标准… + 不过如果你的X display没打开OpenGL支持,或者没有正确地安装驱动,该问题可能也会发生。 + 另有一种可能,就是你正在使用OpenGL Soft,而本游戏不支持它。 + +Q: "******** failed, using no sound",然后什么声音都没有… +A: OpenAL初始化失败了。 + 你的系统可能不支持OpenAL软件版(找到这么一台电脑是何其的不容易啊)。 + 如果你以后不想再看到这条消息,可以带"--nosound"参数启动游戏。 + +Q: 屏幕突然花了! + 发生了可怕的事情… + 那个方块被吃掉了吗? + 我没法移动它! +A: 这应该是个内部问题。如果你遇到了请汇报这个bug. + +Q: 它崩溃了! +A: 这个程序*随时*都可能崩溃。 + 如果它崩溃了,你可以将你的问题附上BLRLOG.txt一起发到google code的问题 + 跟踪(大致就是一个类似bugzilla的东西?)上。如果我能重新制造出这个问题,我将会在以后 + 试着去修正它。 + +Q: "Cannot decompress resources!" (仅限Windows) +A: 我将Windows版的游戏资源压缩了。当游戏启动时,它会建立两个文件夹并将数据 + 解压在其中。如果这失败了,将会弹出这个错误框。 + 重启游戏大概就能解决了。如果还不行,请检查你的系统中是否包含expand.exe(这是个重要的 + 系统文件!)。 + +Q: 你的代码没法编译! +A: 我非常肯定它(在我的机器上)*能*编译。 + 检查你是不是已经获取了所有需要的SDK,并且工程设置的是否正确。 + 另外,如果你使用的是一个从svn获取的较老的版本,我就不能保证它能编译了… + +Q: BLRData.dtp和BLRMusic.dtp是什么? +A: 正如名字说的,他们包含了游戏的数据。 + 你可以用expand.exe解压这两个文件,expand.exe可以从神秘的system32文件夹 + 下找到。 + +Q: 看起来很模糊? +A: 这个游戏是为800x600分辨率设计的。如果你在用其他的分辨率或者以全屏运行它, + 可能会出现这个问题。 + +Q: 暂停的时候看不到子弹? +A: 这得看你暂停的时候所在的关的实现方式。有些关是用“SimpleBullet”类来写的。 + 这些子弹在暂停时无法显示。 + 暂停功能直到BLR I的0.8.9 alpha才出现。原因是我之前认为暂停菜单没有用… + 顺便,如果你玩过东方系列的游戏的话,你会发现那里的暂停界面更加烦人。不过它的作者 + 已经说明这是故意的了(见TH06的FAQ 25)。 + +Q: 怎么这么难啊。 +A: 这是故意的!唯一的解决方法是多练… + 但是你在游戏设置中可以搞到更多的CLR(需要以降低移动速度为代价)。 + +Q: 我根本拿不到那些“+1”! +A: 这也是故意的!一部分“+1”是专门为愿意为它们冒险的人设计的。 + +Q: 我认为图形绘制的有问题。 +A: 对于DirectX,我了解的不太多,因为我没有修改hge的DirectX版。 + 但是它不应该和OpenGL版有太大的不同。 + 四边形都是使用顶点缓冲用三角形绘制的。(好像现在所有显卡都支持顶点缓冲?) + 或许还有些跟显卡驱动有关的问题,我将会在以后修正它们。 + +Q: 请告诉我历史。。。 +A: Changelog里面记录了这个项目的整个历史(虽然不是很完整)。 + 顺带一说,这个工程起初只是BLR I的一个fork(),而BLR I现在已经完工了。 + +Q: 有命令行选项吗? +A: 有,在README.txt中有其说明。 + 顺便,--start和--fast选项一开始是为调试而设置的。 + 但是它们也是作弊者的一个隐藏福利… + 所以,我在最终版中不会移除它。我保证不会(?)。 + (错误地使用--start可能会导致严重问题!) + +Q: 等级? +A: 如果你能到Level 1~3... + --你不适合玩这种游戏。 + 如果你能到Level 4~6... + --一般的水平。 + 如果你能通过Level 6或者玩到Level 7... + --你不太一般啊… + 如果你能通过Level 7... + --你是“没有人”吗? + 如果你能通过Level -1... + --告诉我你来地球的目的… + +Q: 为什么我玩不了所有的关卡…它告诉我“It Ends Here!”(到此结束了!)。 + 我难道还需要付钱吗? +A: 当然不!还是因为技术太渣了。关于进入下一关的要求,见下表。 + 关卡 最多重开数 最多撞弹数 + level 2 N/A N/A + level 3 1 10 + level 4 2 40 + level 5 3 75 + level 6 5 125 + level 7 8 200 + level -1 2 50 + 举个例子,为了能够进入第6关你最多重开5次(“经典”模式中),或者最多撞弹 + 125次(自由模式中)。 + + Level -2只能通过评估模式或者"--start"选项玩到。 + +Q: 有其他奖励吗? +A: 对不起,没有… + 即使你一个没有吃到一个子弹地通了Level -1你也不会得到任何东西。 + 所以…自娱自乐吧。 diff --git a/archive/blr2/INSTALL b/archive/blr2/INSTALL new file mode 100644 index 0000000..c48e870 --- /dev/null +++ b/archive/blr2/INSTALL @@ -0,0 +1,29 @@ +Installing a game is really useless, isn't it? +So just compile it! + +A brief guide for compiling BLR +Required SDKs: +OpenAL +ogg +vorbis +DirectX(Windows only) +OpenGL(Linux only) +SDL(Linux only) + +Steps to do: +1. Get the source code. + You can choose from svn or the official packaged release. + The code from svn will always be newer than the official + packaged release. +2. Get required SDKs mentioned above. + Piece of cake. +3. Use Visual Studio(Windows) or Code::Blocks(Linux), create + project. Configure it correctly. + If you'd like to do it, you can also write a Makefile + yourself. +4. Hit build (or type make)! +5. If it failed, check step 2 and 3, then repeat step 4... + +Warning: +Some revisions in the svn repo has noticeable problems. +Always build the latest svn revision or official release! diff --git a/archive/blr2/Levels b/archive/blr2/Levels new file mode 100644 index 0000000..e22e9f4 --- /dev/null +++ b/archive/blr2/Levels @@ -0,0 +1,335 @@ +BulletLabRemixII +Level index/specifications/hints + +I'm still working on this document. +Please don't trouble me if it misled you. + +*Trying the levels before reading this is strongly recommended.* + +This document is probably NOT suitable for: +Anybody who isn't insterested in this topic +Liberal arts students(?...) + +This document is suitable for: +Nobody(?) +Coders who want to modify this game, or import levels to your game... +Casual persons who won't care anything +Someone who is stuck at a part + + + + + + +======================WARNING, LOTS OF WORDS BELOW!====================== +Level 1 2/180 +River levels 120 +-It's confusing... so much bullets for Level1? + However it's fairly easy. Do not seek for death(where those "+1" are + leading you to) + +Double-directed labyrinth 60 +-Still very easy. + +Level 2 4/215 +Polygon-red 60 +-This is not hard... + Fake bullets aren't always annoying. + +Polygon-white 60 +-Make good use of precise mode. + +Polygon-white locked 6 +-You can't move vertically! + Find a good position, e.g. near by a line. + +Polygon-both 30 +-This part doesn't make sense. + +Level 3 4/150 +Reflective 30 +-Just meet them, do not make big movements. + They are pretty friendly aren't they? + +*4 30 +-It's a little difficult... Keep away from the edges! + +Rotate ???? 60 +-Stay away from the rotating bullets. + +Wall of blues? 30 +-Rather easy. Do not try to earn too may semi-collisions unless + you are really skilled. + Looks awesome? + +Level 4 5/243 +Orange 30 +-Don't make big movements and stay away from the edges. (why?) + Those fast bullets are really annoying. + +Orange trap 5+5+4+4+3+3+2+2+5 +-Do NOT press shift! + +Double spinner 60 +-An easy part for level 4. + +Squash-2 60 +-Enjoy it yourself. + I think it may make the situation worse. + +Circle-drawing 60 +-Just draw the circle. + If you have any problem, try BLR 1. + +Level 5 8/338 +CChase 30+30 +-Don't set player move speed to 1! + Remark: They are not really faster than you... + +Vortex of leaves 60 +-This is another annoying level, looks awesome and hard. + Keep away from those 'laser''s! + Remark: The lasers may have strange collision detection... + Be careful! + +Upstream flow 60 +-Rather easy. + Looks like something in level 3. + +High speed threaten 30 +-It's JUST threaten! + Precision is important. + Practice makes perfect. + If you *can't* move horizonally may be it's easier... + +Crossing threaten 30 +-Appears very hard. + Choose the correct time to cross those bullets. + +Orange trap2 2+2+2+5 +-Just another level from level 4. + +Fish in the barrel 60 +-Seems to be faster and faster? NO... + Remark: Those bullets are comming directly towards you. + +the Unbreakable jail 30 +-This is fairly hard. Use CLR if you need it. + Remark: When the 'target' got red, it's about to update its + position. If you keep moving when it's updating its position, + it will stuck in update mode, or it will stop. + +Level 6 7/390 +Snow WHITE 30 +-Incredible fast. Do not treat your CLR as a + £100,000,000 cheque. + Remark: They are accelerated! + +Photokeratitis 10+10+10+10+10 +-This used to be sickly hard... + Treat fast bullets and slow bullets separately. + Remark: It looks like Wriggle Nightbug's spellcard... + As of r94, it's not so hard as it was before. Fast bullets + won't hit you *if you don't move*. + +Squash-4(?) 60 +-Do not be trapped! You only need ONE CLR!... + +Avalanche 60 +-Do not stay at the screen bottom, it's very dangerous... + +Dangerous target 60 +-Keep moving! + It's a nightmare if you've choose a slow player... + Remark: The target follows you as a yellow bullet does, + but not in the same manner. + +Hexagon loops 10+20+7+7+7+19 +-Step well back and watch the show. + Remark: This level will misbehave if FPS dropped... + +Hyperfluid 60 +-Also known as Superfluid. + In fact, liquid helium is not cold enough. It's still several + Kelvin's degrees. I can make it even colder. + Remark: The white bullets are not accelerated, which are different + from the blue ones. The blue bullets share the same direction: 45 deg. + Also will become easier if horizonal movement is restricted... + +Level 7 12/930+ Mapped levels +Spring thunder storm - panic? 60 Thunder storm... +-Although it's based on something from level 6, they are completely + different! + And this one is really easy. + Remark: Try to get to the top of the screen... + Try restricting vertical movement this time... + +Rainbow tower - color theory 90 rainbow tower +-Basic level. + Remark: It's taken from the old testbed version of BLRII. + +Rainbow bullets - nauty photon 60 Lazy level;) +-Similar to one part in level1, but *much* harder. + Luck is really required. + Remark: The generation of bullets is really strange... If the last position + on the y axis is taken up... sorry that I started to talk about coding again. + +Rainbow effect - appearance 60 draw a rainbow (of bullet) +-Random bullets. You will remember this part at once when you see the part. + If you feel it hard, go to assessment mode. + Remark: The bullets forming the rainbow are invincible. + +Rainbow effect - interference 120 as the name tells +-This part is REALLY easy... but why? + +Rainbow effect - diffraction 120 as the name tells +-Pretty hard. Those piles of shit may crash straight into you. + The code is pretty ugly too. + +Rainbow effect - photon school 60 "particalization"! +-Pretty hard. Use CLR if necessary. + It may be easier if you stay near the edges. (I don't really know.) + +Over the Rainbow - infinity challenge - great circles +-Your goal is to reach the red block... + And, this one is also pretty hard... + If you're not well-skilled and you are working on FPM, try --suicide--, + it worthwhile to do so! + Remark: This level will never end if you don't reach the red block... + +Trypophobia 120 another two classes: Tail & Pile +-Very hard. You'll never know where they will go next(neither will they). + However, they won't step on the same place twice. + Will this cause trypophobia? + Remark: This level almost burn my computer... + I seem to forget an important thing: Bullets with effects won't collide + for a short time after they are created... + +Photon fission 90 Use a slightly modified tower8... +-Directed bullets+random bullets. + Find a formula for it. + +Wave of Photon 60 class WOP+Lazy of particalization +-Not very hard at the beginning... + +Return to void 90 return (void)(...); +-VERY HARD!!! + I don't know where this came from. + CLR is useless but it will give you a short period during which you are invincible. + Remark: There are "no solution" cases... + +Level -1(Extreme) 7/1020 +unknown circles1 60 +-They slow down as they approach the border. VERY ANNOYING!!! + +unknown circles2 60 +-They STUCK at the border!! And they get THICKER and THICKER!!...... + +Spiky 120 +-Hard. Their behavior is not predictable. + Remark: Again, never try to approach lasers! They are harmful to your eyes... + +Achromatopsia 120(90+30) +-There's no way?! + Well, mind the name please... + Or we should call this "deuteranopia vs protanopia"? + Remark: Color change may suddenly happen!! + +Quad thread 120 +-Do you humans really support it? + Remark: I don't... + +Gravity vortex 120 +-It has nothing to do with gravity at all, but it's pretty + hard! + Seems to be very graceful. + +Supernova(additive blending) 120 +-After gathering enough power, they explode -- + Awesome supernova! + I enjoy coding(such easy parts)... + Remark: Newly created bullets are... I can't give more clue. + +yellow explosive 90 +-There's nothing to code, so I came up with this... + --Not deadly at all.-- + +Sink over the horizon 90 +-Strange. You will be easily trapped. + +Incomplete Reflective 120 +-Start in peace, end in mess. + Remark: one in four bullets will explode when it hits the wall. + +Level -2(Assess) 10/? + +You will certainly die. So let me predict your cause of death... + +Directed bullet +-This is actually a copy of... + Towers don't collide you, however they should do so. + You may end up in... whatever you want. + +Random bullet +-Pure random. + Are they getting faster? + You may end up in a huge mess. + +Constant patterns +-Pretty awesome. + Doesn't look like anything. + You may end up in a horror. + +Crossing 1(L+R) +-They started spinning!!! + You may end up like a juicy orange in a squeezer. + +Crossing 2(C) +-Used by Moriya Suwako... + Round bullets made me dizzy. + You may end up like... + That scene is really terrible! + +Trappy +-The name is strange... + Remark: The lasers created just over you are not created there on purpose... + However, one third of the bullets could be directed. + You may end up without your awareness. + +Sine wave +-Oscilloscope? + Find a good place to vibrate with the graph... + Remark: Some positions will cause death instantly! + You may end up... + Oops! I can't find you on that broken oscilloscope! + +Density test +-Really high density. + WTF? There's no way?! + You MUST end up in a horrible traffic accident, squeezing every drop of blood + out on the left board. That's really a bad image. + +"Pinballs" +-Well... They have collisions since r93! + These balls spawn with random velocity! + You may end up... + just imagine an eXtra-eXtra Large sized bowling ball flying direct towards you. + +Road Blocks +-You'll understand this one day. + --Flappy square?... + You death cause could be the same as the one in "Density test". + Don't ask why. I feel sick now... + +Extreme High speed +-Copy of one part in level 5. + You may end up in just *two* seconds. + +Laser crosses +-Only a show off of the Laser class. + You might end up like... Coal Dust? (Sorry I'm playing Industrial Craft2 these + days) + +Bonus test: Lunatic Lunar! +-May be the legacy of a vintage game... + You may end up... sorry, this in not predictable..
\ No newline at end of file diff --git a/archive/blr2/Levels.zh b/archive/blr2/Levels.zh new file mode 100644 index 0000000..123b1e6 --- /dev/null +++ b/archive/blr2/Levels.zh @@ -0,0 +1,330 @@ +BulletLabRemixII +关卡列表、说明和提示 + +此文档仍未完成。 +如果它误导了你,也不要来找我啊。。。 + +强烈推荐在阅读本文档前先自己玩一下。 + +不适宜人群: +? + + + +适宜人群: +? + + + + + + + + + +======================警告:下面有好多好多字!====================== +Level 1 2/180 +River levels 120 +-为什么第一关就这么多子弹… + 其实非常简单,别作死就行。(而那些“+1”就是要你这么做。) + +Double-directed labyrinth 60 +-还是非常简单。 + +Level 2 4/215 +Polygon-red 60 +-这个也不难… + 外面那一圈没有看上去的那么麻烦。 + +Polygon-white 60 +-利用好shift键(我的shift键已经卡在键盘里弹不出来了)。 + +Polygon-white locked 6 +-你不能在竖直方向上移动了! + 找一个好的位置呆着。 + +Polygon-both 30 +-这关毫无意义。 + +Level 3 4/150 +Reflective 30 +-初次见面,它们看起来还挺友好的是吧? + +*4 30 +-稍微有点难…离边框远点! + +Rotate ???? 60 +-不要靠近那些旋转的子弹。 + +Wall of blues? 30 +-相当简单。别刷擦蛋,除非你是大触。 + 看起来很厉害? + +Level 4 5/243 +Orange 30 +-高速子弹非常烦人。 + +Orange trap 5+5+4+4+3+3+2+2+5 +-别按shift! + +Double spinner 60 +-对于第4关来说算是简单的部分。 + +Squash-2 60 +-好好享受… + 我想这可能会让情况变得更坏。 + +Circle-drawing 60 +-画圈就行了。 + 如果你有任何问题,去试试BLR 1. + +Level 5 8/338 +CChase 30+30 +-不要把移动速度设置为1! + 说明:它们不是真的比你快… + +Vortex of leaves 60 +-另一个烦人的关卡,看着挺好看,但是也很难。 + 离那些“激光”远点! + 说明:激光的判定可能有点奇怪。 + +Upstream flow 60 +-相当简单了。 + 看起来有点像第3关。 + +High speed threaten 30 +-这只是吓唬人的! + 你需要精准的移动。 + 或许如果你不能水平移动的话这关会简单一点… + +Crossing threaten 30 +-看起来非常难。 + 选择正确的时机穿过它们。 + +Orange trap2 2+2+2+5 +-第4关? + +Fish in the barrel 60 +-好像越来越快了?不… + 说明:那些子弹是“自机狙”。 + +the Unbreakable jail 30 +-相当难…如果感觉到了请使用CLR。 + 说明:当那个“轮子”变红的时候,它就要更新它的位置了。如果你在它更新位置 + 的时候一直移动,它将卡在更新模式,否则它会停下来。 + +Level 6 7/390 +Snow WHITE 30 +-太快了…多用CLR… + 说明:它们还被加速了! + +Photokeratitis 10+10+10+10+10 +-这关曾经难的丧心病狂… + 区别对待快速弹和慢速弹。 + 说明:看着有点像谁的符卡… + 到r94以后,这关没有之前那么难了。如果你不动的话,快速弹根本打不到你。 + +Squash-4(?) 60 +-别被困在里面!你只需要一个CLR! + +Avalanche 60 +-不要呆在屏幕底端,那里非常危险… + +Dangerous target 60 +-别停下来! + 如果你的移动速度设置的很慢,那这将是一场噩梦… + 说明:“轮子”就像黄色子弹一样跟着你,但是姿势不同。 + +Hexagon loops 10+20+7+7+7+19 +-找个角落停下来然后观看表演。 + 说明:如果FPS低于55,那么这关可能会变形… + +Hyperfluid 60 +-超流体。 + 其实液氦还不够冷,本来这部分还可以更冷一些的… + 说明:蓝色子弹是加速的,而白色的没有。所有蓝色子弹的方向都是相同的。 + 如果限制水平移动的话会简单一些。 + +Level 7 12/930+ Mapped levels +Spring thunder storm - panic? 60 Thunder storm... +-虽然代码是基于上一关写的(看着也很像),但是它们完全不同! + 这个真的很简单… + 说明:试着在屏幕顶端躲避… + 这次试着限制一下竖直方向的移动… + +Rainbow tower - color theory 90 rainbow tower +-基础的关卡。 + 说明:这关是从很老的试验版本的BLR2中拿出来的。 + +Rainbow bullets - nauty photon 60 Lazy level;) +-看着很像第一关的什么东西,但是难多了! + 很拼RP… + 说明:生成子弹的过程比较奇怪…… + +Rainbow effect - appearance 60 draw a rainbow (of bullet) +-随机弹。你一看到这一关就会记住它的。 + 如果你感觉太难,试试评估模式吧。 + 说明:组成彩虹的子弹是不会被消掉的。 + +Rainbow effect - interference 120 as the name tells +-*真的*太简单了…但是为什么呢? + +Rainbow effect - diffraction 120 as the name tells +-相当难。那一大坨有可能糊你一脸。 + 代码也很难看。 + +Rainbow effect - photon school 60 "particalization"! +-仍然相当难(某人:这都第几关了你也不看看……) + 如果你靠近边缘的话可能会简单一点(其实我不知道)。 + +Over the Rainbow - infinity challenge - great circles +-你的目标是冲到红格子上… + 并且这个也很难…… + 如果你技术不过关,并且在玩自由模式,试试“自杀”(<-删除线),这比“好好玩”要经济得多! + 说明:如果你不去碰那个红格子,这关永远不会结束…… + +Trypophobia 120 another two classes: Tail & Pile +-非常难。你永远不知道它们接下来会进入哪个格子(它们自己也不知道)。 + 但是它们不会踏上同一个格子两次。 + 这会引起密集恐惧症吗? + 说明:这关几乎要烧掉我的电脑了…… + 我好像忘了一件重要的事情:刚生成的带生成效果的子弹是没有碰撞判定的… + +Photon fission 90 Use a slightly modified tower8... +-自机狙+随机弹。 + 这是有公式的… + +Wave of Photon 60 class WOP+Lazy of particalization +-一开始一点也不难… + +Return to void 90 return (void)(...); +-非常难!!!(汉字不能大写真是太遗憾了。) + 我不知道这是从哪儿来的。 + CLR没什么用处,但是它会给你短暂的无敌时间… + 说明:有无解的情况… + +Level -1(Extreme) 7/1020 +unknown circles1 60 +-它们靠近边缘的时候会慢下来。*实在是太烦人了!!!* + +unknown circles2 60 +-它们直接堆积在边缘附近了!而且变得越来越厚!!…… + +Spiky 120 +-一个字:难!它们的行为是无法预测的。 + 说明:重复一遍,不要碰激光!会伤害眼睛的… + +Achromatopsia 120(90+30) +-没有路了? + 好好看看这关的名字(色盲)…… + 或者我们可以把这关叫做"绿色盲 vs 红色盲"? + 说明:颜色变换是突然发生的! + +Quad thread 120 +-人类大脑真的支持这个么? + 说明:我的不行… + +Gravity vortex 120 +-跟引力什么的一点关系都没有,但是很难! + 看着挺好看。 + +Supernova(additive blending) 120 +-积攒了足够的能量之后,它们爆炸了——超新星! + 我非常愿意写这种简单的关卡… + 说明:刚生成的子弹…我不能提示更多了。 + +yellow explosive 90 +-没什么可写的关了,于是我就想到了这个。 + --一点也不致命。-- + +Sink over the horizon 90 +-非常奇怪。经常莫名其妙的被封。 + +Incomplete Reflective 120 +-在平静中开始,一团糟中结束。 + 说明:有四分之一的子弹会在碰到墙时爆炸。 + Remark: one in four bullets will explode when it hits the wall. + +Level -2(Assess) 10/? +“评估”关卡 + +由于你到最后肯定会死,所以我来试着预测一下你的死因吧… + +Directed bullet +定向子弹 +-这其实又是复制的什么…… + “塔”并不会影响你,但这其实不是我想要的… + 你的结局可能是…这关玩成什么样都有可能啊。 + +Random bullet +随机子弹 +-彻彻底底的随机。 + 它们在变快? + 你会在一片混乱中结束旅程。(我猜的) + +Constant patterns +固定的图案 +-挺好看的(…) + 但是什么都不像。 + 结局:在恐惧中被干掉? + +Crossing 1(L+R) +交叉1(左右) +-它们转起来了! + 结局:想象一下榨汁机中多汁的橙子。 + +Crossing 2(C) +交叉2 +-直接来自泄矢 诹访子的符卡。 + 圆形的子弹有点令人晕头转向。 + 结局:你猜? + +Trappy +陷阱(形容词…) +-名字很奇怪… + 说明:激光没有故意被生成在你的位置。 + 但是,有三分之一的可能性,它们生成的子弹会朝你飞过来。 + 结局:你在撞上去之前还什么都不知道? + +Sine wave +正弦波 +-示波器? + 找一个合适的位置,跟图像一起振动… + 说明:有些地方是秒撞的! + 结局:喂,我在那个坏掉的示波器上找不到你啊… + +Density test +密度测试 +-这个密度真的很高… + ××?!没路了? + 结局: + 玩家××× + 死于一场可怕的车祸,每滴血都被*挤*到了左边的墙上。 + 这景象真是有点可怕。 + +"Pinballs" +“弹球” +-从r93开始,它们之间也会碰撞了! + 这些球生成时速度是随机的。 + 结局:想象一个大号的保龄球冲你飞了过来。 + +Road Blocks +路障 +-最终你还是能理解这个的… + --Flappy square?... + 结局:可能跟“密度测试”那关很像。 + 别问为什么,现在我有点想吐…… + +Extreme High speed +超高速 +-和第5关某部分类似。 + 你可能不到两秒就撞了! + +Laser crosses +-炫耀激光class? + 结局:煤粉?(对不起,我最近一直在玩工业2…) + +Bonus test: Lunatic Lunar! +奖励:Lunatic Lunar! +-某个古老游戏的什么遗产? + 结局:不能预测。
\ No newline at end of file diff --git a/archive/blr2/Readme b/archive/blr2/Readme new file mode 100644 index 0000000..9161aca --- /dev/null +++ b/archive/blr2/Readme @@ -0,0 +1,288 @@ +This text is encoded in UTF-8. + +This file is mainly about BulletLabRemix II. BulletLabRemix III is still under +heavy development and can be found in the 'src' directory. The implementation +of the script virtual machine is mostly complete, although many functions are +still unimplemented. + + +BulletLabRemix II readme + +Content +------------------------------------------------------------------------------------ +What's this? +Story +Generic Information +Game Modes +Command line options +About the author +"Black History" +Brief History + +What's this? +------------------------------------------------------------------------------------ +"As the name tells", it's the continue, or "free" replacement of Bullet LAB from +Game Boltz, which is a tiny flash game. Having no proprietary software dependences, +it's goal is making the original game "free" and more challanging. + +This is the second work of BulletLabRemix. Compared to the first work, it's much +more mature. However, it's still far away from a complete "framework". And it may +be full of bugs... + +Story +------------------------------------------------------------------------------------ +THE STORY OF THE COLOURS +Once upon a time the colors of the world started to quarrel, all claimed that they +were the best the most important the most useful the favorite. +GREEN said: +「Clearly I am the most important. I am the sign of life and of hope. I was chosen +for grass and trees leaves. Without me all animals would die. Look over the +countryside and you will see that I am in the majority.」 +BLUE interrupted... +「You only think about the earth but consider the sky and the sea. It is the water +that is the basis of life and drawn up by the clouds from the deep sea. The sky +gives space and peace and serenity. Without my peace you would all be nothing.」 +YELLOW chuckled: +「You are all so serious. I bring laughter gaiety and warmth into the world. The +sun is yellow, the moon is yellow and the stars are yellow. Every time you look at +a sunflower, the whole world starts to smile. Without me there would be no fun.」 +ORANGE started next to blow her trumpet. +「I am the color of health and strength. I may be scarce but I am precious, for I +serve the needs of human life. I carry the most important vitamins. Think of +carrots, pumpkins, oranges, mangoes and pawpaws. I don't hang around all the time +but when I fill the sky at sunrise or sunset, my beauty is so striking that no one +gives another thought to any of you.」 +RED could stand it no longer. He shouted out: +「I am the ruler of all of you - I am +blood - lifes blood I am the color of danger and of bravery. I am willing to fight +for a cause. I bring fire into the blood. Without me the earth would be as empty as +the moon. I am the color of passion and of love, the red rose, the poinsettia and +the poppy.」 +PURPLE rose up to his full height. He was very tall and spoke with great pomp: +「I am the color of royalty and power. Kings chiefs and bishops have always chosen +me for I am the sign of authority and wisdom. People do not question me - they +listen and obey.」 +Finally INDIGO spoke much more quietly than all the others but with just as much +determination: +「Think of me. I am the color of silence. You hardly notice me but without me you +all become superficial. I represent thought and reflection twilight and deep water. +You need me for balance and contrast for prayer and inner peace.」 +And so the colors went on boasting each convinced of his or her own superiority. +Their quarreling became louder and louder. Suddenly there was a startling flash of +bright lightening - thunder rolled and boomed. Rain started to pour down +relentlessly. The colors crouched down in fear drawing close to one another for +comfort. +In the midst of the clamor rain began to speak: +「You foolish colors fighting amongst yourselves, each trying to dominate the rest. +Don't you know that you were each made for a special purpose, unique and different? +Join hands with one another and come to me!」 +Doing as they were told, the colors united and joined hands. The rain continued: +「From now on when it rains each of you will stretch across the sky in a great bow +of color as a reminder that you can all live in peace. The rainbow is a sign of +hope for tomorrow. And so whenever a good rain washes the world and a rainbow +appears in the sky let us remember to appreciate one another.」 +------------------------------------------------------------------------------------ +Well, that was about hundreds of thousand years ago. +After a catastrophic disaster, they found some of them were missing... +------------------------------------------------------------------------------------ + +Generic Information +------------------------------------------------------------------------------------ +My own comment on this game... +A "game" filled with the smell of mysterious science and imagination(3:2 approximately). +(I worked on it for almost 9 months, after all.) +Others' comments... +-PIECE OF SHIT!!! +-The author must be suffering from serious mental problems.(I agree...) +-(literally translated from Chinese) Revenge on society... + +Requirements & Recommends +Basic environment: +CPU: 1GHz. +RAM: 256MiB. +GPU&VRAM: With DirectX 9+/OpenGL 1.2+ support. +OS*: Windows XP+ & DirectX 9 / Linux kernel 2.6+ & OpenGL 1.2+ +Recommended environment: +CPU: Lots of cores. +GPU&VRAM: Very fast graphic rendering. +Sound: Ability to run OpenAL software version. + +*: According to Micro$oft and MinGW, this game should also run in Windows +98(SE)/ME**, but who's still using that? +**: The source code is just there. You can even port it to MS-DOS... + +MORE Recommends... +-SERIOUSLY, NO Trypophobia! +-CheatEngine(skip levels, obtain more Clear Range's, and more...) +-Some editors or compilers(If you find this impossible and want to make it easier) +-(Additionally for the last one)Ability to read non human-readable code. +-Achromatopsia(<-strikethrough) + +How to install&run it... +Windows: +Just extract all files in the archive somewhere, then start the only executable +file in it. +Linux: +See INSTALL. + +If, suddenly, you can't run it one day... +Remove .blrrc then restart the game. +It will ask you for initial settings. +If this can't solve your problem, read FAQ.TXT for more. + +If you think something went wrong... +Go to FAQ.txt. + +To Dear Windows Users +This game is developed and tested mostly under Linux. The official Windows version is also +built under Linux(awesome, isn't it?). It's only briefly tested. + +How to play it? +This section has been moved to the built-in help. Select "help" in the main menu to view +it. + +Menus +----------------------------------------------------------------------- +Main menu + +Start Select a mode and start the game. +Highscores View highscores +Options Settings and Options +About A dull credits list. +Exit Parents are coming!! + +Game Modes +----------------------------------------------------------------------- +Classic +The game ends instantly if you get a collision. However you can choose +to continue... + +This mode kills your time silently. + +Assessment Mode +You are the frog being boiled: all levels get harder as time goes. +You'll be brought to the next part if you had a collision. + +Most levels are designed to be IMPOSSIBLE after the elapsed time have +exceeded a certain value. + +Go for the highest score! + +Free Play Mode +You'll never die! Enjoy!... + +Options +----------------------------------------------------------------------- +Fullscreen Toggles fullscreen. Requires restart. You can also try Alt+Enter. +VSync Toggles vsync. If your screen refresh rate is 60Hz, enable it. +Clear Range Key Select key for calling/charging CLR. +Resolution Select a resolution. Please note that the native reso. is 800x600. +Music Volume Change music volume. +SFX Volume Change SFX volume. +Player Preference See below. + +Player Preference +------------------------------------------------ +Moving Speed Speed when moving without holding shift. +Precise Moving Speed Speed when moving holding shift. +Clear Range Bonus Get more CLR's for each part. +Clear Range Mode Change CLR mode. +Ability Point If this value is greater than 10000, you can't save your settings. + +Command line options +------------------------------------------------------------------------------------ +Yes, it accept command line options! (And some of them may be very useful...) +You can override your settings with them if you can't start it after changing the settings. +However they may cause strange behavior or crashes. So use with caution. +Invalid parameters may cause unexpected behavior, (e.g. --start with inappropriate parameters) +they should be used for debug purpose. But if you use it for cheating, I'm not against it. +If it's run without arguments, the game will start normally. +Otherwise... see below. +--help Print command line usage and exit. +--version Print version and exit. +--start=x,y Start free play mode directly from level x part y. The part must be valid. +--nosound Forcibly use no sound. +--fullscreen=1/0 Forcibly use fullscreen/windowed. This will override your configuration. +--vidmode=0~4 Forcibly use specific video mode instead the one in the configuration. + 0 800x600 (native resolution) + 1 640x480 + 2 960x720 + 3 1024x768 + 4 1280x960 +--firststartup Forcibly run first start up. The score file will be preserved if exist. +--fast Fast mode. All levels are two times shorter. +--logfile=... Use an alternate log file name instead of the default "BLRLOG.txt". +--nohideconsole Do not hide console (Windows version only). + +About the author +------------------------------------------------------------------------------------ +-Senseless(this word has multiple means...) +-Often know nothing to do next. If I accidently got it, I would do it at once. +(slowly, though) +-「The perfect balance of code length and efficiency 」 +-One of those "who (like to) live on the edge". --according to Debian maintainers. +-Strange (as many people say) + +This is my first(or second?) time making so big a project. So, this game is written +for a "framework" rather than the game itself. However, the "framework" seems to be +very incomplete till now. Everything is still code...(Maybe this is just the +"framework"?) + +Well, one day textures may also become code... That is, all textures will be drawn +to the memory during the initialization... + +"Black History" +------------------------------------------------------------------------------------ +This game first started as an simple hge&c++ rewrite of the original game "BulletLab". +For an unknown reason, it became bigger and bigger, the core of hge is even altered. +Several months or so after the creation of the project, BLRI(aka "The Creature of +Colour") released. + +As BLRI was being finished, BLRII was forked from the code base of BLRI. +Several "testbed" version was created over the code base of BLRI. +Then the pre-release version created. Almost all original code from BLRI is removed. +Now it has reached a position that I've never expected... + +See "The development" in the file "Extras" for more details. + +Brief History +------------------------------------------------------------------------------------ +The file ChangeLog contains the full history of this project. +Here's a list of released-to-public versions. +0.9.9-0 (r99) +The final Release Candidate. Complete the whole game system. +Fixing most of the bugs. + +0.9.1-1_PR (r86) +Comes with all levels that will appear in the final release. +Done menu rewrite. +Make multiplier system functional. + +0.7.3-0_PR (b73) +Comes with all seven "normal" levels. +Many bug fixes, making the Windows port (almost) stable. +Huge code changes happened here. + +0.4.4-0_PRG (b37a) +Comes with four levels and some parts of the fifth level. +Contains several bug fixes. + +0.2.9-1_PR (b21) +First public prerelease version. +Comes with two levels. +Introduced multiplier system, not functional yet. + +0.1.7-2_PR (b16) +Level 1 is finished. + +TB130907 (b10) +Laser implementation rev 2. + +TB130827 (b8) +Initial laser implementation. + +TB130620~TB130818 (b1~b7) +New towers and new levels. + +TB130610 (b0) +Creation of the Testbed version.
\ No newline at end of file diff --git a/archive/blr2/Readme.zh b/archive/blr2/Readme.zh new file mode 100644 index 0000000..f712fca --- /dev/null +++ b/archive/blr2/Readme.zh @@ -0,0 +1,274 @@ +This text is encoded in UTF-8. +这是一个提前发布的版本,这意味着: +-它可能会崩溃,甚至导致数据丢失。 +-奇怪的行为。 +-代码都可能编译不了! + +BulletLabRemix II Readme - 一个类似机翻的中文版 + +目录 +------------------------------------------------------------------------------------ +这是什么? +背景 +概要 +模式 +命令行选项 +关于作者 +历史 +简短的版本历史 + + +这是什么? +------------------------------------------------------------------------------------ +“正如名字告诉你的”,它是GameBoltz的一个小flash游戏——Bullet LAB的延续,或者“自由”替代品。 +它不依赖任何专有的软件。它的目标是让原游戏变得“自由”并且更具挑战性。 +这是BulletLabRemix的第二个版本。与第一个版本比起来,它成熟得多。但是,它离一个完整的“框架”还差得远。 +并且它还有可能到处是bug… + +背景 +------------------------------------------------------------------------------------ +//听说已经是高中英语完型填空了,就偷懒不翻译了… +THE STORY OF THE COLOURS +Once upon a time the colors of the world started to quarrel, all claimed that they +were the best the most important the most useful the favorite. +GREEN said: +「Clearly I am the most important. I am the sign of life and of hope. I was chosen +for grass and trees leaves. Without me all animals would die. Look over the +countryside and you will see that I am in the majority.」 +BLUE interrupted... +「You only think about the earth but consider the sky and the sea. It is the water +that is the basis of life and drawn up by the clouds from the deep sea. The sky +gives space and peace and serenity. Without my peace you would all be nothing.」 +YELLOW chuckled: +「You are all so serious. I bring laughter gaiety and warmth into the world. The +sun is yellow, the moon is yellow and the stars are yellow. Every time you look at +a sunflower, the whole world starts to smile. Without me there would be no fun.」 +ORANGE started next to blow her trumpet. +「I am the color of health and strength. I may be scarce but I am precious, for I +serve the needs of human life. I carry the most important vitamins. Think of +carrots, pumpkins, oranges, mangoes and pawpaws. I don't hang around all the time +but when I fill the sky at sunrise or sunset, my beauty is so striking that no one +gives another thought to any of you.」 +RED could stand it no longer. He shouted out: +「I am the ruler of all of you - I am +blood - lifes blood I am the color of danger and of bravery. I am willing to fight +for a cause. I bring fire into the blood. Without me the earth would be as empty as +the moon. I am the color of passion and of love, the red rose, the poinsettia and +the poppy.」 +PURPLE rose up to his full height. He was very tall and spoke with great pomp: +「I am the color of royalty and power. Kings chiefs and bishops have always chosen +me for I am the sign of authority and wisdom. People do not question me - they +listen and obey.」 +Finally INDIGO spoke much more quietly than all the others but with just as much +determination: +「Think of me. I am the color of silence. You hardly notice me but without me you +all become superficial. I represent thought and reflection twilight and deep water. +You need me for balance and contrast for prayer and inner peace.」 +And so the colors went on boasting each convinced of his or her own superiority. +Their quarreling became louder and louder. Suddenly there was a startling flash of +bright lightening - thunder rolled and boomed. Rain started to pour down +relentlessly. The colors crouched down in fear drawing close to one another for +comfort. +In the midst of the clamor rain began to speak: +「You foolish colors fighting amongst yourselves, each trying to dominate the rest. +Don't you know that you were each made for a special purpose, unique and different? +Join hands with one another and come to me!」 +Doing as they were told, the colors united and joined hands. The rain continued: +「From now on when it rains each of you will stretch across the sky in a great bow +of color as a reminder that you can all live in peace. The rainbow is a sign of +hope for tomorrow. And so whenever a good rain washes the world and a rainbow +appears in the sky let us remember to appreciate one another.」 +------------------------------------------------------------------------------------ +Well, that was about hundreds of thousand years ago. +After a catastrophic disaster, they found some of them were missing... +------------------------------------------------------------------------------------ + +概要 +------------------------------------------------------------------------------------ +本人对该游戏的看法 +一个充斥着神秘的科学和想象气息的「游戏」(大约有3:2?) +(毕竟是9个月的工作啊) +别人的看法… +-「一坨屎!!!」 +-「作者有精神疾病?」(我同意…) +-「报复社会?」 + +运行环境要求&推荐项目 +必需环境: +CPU: 1GHz. +RAM: 256MiB. +GPU&VRAM: 支持DirectX 9+或者OpenGL 1.2+. +操作系统*: Windows XP+ & DirectX 9 / Linux kernel 2.6+ & OpenGL 1.2+ +推荐环境: +CPU: 大量的处理器核心。 +GPU&VRAM: 非常快的渲染速度。 +声音: 能够运行OpenAL软件版。 + +*: 根据微软和MinGW的说法,本游戏*应该*也能在Windows 98(SE)/ME**下运行。但是谁 +还在用那种东西呢?… +**: 反正源代码都有。你甚至可以考虑把它移植到MS-DOS… + +*更多*推荐项目…: +-严肃的一项:不能有密集恐惧症! +-CheatEngine(跳关,获取更多CLR…) +-编辑器和编译器(如果你发现它太难,想要让它变简单些) +-(附加在上一条之上)能读懂及其丑陋的代码。 +-全色盲(<-删除线) + +如何安装/运行它… +Windows: +只需要把压缩包中的所有文件解压到某个地方,然后运行其中唯一的一个可执行程序就行了。 +Linux: +见INSTALL文件。 + +如果有一天你突然无法运行它了… +删掉.blrrc然后重新运行。它会重新进行初始化设定。 +如果这样无法解决你的问题,去看看FAQ.TXT。 + +如果你认为什么东西出错了… +->FAQ.TXT + +致亲爱的Windows用户 +开发和测试基本是在Linux下进行的。发布的Windows版也是从Linux下编译的(听起来很厉害?)。Windows版 +只进行过简单的测试。 + +怎么玩? +这部分已经移动到游戏内的帮助里了,它在主菜单的help选项中。 +如果您看不懂,建议使用机器翻译… + +菜单 +------------------------------------------------------------------------------------ +主菜单 +----------------------------------------------------------------------- +Start 选择一个模式并开始游戏。 +Highscores 浏览高分记录。 +Options 设置和选项。 +About 一个无聊的制作人员名单。 +Exit ××来了! + +模式 +----------------------------------------------------------------------- +Classic 经典模式 +一旦你碰到了任何有判定的东西就立刻结束游戏。不过你可以选择继续… + +这种模式非常浪费时间… + +Assessment Mode 评分/检测模式 +温水煮青蛙实验:所有的关卡都会随着时间流逝而变难。 +如果你撞到了有判定的东西,就会进入下一关… + +大多数的关卡最后都会变成无法通过的…(当时间超过某个设定好的值之后) + +试着撑过最长的时间吧! + +Free Play Mode 自由模式 +永远不会死的模式!… + +选项 +----------------------------------------------------------------------- +Fullscreen 是否全屏。重启程序后生效。你也可以试试Alt+回车。 +VSync 是否开启垂直同步。如果你的屏幕刷新率是60Hz就启用它。 +Clear Range Key 选择一个用于使用CLR或为CLR“蓄力”的键。 +Resolution 选择分辨率。默认分辨率是800x600。 +Music Volume 更改背景音乐的音量。 +SFX Volume 更改音效的音量。 +Player Preference 见下面。 + +Player Preference +------------------------------------------------ +Moving Speed 不按shift时的移动速度。 +Precise Moving Speed 按住shift时的移动速度。 +Clear Range Bonus 在每关开始时获得更多CLR。 +Clear Range Mode 更改CLR的模式。 +Ability Point 如果该数值超过10000,你无法保存此页的设置。 + +命令行选项 +------------------------------------------------------------------------------------ +是的,它还接受命令行选项!(而且它们中有些还可能比较有用…) +如果你调整了设置后无法运行了,你可以用它们来覆盖你的设置。 +但是它们中一些可能导致奇怪的行为或者崩溃。所以请小心使用。 +不合法的参数可能会导致不希望得到的结果(例如--start+不合适的参数) +它们本来只应该用于调试目的。但是如果你要用它们来作弊,也没人反对… +如果不带任何参数运行,游戏会以正常模式启动。 +其他情况的话。。。: +--help 输出命令行用法并退出。 +--version 输出版本信息并退出。 +--start=x,y 直接从x关y部分开始自由模式的游戏。这个部分必须合法。 +--nosound 强制无声。 +--fullscreen=1/0 强制使用全屏/窗口模式。指定该选项后,直接无视blr.cfg中的全屏选项。 +--vidmode=0~4 强制使用指定的窗口尺寸。 + 0 800x600 (原生大小) + 1 640x480 + 2 960x720 + 3 1024x768 + 4 1280x960 +--firststartup 假定是第一次运行。如果分数记录文件存在的话它会被保留。 +--fast 「高速」模式。所有关卡都会变短两倍。 +--logfile=... 使用指定的日志文件名。 +--nohideconsole 不隐藏命令行输出窗口。(仅限Windows版本。) + +关于作者 +------------------------------------------------------------------------------------ +-Senseless(this word has multiple means...) +-Often know nothing to do next. If I accidently got it, I would do it at once. +(slowly, though) +-「The perfect balance of code length and efficiency 」 +-One of those "who (like to) live on the edge". --according to Debian maintainers. +-Strange (as many people say) + +这是我第一次(或者是第二次?)搞这么大的一个工程。所以这次与其说是写一个游戏,还不如说只是写了一个 +“框架”。但是,这个“框架”到现在看起来还非常不完整。所有东西都还是代码…(或许这样也算是一种「框架」?) + +好吧,有一天贴图甚至都会变成代码了…到那时贴图会在初始化时被现画到内存里… + +历史 +------------------------------------------------------------------------------------ +这个工程本来只是作为一个BulletLab的hge&C++重写开始的。 +由于未知的原因,它越来越大,甚至都改变了hge的核心。 +工程开始几个月后,BLRI(The Creature of Colour)发布了。 + +当BLRI快要完成的时候,BLRII从BLRI中fork了出来。 +当时在BLRI代码的基础上建立了几个测试版本。 +后来预发布版建立了,几乎所有来自BLRI的代码都被删掉了。 +现在它达到了一个我从未期望它能达到的阶段… + +简短的版本历史 +------------------------------------------------------------------------------------ +ChangeLog包含了该工程的全部历史。 +这里是一个「里程碑」的列表。 +0.9.9-0 (r99) +最终的候选版本。完成了整个游戏系统。 +修复了大部分的bug。 + +0.9.1-1_PR (r86) +当前的公开版本。已经包含了所有会出现在最终版本里的关卡。 +菜单重写完成。 +“倍数系统”终于能正常工作了。 + +0.7.3-0_PR (b73) +包含7个关卡。 +众多问题修复,Windows版基本稳定了。 +代码发生了巨大的变化。 + +0.4.4-0_PRG (b37a) +包含4个多一点的关卡。 +修正了一部分问题。 + +0.2.9-1_PR (b21) +第一个公开版,包含两个完整的关卡。 +初次出现了“倍数”系统,但是没有实际作用。 + +0.1.7-2_PR (b16) +第一关完成。 + +TB130907 (b10) +激光实现重写。 + +TB130827 (b8) +最早的支持“激光”的版本。 + +TB130620~TB130818 (b1~b7) +添加新的“塔”和关卡。 + +TB130610 (b0) +试验版本建立。 diff --git a/archive/blr2/VERSION b/archive/blr2/VERSION new file mode 100755 index 0000000..9f8cf97 --- /dev/null +++ b/archive/blr2/VERSION @@ -0,0 +1 @@ +1.0.0-0 (r101)
\ No newline at end of file diff --git a/archive/blr2/resources/b_diff.png b/archive/blr2/resources/b_diff.png Binary files differnew file mode 100755 index 0000000..400cac9 --- /dev/null +++ b/archive/blr2/resources/b_diff.png diff --git a/archive/blr2/resources/b_inter.png b/archive/blr2/resources/b_inter.png Binary files differnew file mode 100644 index 0000000..00976a5 --- /dev/null +++ b/archive/blr2/resources/b_inter.png diff --git a/archive/blr2/resources/b_leaves.png b/archive/blr2/resources/b_leaves.png Binary files differnew file mode 100755 index 0000000..6bd4a8b --- /dev/null +++ b/archive/blr2/resources/b_leaves.png diff --git a/archive/blr2/resources/b_null.png b/archive/blr2/resources/b_null.png Binary files differnew file mode 100755 index 0000000..7c60dce --- /dev/null +++ b/archive/blr2/resources/b_null.png diff --git a/archive/blr2/resources/bdig.fnt b/archive/blr2/resources/bdig.fnt new file mode 100644 index 0000000..453c492 --- /dev/null +++ b/archive/blr2/resources/bdig.fnt @@ -0,0 +1,15 @@ +[HGEFONT] + +Bitmap=credits.png + +Char="-",340,354,23,33,0,0 +Char="0",6,354,30,33,0,0 +Char="1",46,354,14,33,0,0 +Char="2",72,354,29,33,0,0 +Char="3",105,354,29,33,0,0 +Char="4",140,354,26,33,0,0 +Char="5",171,354,28,33,0,0 +Char="6",204,354,29,33,0,0 +Char="7",238,354,27,33,0,0 +Char="8",269,354,31,33,0,0 +Char="9",302,354,31,33,0,0 diff --git a/archive/blr2/resources/blnsns.png b/archive/blr2/resources/blnsns.png Binary files differnew file mode 100755 index 0000000..ae8f7d4 --- /dev/null +++ b/archive/blr2/resources/blnsns.png diff --git a/archive/blr2/resources/charmap.fnt b/archive/blr2/resources/charmap.fnt new file mode 100755 index 0000000..f31840d --- /dev/null +++ b/archive/blr2/resources/charmap.fnt @@ -0,0 +1,99 @@ +[HGEFONT]
+
+Bitmap=blnsns.png
+
+Char=" ",1,1,3,36,-1,7
+Char="!",5,1,6,36,1,1
+Char=""",12,1,10,36,0,0
+Char="#",23,1,24,36,0,-1
+Char="$",48,1,15,36,0,-1
+Char="%",64,1,25,36,0,0
+Char="&",90,1,23,36,0,0
+Char="'",114,1,5,36,0,1
+Char="(",120,1,12,36,1,-1
+Char=")",133,1,12,36,-1,1
+Char="*",146,1,13,36,0,-1
+Char="+",160,1,15,36,-1,0
+Char=",",176,1,9,36,-1,0
+Char="-",186,1,13,36,0,0
+Char=".",200,1,7,36,0,0
+Char="/",208,1,10,36,0,0
+Char="0",219,1,20,36,0,0
+Char="1",240,1,9,36,11,0
+Char="2",250,1,16,36,4,0
+Char="3",267,1,16,36,4,0
+Char="4",284,1,18,36,2,0
+Char="5",303,1,17,36,3,0
+Char="6",321,1,17,36,3,0
+Char="7",339,1,17,36,3,0
+Char="8",357,1,17,36,3,0
+Char="9",375,1,17,36,3,0
+Char=":",393,1,7,36,0,0
+Char=";",401,1,9,36,-2,0
+Char="<",411,1,13,36,0,-1
+Char="=",425,1,15,36,0,0
+Char=">",441,1,12,36,0,0
+Char="?",454,1,15,36,-1,0
+Char="@",470,1,20,36,0,1
+Char="A",1,38,24,36,-1,-1
+Char="B",26,38,20,36,1,0
+Char="C",47,38,21,36,0,-1
+Char="D",69,38,22,36,1,0
+Char="E",92,38,17,36,1,0
+Char="F",110,38,17,36,1,0
+Char="G",128,38,23,36,0,0
+Char="H",152,38,22,36,1,1
+Char="I",175,38,6,36,1,1
+Char="J",182,38,9,36,-1,1
+Char="K",192,38,20,36,1,-1
+Char="L",213,38,17,36,1,0
+Char="M",231,38,25,36,1,1
+Char="N",257,38,22,36,1,1
+Char="O",280,38,25,36,0,0
+Char="P",306,38,20,36,1,0
+Char="Q",327,38,25,36,0,0
+Char="R",353,38,19,36,1,0
+Char="S",373,38,15,36,1,0
+Char="T",389,38,18,36,0,-1
+Char="U",408,38,20,36,1,1
+Char="V",429,38,21,36,0,0
+Char="W",451,38,30,36,0,0
+Char="X",482,38,20,36,0,-1
+Char="Y",1,75,20,36,0,0
+Char="Z",22,75,19,36,-1,-1
+Char="[",42,75,11,36,2,-1
+Char="\",54,75,10,36,0,0
+Char="]",65,75,11,36,-1,2
+Char="^",77,75,17,36,-1,0
+Char="_",95,75,17,36,-1,-1
+Char="`",113,75,11,36,0,1
+Char="a",125,75,19,36,0,0
+Char="b",145,75,17,36,1,1
+Char="c",163,75,13,36,0,1
+Char="d",177,75,18,36,0,1
+Char="e",196,75,15,36,0,1
+Char="f",212,75,12,36,-1,-1
+Char="g",225,75,17,36,0,1
+Char="h",243,75,16,36,1,1
+Char="i",260,75,7,36,1,0
+Char="j",268,75,9,36,-2,1
+Char="k",278,75,17,36,1,1
+Char="l",296,75,6,36,1,1
+Char="m",303,75,29,36,0,1
+Char="n",333,75,17,36,0,1
+Char="o",351,75,17,36,0,0
+Char="p",369,75,18,36,0,1
+Char="q",388,75,19,36,0,0
+Char="r",408,75,12,36,0,-1
+Char="s",421,75,9,36,0,1
+Char="t",431,75,12,36,-1,1
+Char="u",444,75,17,36,1,1
+Char="v",462,75,17,36,0,1
+Char="w",480,75,26,36,0,-1
+Char="x",1,112,14,36,0,1
+Char="y",16,112,15,36,0,1
+Char="z",32,112,14,36,0,0
+Char="{",47,112,13,36,0,-1
+Char="|",61,112,5,36,2,1
+Char="}",67,112,12,36,0,0
+Char="~",80,112,18,36,0,-1
diff --git a/archive/blr2/resources/credits.png b/archive/blr2/resources/credits.png Binary files differnew file mode 100755 index 0000000..d647d86 --- /dev/null +++ b/archive/blr2/resources/credits.png diff --git a/archive/blr2/resources/e_leaf.png b/archive/blr2/resources/e_leaf.png Binary files differnew file mode 100755 index 0000000..d64d6ca --- /dev/null +++ b/archive/blr2/resources/e_leaf.png diff --git a/archive/blr2/resources/e_sflake.png b/archive/blr2/resources/e_sflake.png Binary files differnew file mode 100644 index 0000000..963d85e --- /dev/null +++ b/archive/blr2/resources/e_sflake.png diff --git a/archive/blr2/resources/e_skyitem.png b/archive/blr2/resources/e_skyitem.png Binary files differnew file mode 100644 index 0000000..e3e168b --- /dev/null +++ b/archive/blr2/resources/e_skyitem.png diff --git a/archive/blr2/resources/help.png b/archive/blr2/resources/help.png Binary files differnew file mode 100644 index 0000000..32718ee --- /dev/null +++ b/archive/blr2/resources/help.png diff --git a/archive/blr2/resources/menus.png b/archive/blr2/resources/menus.png Binary files differnew file mode 100644 index 0000000..9ce0aba --- /dev/null +++ b/archive/blr2/resources/menus.png diff --git a/archive/blr2/resources/ss.png b/archive/blr2/resources/ss.png Binary files differnew file mode 100755 index 0000000..e34abbb --- /dev/null +++ b/archive/blr2/resources/ss.png diff --git a/archive/blr2/resources/tap.ogg b/archive/blr2/resources/tap.ogg Binary files differnew file mode 100755 index 0000000..1ef00b0 --- /dev/null +++ b/archive/blr2/resources/tap.ogg diff --git a/archive/blr2/resources/title.png b/archive/blr2/resources/title.png Binary files differnew file mode 100644 index 0000000..f0801ef --- /dev/null +++ b/archive/blr2/resources/title.png diff --git a/archive/blr2/resources/vdig.fnt b/archive/blr2/resources/vdig.fnt new file mode 100644 index 0000000..6d89742 --- /dev/null +++ b/archive/blr2/resources/vdig.fnt @@ -0,0 +1,20 @@ +[HGEFONT] + +Bitmap=credits.png + +Char=" ",541,279,1,50,33,5 +Char="(",326,278,23,61,0,0 +Char=")",354,278,23,60,0,0 +Char="-",512,279,29,50,0,0 +Char=".",483,279,7,50,13,14 +Char="0",244,222,42,50,0,0 +Char="1",305,222,15,50,0,0 +Char="2",341,222,39,50,0,0 +Char="3",389,222,39,50,0,0 +Char="4",440,222,34,50,0,0 +Char="5",485,222,39,50,0,0 +Char="6",533,222,39,50,0,0 +Char="7",248,279,34,50,0,0 +Char="8",383,279,43,50,0,0 +Char="9",433,279,39,50,0,0 +Char="r",293,279,29,50,0,0 diff --git a/archive/blr2/src/background.h b/archive/blr2/src/background.h new file mode 100644 index 0000000..849438c --- /dev/null +++ b/archive/blr2/src/background.h @@ -0,0 +1,574 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Background drawing Implementations +// Copyright Chrisoft 2014 +#include <list> +const char* BACKGROUND_H_FN="background.h"; + +double deltaBG; +//******************************************** +//Full-screen Leaves Background +//******************************************** +class BG_Leaves +{ +private: + DWORD alpha,alim; + bool onfadein,onfadeout; + int fadebreak; + hgeSprite* BGSpr; + HTEXTURE LeafTex; + void DoFadeIn() + { + if (LOWFPS)fadebreak+=17;else ++fadebreak; + if (fadebreak>17)fadebreak=0;else return; + if (LOWFPS)if(alpha+0x20<=alim)alpha+=0x20;else{} + else if (alpha+0x2<=alim)alpha+=2; + if (alpha>=alim)onfadein=false; + } + void DoFadeOut() + { + if (LOWFPS)fadebreak+=17;else ++fadebreak; + if (fadebreak>30)fadebreak=0;else return; + if (LOWFPS) + if (alpha<0x20)alpha=0;else alpha-=0x20; + else + if (alpha<0x2)alpha=0;else alpha-=0x2; + if (!alpha)onfadeout=0; + } +public: + bool IsActive() + { + return alpha?true:false; + } + void Init(DWORD limalpha) + { + LeafTex=hge->Texture_Load("./Resources/b_leaves.png"); + BGSpr=new hgeSprite(LeafTex,0,0,200,150); + BGSpr->SetColor(0x00CCCCCC); + onfadein=onfadeout=false;alpha=0x00;alim=limalpha;fadebreak=0; + + } + void SetFadeIn() + { + alpha=0x01; + onfadein=true; + } + void SetFadeOut() + { + alpha=alim; + onfadeout=true; + } + void Update() + { + double tx,ty,dt; + if (onfadein)DoFadeIn(); + if (onfadeout)DoFadeOut(); + dt=hge->Timer_GetDelta(); + deltaBG+=dt; + tx=200*cosf(deltaBG/10); + ty=150*sinf(deltaBG/10); + BGSpr->SetColor(ARGB(alpha,0xCC,0xCC,0xCC)); + for (int i=-1;i<5;++i) + for (int j=-1;j<5;++j) + BGSpr->Render(i*199.0f+tx,j*149.0f+ty); + } +}; +BG_Leaves Leaves; +//******************************************** +//Animated Leaves Background +//******************************************** +HTEXTURE TLeaf; +HTEXTURE TSflake; +bool LE_Active; +double lescale; +HTEXTURE letex;TextureRect letr; +DWORD lecolor; +class Leaf_Node +{ +private: + hgeSprite* Leaf; + double Rotation,DRotate; + double x,y,dx,dy; +public: + void init() + { + Leaf=new hgeSprite(letex,letr.x,letr.y,letr.w,letr.h); + Leaf->SetColor(lecolor); + x=rand()%908-108;y=-108; + dx=rand()%200/100.0f-1.0f;dx*=0.075; + dy=rand()%200/100.0f+0.5f;dy*=0.075; + Rotation=0;DRotate=rand()%100/10000.0f;DRotate*=0.1; + } + bool Update() + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + { + Rotation+=DRotate; + x+=dx;y+=dy; + } + if (x>908||x<-108||y>708)return 1; + Leaf->RenderEx(x,y,Rotation,lescale); + return 0; + } +}; +class Leaf_Anim +{ +public: + std::list<Leaf_Node> llist; + double brk; + void Init() + { + llist.clear(); + brk=rand()%1000/1250.0f; + } + void Update() + { + brk-=hge->Timer_GetDelta(); + if(brk<0) + { + brk=rand()%1000/1250.0f; + Leaf_Node a;a.init(); + llist.push_back(a); + } + for(std::list<Leaf_Node>::iterator i=llist.begin();i!=llist.end();++i) + { + if(i->Update()) + { + std::list<Leaf_Node>::iterator r=i;++r; + llist.erase(i);i=--r; + } + } + } +}Leaf; +//******************************************** +//3D-sky Background +//Based on a hge tutorial +//******************************************** +static const DWORD skyTopColors[3] = {0xFF15092A, 0xFF6C6480, 0xFF89B9D0}; +static const DWORD skyBtmColors[3] = {0xFF303E57, 0xFFAC7963, 0xFFCAD7DB}; +static const DWORD seaTopColors[3] = {0xFF3D546B, 0xFF927E76, 0xFF86A2AD}; +static const DWORD seaBtmColors[3] = {0xFF1E394C, 0xFF2F4E64, 0xFF2F4E64}; +static const int skyseq[9]={0, 0, 1, 2, 2, 2, 1, 0, 0}; +class TDSky +{ +#define ScreenWidth 800 +#define ScreenHeight 600 +#define Stars 100 +#define SeaDisize 16 +#define SkyHeight (ScreenHeight*0.6f) +#define StarsHeight (SkyHeight*0.9f) +#define OrbitRadius (ScreenWidth*0.43f) +private: + HTEXTURE skyitem; + hgeQuad skygrad; + hgeSprite *sun,*moon,*glow,*seaglow,*star; + hgeDistortionMesh *sea,*skylyr; + float timet,speed,skya,skylima,seq_residue; + int seq_id; + float starX[Stars],starY[Stars],starS[Stars],starA[Stars],seaP[SeaDisize]; + hgeColor colWhite,colSkyTop,colSkyBtm,colSeaTop,colSeaBtm; + hgeColor colSun,colSunGlow; + hgeColor colMoon,colMoonGlow,colSeaGlow; + float sunX,sunY,sunS,sunGlowS; + float moonX,moonY,moonS,moonGlowS; + float seaGlowX,seaGlowSX,seaGlowSY; + bool skyOnFadeIn,skyOnFadeOut; + float GetTime() + { + struct tm *t=0; + time_t tt=time(NULL); + t=localtime(&tt); + float tmp=0; + if(t) + { + tmp=t->tm_sec; + tmp=t->tm_min+tmp/60.0f; + tmp=t->tm_hour+tmp/60.0f; + } + return tmp; + } + void SkyDoFadeIn() + { + float dlt=1.0f/hge->Timer_GetFPS(); + if (skya+dlt<skylima)skya+=dlt; + else skya=skylima,skyOnFadeIn=false; + } + void SkyDoFadeOut() + { + float dlt=1.0f/hge->Timer_GetFPS(); + if (skya-dlt>0)skya-=dlt; + else skya=0.0f,skyOnFadeOut=false; + } +public: + bool Init() + { + skyitem=hge->Texture_Load("./Resources/e_skyitem.png"); + if(!skyitem) return false; + skygrad.tex=0;skygrad.blend=BLEND_DEFAULT; + for(int i=0;i<4;++i)skygrad.v[i].z=0.5; + skygrad.v[0].tx=0;skygrad.v[0].ty=0; + skygrad.v[1].tx=1;skygrad.v[1].ty=0; + skygrad.v[2].tx=1;skygrad.v[2].ty=1; + skygrad.v[3].tx=0;skygrad.v[3].ty=1; + skygrad.v[0].x=0;skygrad.v[0].y=0; + skygrad.v[1].x=800;skygrad.v[1].y=0; + skygrad.v[2].x=800;skygrad.v[2].y=600; + skygrad.v[3].x=0;skygrad.v[3].y=600; + sea=new hgeDistortionMesh(SeaDisize, SeaDisize); + sea->SetTextureRect(0, 0, ScreenWidth, ScreenHeight-SkyHeight); + sun=new hgeSprite(skyitem,81,0,114,114); + sun->SetHotSpot(57,57); + moon=new hgeSprite(skyitem,0,0,81,81); + moon->SetHotSpot(40,40); + star=new hgeSprite(skyitem,195,0,9,9); + star->SetHotSpot(5,5); + glow=new hgeSprite(skyitem,204,0,128,128); + glow->SetHotSpot(64,64); + glow->SetBlendMode(BLEND_COLORADD | BLEND_ALPHABLEND | BLEND_NOZWRITE); + seaglow=new hgeSprite(skyitem,204,96,128,32); + seaglow->SetHotSpot(64,0); + seaglow->SetBlendMode(BLEND_COLORADD | BLEND_ALPHAADD | BLEND_NOZWRITE); + skylyr=new hgeDistortionMesh(16, 16); + skylyr->SetTexture(skyitem); + skylyr->SetTextureRect(0,128,512,512); + skylyr->SetBlendMode(BLEND_ALPHAADD); + colWhite.SetHWColor(0xFFFFFFFF); + timet=GetTime(); + speed=skya=0.0f; + for(int i=0;i<Stars;++i) + { + starX[i]=rand()%ScreenWidth; + starY[i]=rand()%((int)StarsHeight); + starS[i]=(rand()%60+10.0f)/100.0f; + } + for(int i=0;i<SeaDisize;++i) + { + seaP[i]=i+(rand()%300-150.0f)/10.0f; + } + return true; + } + void Deinit() + { + delete seaglow;delete glow; + delete star;delete moon; + delete sun; + delete sea;delete skylyr; + hge->Texture_Free(skyitem); + } + void SetSpeed(float _speed){speed=_speed;} + void SetSkyA(float _skya){skya=_skya;} + void SetTime(float _timet){timet=_timet;} + void SkySetFadeIn(float _starta=0.0f,float _lima=1.0f) + { + skya=_starta;skylima=_lima; + skyOnFadeIn=true;skyOnFadeOut=false; + } + void SkySetFadeOut(float _starta=0.0f) + { + if (_starta>1E-4)skya=_starta; + skyOnFadeIn=false;skyOnFadeOut=true; + } + void Update() + { + int i, j, k; + float zenith,a,dy,fTime; + float posX,s1,s2; + const float cellw=ScreenWidth/(SeaDisize-1); + hgeColor col1,col2; + DWORD dwCol1,dwCol2; + if(speed==0.0f) timet=GetTime(); + else + { + timet+=hge->Timer_GetDelta()*speed; + if(timet>=24.0f) timet-=24.0f; + } + seq_id=(int)(timet/3); + seq_residue=timet/3-seq_id; + zenith=-(timet/12.0f*pi-pi/2.0f); + col1.SetHWColor(skyTopColors[skyseq[seq_id]]); + col2.SetHWColor(skyTopColors[skyseq[seq_id+1]]); + colSkyTop=col2*seq_residue + col1*(1.0f-seq_residue); + col1.SetHWColor(skyBtmColors[skyseq[seq_id]]); + col2.SetHWColor(skyBtmColors[skyseq[seq_id+1]]); + colSkyBtm=col2*seq_residue + col1*(1.0f-seq_residue); + col1.SetHWColor(seaTopColors[skyseq[seq_id]]); + col2.SetHWColor(seaTopColors[skyseq[seq_id+1]]); + colSeaTop=col2*seq_residue + col1*(1.0f-seq_residue); + col1.SetHWColor(seaBtmColors[skyseq[seq_id]]); + col2.SetHWColor(seaBtmColors[skyseq[seq_id+1]]); + colSeaBtm=col2*seq_residue + col1*(1.0f-seq_residue); + if(seq_id>=6 || seq_id<2) + for(int i=0; i<Stars; ++i) + { + a=1.0f-starY[i]/StarsHeight; + //a*=hge->Random_Float(0.6f, 1.0f); + a*=(rand()%40+60.0f)/100.0f; + if(seq_id>=6) a*=sinf((timet-18.0f)/12.0f*pi); + else a*=sinf((1.0f-timet/6.0f)*pi/2); + starA[i]=a; + } + if(seq_id==2) a=sinf(seq_residue*pi/2); + else if(seq_id==5) a=cosf(seq_residue*pi/2); + else if(seq_id>2 && seq_id<5) a=1.0f; + else a=0.0f; + colSun.SetHWColor(0xFFEAE1BE); + colSun=colSun*(1-a)+colWhite*a; + a=(cosf(timet/6.0f*pi)+1.0f)/2.0f; + if(seq_id>=2 && seq_id<=6) + { + colSunGlow=colWhite*a; + colSunGlow.a=1.0f; + } + else colSunGlow.SetHWColor(0xFF000000); + sunX=ScreenWidth*0.5f+cosf(zenith)*OrbitRadius; + sunY=SkyHeight*1.2f+sinf(zenith)*OrbitRadius; + sunS=1.0f-0.3f*sinf((timet-6.0f)/12.0f*pi); + sunGlowS=3.0f*(1.0f-a)+3.0f; + if(seq_id>=6) a=sinf((timet-18.0f)/12.0f*pi); + else a=sinf((1.0f-timet/6.0f)*pi/2); + colMoon.SetHWColor(0x20FFFFFF); + colMoon=colMoon*(1-a)+colWhite*a; + colMoonGlow=colWhite; + colMoonGlow.a=0.5f*a; + moonX=ScreenWidth*0.5f+cosf(zenith-pi)*OrbitRadius; + moonY=SkyHeight*1.2f+sinf(zenith-pi)*OrbitRadius; + moonS=1.0f-0.3f*sinf((timet+6.0f)/12.0f*pi); + moonGlowS=a*0.4f+0.5f; + if(timet>19.0f || timet<4.5f) + { + a=0.2f; + if(timet>19.0f && timet<20.0f) a*=(timet-19.0f); + else if(timet>3.5f && timet<4.5f) a*=1.0f-(timet-3.5f); + colSeaGlow=colMoonGlow; + colSeaGlow.a=a; + seaGlowX=moonX; + seaGlowSX=moonGlowS*3.0f; + seaGlowSY=moonGlowS*2.0f; + } + else if(timet>6.5f && timet<19.0f) + { + a=0.3f; + if(timet<7.5f) a*=(timet-6.5f); + else if(timet>18.0f) a*=1.0f-(timet-18.0f); + colSeaGlow=colSunGlow; + colSeaGlow.a=a; + seaGlowX=sunX; + seaGlowSX=sunGlowS; + seaGlowSY=sunGlowS*0.6f; + } + else colSeaGlow.a=0.0f; + for(i=1; i<SeaDisize-1; ++i) + { + a=float(i)/(SeaDisize-1); + col1=colSeaTop*(1-a)+colSeaBtm*a; + dwCol1=col1.GetHWColor(); + fTime=2.0f*hge->Timer_GetTime(); + a*=20; + for(j=0; j<SeaDisize; ++j) + { + sea->SetColor(j, i, dwCol1); + dy=a*sinf(seaP[i]+(float(j)/(SeaDisize-1)-0.5f)*pi*16.0f-fTime); + sea->SetDisplacement(j, i, 0.0f, dy, HGEDISP_NODE); + } + } + float t=0.1*hge->Timer_GetTime(); + skylyr->SetTextureRect(128+sin(t)*128.0f,256+cos(t)*128.0f,256,128); + if (skyOnFadeIn)SkyDoFadeIn(); + if (skyOnFadeOut)SkyDoFadeOut(); + for (int i=-8;i<8;++i) + for (int j=-8;j<8;++j) + { + skylyr->SetColor(j+8,i+8,ARGB((int)(skya*((i+9)*16-16)),0xFF,0xFF,0xFF)); + skylyr->SetDisplacement(j+8,i+8,j*(16.0f*((i+9)/16.0f)+64.0f),i*24,HGEDISP_CENTER); + } + dwCol1=colSeaTop.GetHWColor(); + dwCol2=colSeaBtm.GetHWColor(); + for(j=0; j<SeaDisize; ++j) + { + sea->SetColor(j, 0, dwCol1); + sea->SetColor(j, SeaDisize-1, dwCol2); + } + if(timet>19.0f || timet<5.0f) + { + a=0.12f; + if(timet>19.0f && timet<20.0f) a*=(timet-19.0f); + else if(timet>4.0f && timet<5.0f) a*=1.0f-(timet-4.0f); + posX=moonX; + } + else if(timet>7.0f && timet<17.0f) + { + a=0.14f; + if(timet<8.0f) a*=(timet-7.0f); + else if(timet>16.0f) a*=1.0f-(timet-16.0f); + posX=sunX; + } + else a=0.0f; + if(a!=0.0f) + { + k=(int)floorf(posX/cellw); + s1=(1.0f-(posX-k*cellw)/cellw); + s2=(1.0f-((k+1)*cellw-posX)/cellw); + if(s1>0.7f) s1=0.7f; + if(s2>0.7f) s2=0.7f; + s1*=a;s2*=a; + for(i=0; i<SeaDisize; i+=2) + { + a=sinf(float(i)/(SeaDisize-1)*pi/2); + col1.SetHWColor(sea->GetColor(k,i)); + col1+=colSun*s1*(1-a); + col1.Clamp(); + sea->SetColor(k, i, col1.GetHWColor()); + col1.SetHWColor(sea->GetColor(k+1,i)); + col1+=colSun*s2*(1-a); + col1.Clamp(); + sea->SetColor(k+1, i, col1.GetHWColor()); + } + } + } + void Render() + { +#ifdef WIN32 + skygrad.tex=0; + skygrad.blend=BLEND_DEFAULT; +#endif + skygrad.v[0].col=skygrad.v[1].col=colSkyTop.GetHWColor(); + skygrad.v[2].col=skygrad.v[3].col=colSkyBtm.GetHWColor(); + hge->Gfx_RenderQuad(&skygrad); + if(seq_id>=6 || seq_id<2) + for(int i=0; i<Stars; ++i) + { + star->SetColor((DWORD(starA[i]*255.0f)<<24) | 0xFFFFFF); + star->RenderEx(starX[i], starY[i], 0.0f, starS[i]); + } + glow->SetColor(colSunGlow.GetHWColor()); + glow->RenderEx(sunX, sunY, 0.0f, sunGlowS); + sun->SetColor(colSun.GetHWColor()); + sun->RenderEx(sunX, sunY, 0.0f, sunS); + glow->SetColor(colMoonGlow.GetHWColor()); + glow->RenderEx(moonX, moonY, 0.0f, moonGlowS); + moon->SetColor(colMoon.GetHWColor()); + moon->RenderEx(moonX, moonY, 0.0f, moonS); + sea->Render(0, SkyHeight); + seaglow->SetColor(colSeaGlow.GetHWColor()); + seaglow->RenderEx(seaGlowX, SkyHeight, 0.0f, seaGlowSX, seaGlowSY); + skylyr->Render(ScreenWidth/8*3,ScreenHeight/3*2); + } +}; +TDSky sky; +bool skyactive; + +class PicBack +{ +public: + enum arMode + { + Centered, + Tiled, + Stretched + }; +private: + hgeQuad quad; + arMode Mode; + DWORD alpha,alim; + bool onfadein,onfadeout; + int fadebreak; + double scale; + void DoFadeIn() + { + if (LOWFPS)fadebreak+=17;else ++fadebreak; + if (fadebreak>17)fadebreak=0;else return; + if (LOWFPS)if(alpha+0x20<=alim)alpha+=0x20;else alpha=alim; + else if (alpha+0x2<=alim)alpha+=2;else alpha=alim; + if (alpha>=alim)onfadein=false; + } + void DoFadeOut() + { + if (LOWFPS)fadebreak+=17;else ++fadebreak; + if (fadebreak>17)fadebreak=0;else return; + if (LOWFPS)if (alpha<0x20)alpha=0;else alpha-=0x20; + else if (alpha<0x2)alpha=0;else alpha-=0x2; + if (!alpha)onfadeout=false; + } + void RenderCenterAt(vector2d a,double scl) + { + vector2d s=vector2d(hge->Texture_GetWidth(quad.tex,true)*scl,hge->Texture_GetHeight(quad.tex,true)*scl); + for(int i=0;i<4;++i)quad.v[i].col=SETA(0xFFFFFF,alpha); + quad.v[0].x=a.x-s.x/2.0f;quad.v[0].y=a.y-s.y/2.0f; + quad.v[1].x=a.x+s.x/2.0f;quad.v[1].y=a.y-s.y/2.0f; + quad.v[2].x=a.x+s.x/2.0f;quad.v[2].y=a.y+s.y/2.0f; + quad.v[3].x=a.x-s.x/2.0f;quad.v[3].y=a.y+s.y/2.0f; + hge->Gfx_RenderQuad(&quad); + } +public: + bool active(){return alpha;} + void SetScale(double _scl){scale=_scl;} + void Init(const char *tx,arMode _Mode,DWORD _alim) + { + quad.tex=hge->Texture_Load(tx);alim=_alim; + Mode=_Mode;scale=1;quad.blend=BLEND_DEFAULT; +#ifdef WIN32 + vector2d srl=vector2d(hge->Texture_GetWidth(quad.tex,true), + hge->Texture_GetHeight(quad.tex,true)); + vector2d srm=vector2d(hge->Texture_GetWidth(quad.tex,false), + hge->Texture_GetHeight(quad.tex,false)); + srm.x=srl.x/srm.x;srm.y=srl.y/srm.y; + quad.v[0].tx=0;quad.v[0].ty=0; + quad.v[1].tx=srm.x;quad.v[1].ty=0; + quad.v[2].tx=srm.x;quad.v[2].ty=srm.y; + quad.v[3].tx=0;quad.v[3].ty=srm.y; +#else + quad.v[0].tx=0,quad.v[0].ty=0; + quad.v[1].tx=1,quad.v[1].ty=0; + quad.v[2].tx=1,quad.v[2].ty=1; + quad.v[3].tx=0,quad.v[3].ty=1; +#endif + onfadein=onfadeout=false;alpha=0; + } + void Update() + { + if(onfadein)DoFadeIn();if(onfadeout)DoFadeOut(); + switch(Mode) + { + case Centered: + RenderCenterAt(vector2d(400,300),scale); + break; + case Tiled: + { + vector2d s=vector2d(hge->Texture_GetWidth(quad.tex,true)*scale,hge->Texture_GetHeight(quad.tex,true)*scale); + for(int i=0;i*s.x<=800;++i) + for(int j=0;j*s.y<=600;++j) + RenderCenterAt(vector2d(s.x/2+i*s.x,s.y/2+j*s.y),scale); + } + break; + case Stretched: + for(int i=0;i<4;++i)quad.v[i].col=SETA(0xFFFFFF,alpha); + quad.v[0].x=0,quad.v[0].y=0; + quad.v[1].x=800,quad.v[1].y=0; + quad.v[2].x=800,quad.v[2].y=600; + quad.v[3].x=0,quad.v[3].y=600; + hge->Gfx_RenderQuad(&quad); + break; + } + } + void SetFadeIn() + { + alpha=0x01; + onfadein=true; + } + void SetFadeOut() + { + alpha=alim; + onfadeout=true; + } +}binter,bdiff; +DWORD ColorTransfer(DWORD a,DWORD t) +{ + int r=GETR(a),g=GETG(a),b=GETB(a),sa=GETA(a); + int tr=GETR(t),tg=GETG(t),tb=GETB(t),ta=GETA(t); + if (sa<ta)++sa;if (sa>ta)--sa; + if (r<tr)++r;if (r>tr)--r; + if (g<tg)++g;if (g>tg)--g; + if (b<tb)++b;if (b>tb)--b; + a=SETR(a,r);a=SETG(a,g);a=SETB(a,b);a=SETA(a,sa); + return a; +} diff --git a/archive/blr2/src/effects.h b/archive/blr2/src/effects.h new file mode 100644 index 0000000..d71a445 --- /dev/null +++ b/archive/blr2/src/effects.h @@ -0,0 +1,104 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Effects Implementations +// Copyright Chrisoft 2014 +//static const char* EFFECTS_H_FN="effects.h"; + +void SCEffect_Attatch(vector2d Target=vector2d(-100,-100)) +{ + int cnt=rand()%8+3; + if(Target.x<-50&&Target.y<-50)Target=playerpos; + for (int ii=1;ii<=cnt;++ii) + { + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].bullettype=254; + bullet[i].bulletpos.x=Target.x+3; + bullet[i].bulletpos.y=Target.y+3; + bullet[i].bulletdir.x=rand()%100-50; + bullet[i].bulletdir.y=rand()%100-50; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=rand()%4+2; + bullet[i].sccolor=0x80FFFFFF; + } +} +void SCEffect_Process(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=254)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + ++effskp; + if (effskp==7) + bullet[i].sccolor=bullet[i].sccolor-0x1F000000,effskp=0; + } + else + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + ++effskp; + if (effskp==7) + bullet[i].sccolor=bullet[i].sccolor-0x1000000,effskp=0; + } + } + if (GETA(bullet[i].sccolor)<=0x0A||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + bulletspr[grey]->SetColor(bullet[i].sccolor); + bulletspr[grey]->RenderEx(bullet[i].bulletpos.x+2.4,bullet[i].bulletpos.y+2.4,0,0.2,0); + } +} +void BulletEffect_Attatch(int n) +{ + bullet[n].scale=2; + bullet[n].effbrk=17; +} +void BulletEffect_Process(int n) +{ + if (bullet[n].scale<=1){bullet[n].scale=1;return;} + if (LOWFPS) + bullet[n].effbrk-=17; + else + --bullet[n].effbrk; + if (bullet[n].effbrk<=0) + bullet[n].scale-=0.04,bullet[n].effbrk=17; +} +int BulletEffect_Death(Bullet a,DWORD color) +{ + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].bullettype=253; + bullet[i].bulletpos.x=a.bulletpos.x; + bullet[i].bulletpos.y=a.bulletpos.y; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=bullet[i].dist=0; + bullet[i].bulletspeed=0; + bullet[i].alterColor=circle; + bullet[i].scollable=false; + bullet[i].scale=1; + bullet[i].sccolor=SETA(color,0x80); + bullet[i].effbrk=7; + return i; +} +void BulletDeath_Process(int i) +{ + if (!bullet[i].exist)return; + if (LOWFPS) + bullet[i].effbrk-=17; + else + --bullet[i].effbrk; + if (GETA(bullet[i].sccolor)<=10)return (void)(bullet[i].exist=false); + if (bullet[i].effbrk<=0&&Current_Position==1) + bullet[i].effbrk=7,bullet[i].scale+=0.1,bullet[i].sccolor=SETA(bullet[i].sccolor,GETA(bullet[i].sccolor)-6); + bulletspr[circle]->SetColor(bullet[i].sccolor); + bulletspr[circle]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale); +} diff --git a/archive/blr2/src/global.h b/archive/blr2/src/global.h new file mode 100644 index 0000000..a20c5d1 --- /dev/null +++ b/archive/blr2/src/global.h @@ -0,0 +1,549 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Global varibles and implementations +// Copyright Chrisoft 2014 +#include <hge.h> +#include <hgefont.h> +#define MaxRes 80 +#define Resd 20.0f +#define MaxBulCnt 20000 +HGE *hge=0; +HEFFECT snd,menuin,menuout,menumov; +hgeQuad quad; +hgeFont *fnt,*vdig,*bdig; +hgeSprite *spr,*titlespr; +int Current_Position;//Where we are now +/*Scenes: +0: main menu +1: game scene +2: tip scene +3: start menu +4: about scene +5: death scene +6: complete scene +7: new highscore scene +8: highscore scene +9: highscore view scene +10: highscore details scene +11: Pause scene +12: BackToTitle Confirmation +13: Options scene +14: Player Profile scene +15: Help scene +*/ +HTEXTURE SprSheet,TexTitle,TexCredits,MenuTex,HelpTex; +/* +Texture Mapping: +SprSheet:ss.png +Bullet Blue 0,0,24,24 +Bullet Dark Blue 24,0,24,24 +Bullet Green 48,0,24,24 +Bullet Orange 72,0,24,24 +Bullet Pnt 96,0,24,24 +Bullet Purple 120,0,24,24 +Bullet Red 144,0,24,24 +Bullet White 168,0,24,24 +Bullet Yellow 192,0,24,24 +Cursor 216,0,24,24 +Player 0,24,24,24 +Bullet Circle 24,24,24,24 +Tower Blue 0,48,44,44 +Tower Dark Blue 0,92,44,44 +Tower Green 0,136,44,44 +Tower Orange 0,180,44,44 +Tower Purple 48,24,44,44 +Tower Red 92,24,44,44 +Tower White 136,24,44,44 +Tower Yellow 180,24,44,44 +Target 63,71,193,193 +Laser Module 0,264,248,8 +Ribbon Module 151,264,2,8 +Multiplier"+1" 0,272,48,48 +MultPo spawn efct 48,272,48,48 +Text:blnsns.png +"Multiplier bonus!" 0,235,163,21 +Menus and titles: menus.png +Menu items... +Classic Mode 0,0,256,128 +Assessment Mode 256,0,256,128 +Free Play Mode 0,128,256,128 +Titles... +Select a Mode 256,128,256,64 +Options 256,192,256,64 +Player Preference 0,256,256,64 +You Are Dead! 256,256,256,64 +It Ends Here! 0,320,256,64 +View Highscore for..0,376,256,64 +Highscore details 0,448,256,64 +Left Arrow 256,320,26,15 +Right Arrow 256,335,26,15 +Ribbon 256,350,64,16 +*/ +enum TColors +{green=0,blue,yellow,purple,red,white,dblue,orange,grey,circle,COLOR_COUNT}; +hgeSprite *bulletspr[COLOR_COUNT],*towerspr[COLOR_COUNT]; +const double zero=1e-5; +vector2d playerpos; +bool playerLockX,playerLockY; +bool DisableAllTower; +bool DisablePlayer; +bool LOWFPS,diffkey,showdebug; +int VidMode=-1; +hgeTTFont rbPanelFont; +inline double GetDist(vector2d,vector2d); +class Bullet +{ +public: + vector2d bulletpos,bulletdir,limpos; + double dist; + int bullettype,redexplo,redattrib,oriexplo,whicnt; + DWORD sccolor; + /*In Orange bullets + //redattrib also serves as oraattrib to determine if they will explode or change direction + //redexplo also serves as orange explo + //yelbrk serves as direction-change timer + //whicnt describes how much one will explode into (into an exactly circle)*/ + double bulletspeed,bulletaccel,limv; + int exist,inv,addblend; + int whirem,whiskp,yelbrk; + int exp1,exp2; + double lifetime,rot; + bool scollable,collable,extborder; + double scale;int effbrk; + TColors alterColor,alterColor2; + void redir(vector2d targ) + { + bulletdir.x=bulletpos.x-targ.x; + bulletdir.y=bulletpos.y-targ.y; + dist=bulletdir.x*bulletdir.x+bulletdir.y*bulletdir.y; + dist=sqrt(dist); + bulletdir.x/=dist;bulletdir.y/=dist;dist=1; + } + void setdir(double rad) + { + bulletdir.x=cos(rad); + bulletdir.y=sin(rad); + dist=1; + } +}*bullet=NULL; +/*Something about bullets: +//bullettype: +//1: player dir-based green bullet +//2: degree-based blue bullet (for clocks only)[are they clocks?] +//3: 12direction-based blue bullet +//4: yellow chaser bullet +//5: purple slow down bullet +//6: red exploding bullet +//7: white stalled bullet +//8: Orange Redir bullet +//9: dark Blue bullet +//254: Semi-collision effect +//255: Score point*/ +struct Tower +{ + vector2d towerpos; + int towertype; + int towertimer,curtimer; + int towertimer2,curtimer2,shotcount,curshotcount; + bool dblstate; + double bulletspeed; + int redexplo,whicnt,yelbrk; + int exp1,exp2; + int t3t; + bool exist,effect; + double offset; + DWORD RendColor; +}tower[250]; +//t3t is for Tower3 +//0:All 12 directions +//1:four default directions +//2:random left/right +//3:random up/down +struct Target//An annoying circle +{ + hgeSprite *targspr; + vector2d targpos,targdir; + double rot,rotspd; + bool isonshow,isonhide,visible; + void Init(double _rotspd,vector2d ipos) + { + targspr=new hgeSprite(SprSheet,63,71,193,193); + targspr->SetHotSpot(96.5f,96.5f); + rotspd=_rotspd; + rot=0; + targpos=ipos; + } + void TargShow() + { + if (!visible) + isonshow=true,isonhide=false,visible=true; + } + void TargHide() + { + if (visible) + isonhide=true,isonshow=false; + } + void TargShowProc() + { + if (LOWFPS) + targspr->SetColor(SETA(targspr->GetColor(),GETA(targspr->GetColor())+17)); + else + targspr->SetColor(SETA(targspr->GetColor(),GETA(targspr->GetColor())+1)); + if (GETA(targspr->GetColor())>=0x80) + isonshow=isonhide=false,targspr->SetColor(SETA(targspr->GetColor(),0x80)); + } + void TargHideProc() + { + if (LOWFPS) + if(GETA(targspr->GetColor())<17) + targspr->SetColor(SETA(targspr->GetColor(),0)); + else + targspr->SetColor(SETA(targspr->GetColor(),GETA(targspr->GetColor())-17)); + else + targspr->SetColor(SETA(targspr->GetColor(),GETA(targspr->GetColor())-1)); + if (GETA(targspr->GetColor())==0x00) + isonshow=isonhide=visible=false; + } + void TargFollowPlayer() + { + double curspd=0.01f; + if (GetDist(playerpos,targpos)>1)curspd=0.02f;else targpos=playerpos; + if (GetDist(playerpos,targpos)>2)curspd=0.1f; + if (GetDist(playerpos,targpos)>5)curspd=0.5f; + if (GetDist(playerpos,targpos)>10)curspd=0.75f; + if (GetDist(playerpos,targpos)>20)curspd=1.0f; + if (GetDist(playerpos,targpos)>30)curspd=2.0f; + if (GetDist(playerpos,targpos)>40)curspd=5.0f; + targdir.x=targpos.x-playerpos.x; + targdir.y=targpos.y-playerpos.y; + double dist=sqr(targdir.x)+sqr(targdir.y); + dist=sqrt(dist); + if (dist<1e-4)return; + if (LOWFPS) + targpos.x-=targdir.x/dist*curspd*17/20, + targpos.y-=targdir.y/dist*curspd*17/20; + else + targpos.x-=targdir.x/dist*curspd/20, + targpos.y-=targdir.y/dist*curspd/20; + } + void TargGoto(vector2d pos) + { + double curspd=0.01f; + if (GetDist(pos,targpos)>1)curspd=0.25f;else targpos=pos; + if (GetDist(pos,targpos)>2)curspd=0.5f; + if (GetDist(pos,targpos)>5)curspd=1.0f; + if (GetDist(pos,targpos)>10)curspd=2.0f; + if (GetDist(pos,targpos)>20)curspd=3.0f; + if (GetDist(pos,targpos)>30)curspd=4.0f; + if (GetDist(pos,targpos)>40)curspd=5.0f; + targdir.x=targpos.x-pos.x; + targdir.y=targpos.y-pos.y; + double dist=sqr(targdir.x)+sqr(targdir.y); + dist=sqrt(dist); + if (dist<1e-4)return; + if (LOWFPS) + targpos.x-=targdir.x/dist*curspd*17/20, + targpos.y-=targdir.y/dist*curspd*17/20; + else + targpos.x-=targdir.x/dist*curspd/20, + targpos.y-=targdir.y/dist*curspd/20; + } + void TargRender() + { + if (isonshow)TargShowProc();if(isonhide)TargHideProc(); + targspr->RenderEx(targpos.x+7,targpos.y+7,rot,0.8); + if (!DisableAllTower) + { + if (LOWFPS) + rot+=17*rotspd; + else + rot+=rotspd; + } + } +}ATarg,BTarg; +int bulcnt=0,towcnt=0,linecnt=0; +double playerrot; +double playerspeed; +double playerslospeed; +double playerfulspd=0.2; +double playerfulslospd=0.05; +double clockrot,deltarot,deltadelta; +double whirot,dwhirot; +hgeSprite *playerspr; +DWORD DBGColor; +int frameleft,infofade; +int level,part,clrtime,clrbns; +int coll,semicoll,mode,dsmc,restarts; +double clrrange,clrrad,clrmaxrange,clrind,assetime,asts; +hgeSprite *clrcircle; +bool Dis8ref,t8special; +int frameskips=0,stepskips=0; +bool IfCallLevel,IfShowTip,FadeTip,PlayerSplit,charge; +RandomEngine re; +hgeFont *TipFont,*MenuFont; +char lasttip[200]; +int whicnt,whrcnt,shots,clrusg; +bool yelattrib,Complete; +double bsscale; +long long score,scminus; +double mult,lsc; +int multbrk,multbat; +int frms;double averfps; +int plrspd,plrslospd; +int TenSeconds=600,TwentySeconds=1200,ThirtySeconds=1800,AMinute=3600; +int Infinity=1000000000; +int effskp=0; +hgeSprite *Credits,*CreditsRail; +int creditsp;double creditfly,creditacc,credbrk; +bool credstop,creddone; +hgeSprite *Helpspr,*NHelpspr,*HlpL,*HlpR; +double Helpscroll,Hlpyofst;int Helpslide; +bool hshl; +bool tfs; +double scale; +#ifndef WIN32 +double yos; +#endif +int fpslvl,clrmode,sfxvol,bgmvol; +const vector2d splitData[4]={vector2d(0,0),vector2d(400,0),vector2d(0,300),vector2d(400,300)}; +//options from command line arguments +bool fNoSound, +#ifdef WIN32 +noHideConsole, +#endif +fFristStartUp,fFast; +int startLvl,startPrt,fFullScreen; +char alterLog[64]; +#ifdef WIN32 +static const int arFilecount=23; +static const char* archive[]={ +"./Resources/b_diff.png", +"./Resources/b_inter.png", +"./Resources/b_null.png", +"./Resources/e_sflake.png", +"./Resources/e_skyitem.png", +"./Resources/blnsns.png", +"./Resources/charmap.fnt", +"./Resources/vdig.fnt", +"./Resources/bdig.fnt", +"./Resources/ss.png", +"./Resources/help.png", +"./Resources/menus.png", +"./Resources/title.png", +"./Resources/credits.png", +"./Resources/b_leaves.png", +"./Resources/e_leaf.png", +"./Resources/tap.ogg", +"./Resources/menuin.ogg", +"./Resources/menuout.ogg", +"./Resources/Music/BLR2_TR01.ogg", +"./Resources/Music/BLR2_TR07.ogg", +"./Resources/Music/BLR2_TR09.ogg", +"./Resources/Music/CanonTechno.ogg" +}; +#endif +//static const char* GLOBAL_H_FN="global.h"; +static const char* BLRVERSION="1.0.0-0 (r100)"; +static const char *months="JanFebMarAprMayJunJulAugSepOctNovDec"; +char *parseDate(const char *date) +{ + char ms[8]; + int y,d,m;sscanf(date,"%s %d %d",ms,&d,&y); + m=(strstr(months,ms)-months)/3+1; + char *r=new char[16]; + sprintf(r,"%04d-%02d-%02d",y,m,d); + return r; +} +static char* BuiltDate=parseDate(__DATE__); + +void Throw(char *Filename,char *Info) +{ + fprintf(stderr,"%s: %s\n",Filename,Info); + hge->System_Log("%s: %s\n",Filename,Info); +} +void Error(const char *EC,bool hgecreated=false) +{ + hge->System_Log("%s\n",EC); +#ifdef WIN32 + MessageBox(NULL,EC,"Error!",MB_ICONERROR); +#endif + if (hgecreated) + { + hge->System_Shutdown(); + hge->Release(); + } +#ifdef WIN32 + for(int i=0;i<arFilecount;++i)remove(archive[i]); + _rmdir("./Resources/Music"); + _rmdir("./Resources"); +#endif + exit(1); +} +void ShowTip(const char *tip) +{ + if (strcmp(tip,lasttip)!=0) + { + TipFont->SetColor(0x00FFFFFF); + } + memcpy(lasttip,tip,sizeof(lasttip)); + DisableAllTower=true; + DisablePlayer=true; + if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT) + FadeTip=true; + double width=TipFont->GetStringWidth(tip); + TipFont->printf(400-width/2,400,HGETEXT_LEFT,tip); + if (FadeTip) + { + if (LOWFPS) + { + if (TipFont->GetColor()>>24>=0x08) + TipFont->SetColor(TipFont->GetColor()-0x8000000); + else + { + DisableAllTower=false; + DisablePlayer=false; + Current_Position=1; + } + } + else + { + if (TipFont->GetColor()>>24>=0x01) + TipFont->SetColor(TipFont->GetColor()-0x1000000); + else + { + DisableAllTower=false; + DisablePlayer=false; + Current_Position=1; + } + } + return; + } + if (!LOWFPS) + { + if (TipFont->GetColor()>>24<=0xFE) + TipFont->SetColor(TipFont->GetColor()+0x01000000); + } + else + { + if (TipFont->GetColor()>>24<=0xF7) + TipFont->SetColor(TipFont->GetColor()+0x08000000); + } +} +void All2pnt();//forward that... + +int AllocBullet() +{ + int i; + if (bulcnt==0) + { + bulcnt=i=1; + bullet=(Bullet*)malloc(sizeof(Bullet)*(bulcnt+1)); + } + else + { + for (i=1;i<=bulcnt;++i) + if (!bullet[i].exist)break; + if (i>bulcnt) + { + bulcnt=i; + Bullet *nblt=(Bullet*)realloc(bullet,sizeof(Bullet)*(bulcnt+1)); + if(!nblt)Error("Error allocating bullets!",1); + bullet=nblt; + } + } + return i; +} +void SigHandler(int pm) +{ + hge->System_Log("Oops, the application ate a piece of DE AD BE EF!"); +#if defined(__GNUC__) && !defined(MINGW_BUILD) + void *strs[64];unsigned cnt; + char **str;cnt=backtrace(strs,64); + str=backtrace_symbols(strs,cnt); + for(unsigned i=0;i<cnt;++i) + hge->System_Log("%s",str[i]); +#endif + hge->System_Shutdown(); + exit(1); +} +void ClearAll(bool cbullet=true) +{ + DisableAllTower=true; + bool none=true; + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist)continue; + if (LOWFPS) + { + if (tower[i].RendColor>>24>=0x08) + { + tower[i].RendColor=tower[i].RendColor-0x8000000; + none=false; + } + } + else + { + if (tower[i].RendColor>>24>=0x01) + { + tower[i].RendColor=tower[i].RendColor-0x1000000; + none=false; + } + } + } + if (none) + { + towcnt=0; + memset(tower,0,sizeof(tower)); + if (cbullet)All2pnt(); + } +} +TextureRect GetTextureRect(int type,TColors color) +{ + if (type==0) + { + switch(color) + { + case green:return TextureRect(48,0,24,24); + case blue:return TextureRect(0,0,24,24); + case yellow:return TextureRect(192,0,24,24); + case purple:return TextureRect(120,0,24,24); + case red:return TextureRect(144,0,24,24); + case white:return TextureRect(168,0,24,24); + case dblue:return TextureRect(24,0,24,24); + case orange:return TextureRect(72,0,24,24); + case grey:return TextureRect(96,0,24,24); + case circle:return TextureRect(24,24,24,24); + default:return TextureRect(0,0,0,0); + } + } + if (type==1) + { + switch(color) + { + case green:return TextureRect(0,136,44,44); + case blue:return TextureRect(0,48,44,44); + case yellow:return TextureRect(180,24,44,44); + case purple:return TextureRect(48,24,44,44); + case red:return TextureRect(92,24,44,44); + case white:return TextureRect(136,24,44,44); + case dblue:return TextureRect(0,92,44,44); + case orange:return TextureRect(0,180,44,44); + default:return TextureRect(0,0,0,0); + } + } + return TextureRect(0,0,0,0); +} +DWORD ColorToDWORD(TColors a) +{ + switch(a) + { + case green:return 0xCCFF00; + case blue:return 0x33CCFF; + case yellow:return 0xFFFF00; + case purple:return 0x9966FF; + case red:return 0xFFFF3333; + case white:return 0xFFFEFEFE; + case dblue:return 0xFF0000FF; + case orange:return 0xFFFF8800; + default:return 0xFF000000; + } +} diff --git a/archive/blr2/src/hgeft.cpp b/archive/blr2/src/hgeft.cpp new file mode 100644 index 0000000..479027b --- /dev/null +++ b/archive/blr2/src/hgeft.cpp @@ -0,0 +1,98 @@ +// Freetype2 ext4hge implementations -*- C++ -*- +#include "hgeft.h" +static const char* HGEFT_SRC_FN="hgeft.cpp"; +void hgeTTChar::Free(){if(quad.tex)hge->Texture_Free(quad.tex),quad.tex=0;} +bool hgeTTChar::SetChar(wchar_t ch,FT_Face ttfface) +{ + FT_GlyphSlot slot=ttfface->glyph; + FT_UInt glyph_index=FT_Get_Char_Index(ttfface,ch); + FT_Error err=FT_Load_Glyph(ttfface,glyph_index,FT_LOAD_DEFAULT); + if(err){hge->System_Log("%s: Glyph load failed!",HGEFT_SRC_FN);return false;} + err=FT_Render_Glyph(ttfface->glyph,FT_RENDER_MODE_NORMAL); + if(err){hge->System_Log("%s: Glyph render failed!",HGEFT_SRC_FN);return false;} + _w=slot->advance.x>>6;_h=slot->bitmap.rows;//we are one line only. + rw=slot->bitmap.width;rh=slot->bitmap.rows; + xofst=slot->bitmap_left; + yofst=slot->bitmap.rows-slot->bitmap_top; + quad.tex=hge->Texture_Create( + slot->bitmap.width?slot->bitmap.width:1, + slot->bitmap.rows?slot->bitmap.rows:1); + DWORD* tx=hge->Texture_Lock(quad.tex,false,0,0, + slot->bitmap.width?slot->bitmap.width:1, + slot->bitmap.rows?slot->bitmap.rows:1); + memset(tx,0,sizeof(DWORD)*(slot->bitmap.width?slot->bitmap.width:1)*(slot->bitmap.rows?slot->bitmap.rows:1)); + int ptr=0; + for(int i=0;i<slot->bitmap.rows;++i) + for(int j=0;j<slot->bitmap.width;++j) + { +#ifdef WIN32 + tx[i*slot->bitmap.width+j]=ARGB(slot->bitmap.buffer[ptr],255,255,255); +#else + tx[(slot->bitmap.rows-i-1)*slot->bitmap.width+j]=ARGB(slot->bitmap.buffer[ptr],255,255,255); + //In OpenGL, textures are locked upside down... +#endif + ptr++; + } + hge->Texture_Unlock(quad.tex); + quad.blend=BLEND_ALPHABLEND; + quad.v[0].tx=0;quad.v[0].ty=0;quad.v[1].tx=1;quad.v[1].ty=0; + quad.v[2].tx=1;quad.v[2].ty=1;quad.v[3].tx=0;quad.v[3].ty=1; + return true; +} +void hgeTTChar::Render(double x,double y,DWORD col) +{ + for(int i=0;i<4;++i)quad.v[i].col=col; + quad.v[0].x=x;quad.v[0].y=y-rh+yofst; + quad.v[1].x=x+rw;quad.v[1].y=y-rh+yofst; + quad.v[2].x=x+rw;quad.v[2].y=y+yofst; + quad.v[3].x=x;quad.v[3].y=y+yofst; + hge->Gfx_RenderQuad(&quad); +} +bool hgeTTFont::Init(const char *ttf,int size) +{ + FT_Error err=FT_Init_FreeType(&libft); + if(err){hge->System_Log("%s: Failed to initialize freetype",HGEFT_SRC_FN);return false;} + err=FT_New_Face(libft,ttf,0,&ttfface); + if(err){hge->System_Log("%s: Failed to load font: %s",HGEFT_SRC_FN,ttf);return false;} + err=FT_Set_Char_Size(ttfface,0,size*64,96,96); + return true; +} +void hgeTTFont::UpdateString(const wchar_t *format, ...) +{ + for(int i=0;buf[i]!='\0';++i)chars[i].Free(); + memset(buf,0,sizeof(buf));memset(chars,0,sizeof(chars)); + va_list vl; + va_start(vl,format); + vswprintf(buf,1024,format,vl); + va_end(vl); + buf[1024]='\0'; + w=h=0; + for(int i=0;buf[i]!='\0';++i) + { + chars[i].SetChar(buf[i],ttfface); + w+=chars[i].w(); + if(chars[i].h()>h)h=chars[i].h(); + } +} +void hgeTTFont::Render(double x,double y,DWORD color,int align) +{ + int cur; + if(align==0) + { + cur=x; + for(int i=0;buf[i]!='\0';++i) + { + chars[i].Render(cur,y,color); + cur+=chars[i].w(); + } + } + if(align==1) + { + cur=x; + for(int i=wcslen(buf)-1;i>=0;--i) + { + chars[i].Render(cur,y,color); + cur-=chars[i].w(); + } + } +} diff --git a/archive/blr2/src/hgeft.h b/archive/blr2/src/hgeft.h new file mode 100644 index 0000000..1badc74 --- /dev/null +++ b/archive/blr2/src/hgeft.h @@ -0,0 +1,75 @@ +// Freetype2 ext4hge header -*- C++ -*- +/* + * Freetype2 extention for hge + * by Chris Xiong + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of the nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Note: freetype 2.5.2 or newer is required. + * This library is somehow buggy, known bugs: + * * blinking charcter... + * * segmentation fault(fixed now,not a problem of the library) + * * Slow... but it's hard to improve... + * * Only support a single line... + * + */ +#ifndef HGEEFT_H +#define HGEEFT_H +#include <cstring> +#include <cwchar> +#include "./include/hge.h" +#include <ft2build.h> +#include FT_FREETYPE_H +extern HGE* hge; +class hgeTTChar +{ +private: + hgeQuad quad; + int rw,rh,_w,_h,yofst; +public: + double w(){return _w;} + double h(){return _h;} + void Free(); + bool SetChar(wchar_t ch,FT_Face ttfface); + void Render(double x,double y,DWORD col); +}; +class hgeTTFont +{ +protected: + FT_Library libft; + FT_Face ttfface; + wchar_t buf[1025]; + hgeTTChar chars[1024]; + double w,h; +public: + bool Init(const char *ttf,int size); + double GetWidth(){return w;} + double GetHeight(){return h;} + void UpdateString(const wchar_t *format, ...); + void Render(double x,double y,DWORD color,int align); +}; +#endif diff --git a/archive/blr2/src/levels.h b/archive/blr2/src/levels.h new file mode 100644 index 0000000..58d7505 --- /dev/null +++ b/archive/blr2/src/levels.h @@ -0,0 +1,4305 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Level Implementations +// Copyright Chrisoft 2014 +/* +How to write a classic level/part... +Classic parts need only one procedure, like this. + frameleft=...; + if (towercnt==/!=...)return ClearAll(); + DisableAllTower=false;bulcnt=0;memset(bullet,0,sizeof(bullet)); + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip(""); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + for (int i=1;i<=towcnt;++i) + if (tower[i].towerspr->GetColor()==0x80FFFFFF) + tower[i].towerspr->SetColor(0x00FFFFFF); + for (int i=1;i<=towcnt;++i) + if ((tower[i].towerspr->GetColor()>>24)<=0x80) + tower[i].towerspr->SetColor(tower[i].towerspr->GetColor()+0x01FFFFFF); + else + { + IfCallLevel=false; + return; + } +*/ +/* +How to write an "advanced" part... +"Advanced" parts usually need two or more parts, ont for initalize and one for things to do every frame. +Write on your own thought... +*/ +bool squashrev; +int posx,posy,fskp,posx2,posy2; +bool doneredir; +int pnt1,pnt2; +//Let's start now! +double towers[16];int tcnt; +double dscroll,roll,tbrk; +bool sout,tendone;bool dmt[16]; +//static const char* LEVEL_H_FN="levels.h"; +void Level1Part0(){++part;} +void Level1Part1() +{ + if(DBGColor!=0xFF888820) + { + for(int i=0;i<3;++i) + DBGColor=ColorTransfer(DBGColor,0xFF888820); + return; + } + CreateTower1(400,300,857,2); + frameleft=AMinute*2;clrtime=1; + tcnt=1;sout=false;dscroll=-0.025f;memset(dmt,true,sizeof(dmt)); + for (int i=0;i<tcnt;++i) + { + towers[i]=600+600.0f/(double)tcnt*i+12; + CreateTower3(200,towers[i],428,3,4); + CreateTower3(600,towers[i],428,3,4); + } + ++part;roll=0;tendone=false; + ShowTip("\ +Level 1-Down by the Bank\n\ +Everything going on properly?\n\ +"); + Current_Position=2; +} +void Level1Part2() +{ + for (int i=0;i<tcnt;++i) + { + if (LOWFPS)towers[i]+=17*dscroll;else towers[i]+=dscroll; + tower[2*(i+1)].towerpos.y=tower[2*(i+1)+1].towerpos.y=towers[i]; + if (towers[i]<=300&&towers[i]>=290&&dmt[i]) + { + NewMultpo(tower[2*(i+1)+1].towerpos); + NewMultpo(tower[2*(i+1)].towerpos); + dmt[i]=false; + } + } + if (!sout) + { + if (towers[tcnt-1]<-12)++roll; + for (int i=0;i<tcnt;++i)if (towers[i]<-12)towers[i]=612,dmt[i]=true; + if (roll==1) + for (int i=1;i<=towcnt;++i) + if (tower[i].towertype==3)tower[i].t3t=5; + if (roll==2) + for (int i=1;i<=towcnt;++i) + if (tower[i].towertype==3)tower[i].t3t=0; + if (roll==3&&!tendone) + { + for (int i=1;i<=towcnt;++i) + if (tower[i].towertype==3)tower[i].t3t=4; + tcnt=10; + tendone=true; + for (int i=0;i<tcnt;++i) + { + towers[i]=600+600.0f/(double)tcnt*i+12; + CreateTower3(200,towers[i],428,3,4); + CreateTower3(600,towers[i],428,3,4); + } + } + } +} +void Level1Part3() +{ + frameleft=AMinute;clrtime=1; + if (towcnt!=50&&towcnt!=0)return ClearAll(); + DisableAllTower=false;bulcnt=0;free(bullet);bullet=NULL; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Double-directed Labyrinth!"); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + for (int i=1;i<=25;++i) + CreateTower3(772,i*24-24,1714,2,2), + CreateTower3(28,i*24-12,1714,2,2); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part; + return; + } +} +int labyred; +void Level1Part4() +{ + if (frameleft<=TwentySeconds) + { + if (LOWFPS)labyred+=17;else ++labyred; + if (labyred>=1500)CreateBullet6(re.NextDouble(0,800),re.NextDouble(0,600),2,0,1,12,true),labyred=0; + } + if (frameleft<=TenSeconds&&tower[1].towertimer>857) + for (int i=1;i<=towcnt;++i)tower[i].towertimer=857; +} +BCircle Level2Circle,Level2Circle2; +int fakes[12]; +double L2D; +void Level2Part0() +{ + frameleft=50;L2D=0; + if (towcnt==50) + { + ClearAll(); + return; + } + bulcnt=0;free(bullet);bullet=NULL; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("\ +Level 2-Polygon Mystery\n\ +Place yourself correctly!\ +"); + IfCallLevel=false; + } + if (Current_Position==1) + { + frameleft=0; + return; + } +} +void Level2Part1() +{ + frameleft=AMinute;clrtime=1; + Level2Circle.Init(230,pi/12000,96,vector2d(400,300)); + Level2Circle2.Init(270,-pi/12000,96,vector2d(400,300)); + CreateTower3_fixeddir(400,50,300,3,-2.0f/3.0f*pi); + CreateTower3_fixeddir(400,51,300,3,-1.0f/3.0f*pi); + //======= + CreateTower3_fixeddir(400,550,300,3,2.0f/3.0f*pi); + CreateTower3_fixeddir(400,549,300,3,1.0f/3.0f*pi); + //======= + CreateTower3_fixeddir(616.51,175,300,3,0); + CreateTower3_fixeddir(616.51,176,300,3,-1.0f/3.0f*pi); + //======= + CreateTower3_fixeddir(183.49,175,300,3,-pi); + CreateTower3_fixeddir(183.49,176,300,3,-2.0f/3.0f*pi); + //======= + CreateTower3_fixeddir(616.51,425,300,3,0); + CreateTower3_fixeddir(616.51,424,300,3,1.0f/3.0f*pi); + //======= + CreateTower3_fixeddir(183.49,425,300,3,-pi); + CreateTower3_fixeddir(183.49,424,300,3,2.0f/3.0f*pi); + for (int i=0;i<6;++i)fakes[i]=CreateBullet6(400,300,0,999999999,1,1,false),bullet[fakes[i]].inv=true; + ++part;tbrk=0; +} +void Level2Part2() +{ + Level2Circle.Update(); + Level2Circle2.Update(); + L2D+=hge->Timer_GetDelta(); + double base=Level2Circle.GetRad(); + double r=(Level2Circle.GetRange()+Level2Circle2.GetRange())/2.0f; + for (int i=0;i<6;++i) + bullet[fakes[i]].bulletpos=vector2d(400+r*cos(base+i*pi/3.0f),300+r*sin(base+i*pi/3.0f)); + if (L2D>=1.5) + { + L2D=0;tbrk+=1; + for (int i=0;i<6;++i) + { + CreateBullet6(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f),2,0,1,6,true); + clockrot=0; + if(tbrk>=5)NewMultpo(vector2d(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f))); + } + if(tbrk>=5)tbrk=0; + } +} +void Level2Part3() +{ + frameleft=AMinute;clrtime=1; + for (int i=0;i<6;++i)bullet[fakes[i]].exist=false; + for (int i=0;i<6;++i)fakes[i]=CreateBullet7(400,300,0,999999999,false),bullet[fakes[i]].inv=true; + whicnt=3;clockrot=deltarot=0;++part;tbrk=0; +} +void Level2Part4() +{ + Level2Circle.Update(); + Level2Circle2.Update(); + L2D+=hge->Timer_GetDelta(); + double base=Level2Circle.GetRad(); + double r=(Level2Circle.GetRange()+Level2Circle2.GetRange())/2.0f; + for (int i=0;i<6;++i) + bullet[fakes[i]].bulletpos=vector2d(400+r*cos(base+i*pi/3.0f),300+r*sin(base+i*pi/3.0f)); + if (L2D>=5) + { + L2D=0;tbrk+=1; + for (int i=0;i<6;++i) + { + CreateBullet7(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f),2,0,true); + if(tbrk>=5)NewMultpo(vector2d(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f))); + } + if(tbrk>=5)tbrk=0; + } +} +void Level2Part5() +{ + frameleft=TenSeconds/2; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("You've got 5 seconds to choose a fine place..."); + return; + } + ++part;tbrk=0; +} +Laser Lock; +void Level2Part6() +{ + Level2Circle.Update(); + Level2Circle2.Update(); + L2D+=hge->Timer_GetDelta(); + double base=Level2Circle.GetRad(); + double r=(Level2Circle.GetRange()+Level2Circle2.GetRange())/2.0f; + for (int i=0;i<6;++i) + bullet[fakes[i]].bulletpos=vector2d(400+r*cos(base+i*pi/3.0f),300+r*sin(base+i*pi/3.0f)),bullet[fakes[i]].inv=true; + if (L2D>=5) + { + L2D=0;tbrk+=1; + for (int i=0;i<6;++i) + { + CreateBullet7(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f),2,0,true); + if(tbrk>=5)NewMultpo(vector2d(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f))); + } + if(tbrk>=5)tbrk=0; + } + if (frameleft<TenSeconds/20)++part,frameleft=AMinute,clrtime=1; +} +void Level2Part7() +{ + if (!playerLockY)playerLockY=true; + Level2Circle.Update(); + Level2Circle2.Update(); + L2D+=hge->Timer_GetDelta(); + double base=Level2Circle.GetRad(); + double r=(Level2Circle.GetRange()+Level2Circle2.GetRange())/2.0f; + for (int i=0;i<6;++i) + bullet[fakes[i]].bulletpos=vector2d(400+r*cos(base+i*pi/3.0f),300+r*sin(base+i*pi/3.0f)),bullet[fakes[i]].inv=true; + if (L2D>=5) + { + L2D=0;tbrk+=1; + for (int i=0;i<6;++i) + { + CreateBullet7(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f),2,0,true); + if(tbrk>=5)NewMultpo(vector2d(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f))); + } + if(tbrk>=5)tbrk=0; + } +} +double L2D1; +void Level2Part8() +{ + frameleft=ThirtySeconds;L2D1=0; + playerLockY=false;clrtime=2; + for (int i=6;i<12;++i)fakes[i]=CreateBullet6(400,300,0,999999999,1,1,false),bullet[fakes[i]].inv=true; + ++part;tbrk=0; +} +void Level2Part9() +{ + Level2Circle.Update(); + Level2Circle2.Update(); + L2D+=hge->Timer_GetDelta(); + L2D1+=hge->Timer_GetDelta(); + double base=Level2Circle.GetRad(); + double base2=Level2Circle2.GetRad(); + double r=(Level2Circle.GetRange()+Level2Circle2.GetRange())/2.0f; + for (int i=0;i<6;++i) + bullet[fakes[i]].bulletpos=vector2d(400+r*cos(base+i*pi/3.0f),300+r*sin(base+i*pi/3.0f)); + for (int i=6;i<12;++i) + bullet[fakes[i]].bulletpos=vector2d(400+r*cos(base2+i*pi/3.0f),300+r*sin(base2+i*pi/3.0f)); + if (L2D1>=2) + { + L2D1=0;tbrk+=1; + for (int i=0;i<6;++i) + { + CreateBullet6(403+r*cos(base2+i*pi/3.0f),303+r*sin(base2+i*pi/3.0f),2,0,1,6,true); + clockrot=0; + if(tbrk>=5)NewMultpo(vector2d(403+r*cos(base2+i*pi/3.0f),303+r*sin(base2+i*pi/3.0f))); + } + } + if (L2D>=5) + { + L2D=0;tbrk+=1; + for (int i=0;i<6;++i) + { + CreateBullet7(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f),2,0,true); + if(tbrk>=5)NewMultpo(vector2d(403+r*cos(base+i*pi/3.0f),303+r*sin(base+i*pi/3.0f))); + } + } + if(tbrk>=5)tbrk=0; +} +void Level3Part0() +{ + frameleft=50; + if (towcnt==50) + { + ClearAll(); + return; + } + bulcnt=0;free(bullet);bullet=NULL; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("\ +Level 3-Missing Colour\n\ +A negative omen...\ +"); + IfCallLevel=false; + } + if (Current_Position==1) + { + frameleft=0; + return; + } +} +void Level3Part1() +{ + frameleft=ThirtySeconds;clrtime=0; + if (towcnt!=1&&towcnt!=0)return ClearAll(); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Meet my new weapon...Is it cool?"); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower8(400,300,857,3,57,30,false); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +void Level3Part2() +{ + frameleft=ThirtySeconds;clrtime=0; + if (towcnt!=4&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("What about quad reflective towers...?"); + All2pnt(); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower8(30,10,1250,3,57,15,false); + CreateTower8(746,10,1250,3,57,15,false); + CreateTower8(30,556,1250,3,57,15,false); + CreateTower8(746,556,1250,3,57,15,false); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +TROF fr[6][6]; +int cur; +double elasped; +void Level3Part3() +{ + frameleft=AMinute;clrtime=1; + if (towcnt!=1&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + All2pnt(); + ShowTip("Precise mode is not so precise as expected..."); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower8(400,300,999999999,0,999999999,0,false); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + for (int k=0;k<6;++k) + for (int i=0;i<6;++i) + { + fr[k][i].cnt=10; + fr[k][i].drad=(i+1)*pi/3.0f; + fr[k][i].srad=i*pi/3.0f; + fr[k][i].delay=750; + fr[k][i].stage=-1; + if (k==0)fr[k][i].init(); + } + ++part; + elasped=0;cur=0; + return; + } +} +void Level3Part4() +{ + if (frameleft<TwentySeconds&&tower[1].towertimer==999999999) + { + tower[1].towertimer=tower[1].curtimer=1500; + tower[1].towertimer2=100; + tower[1].bulletspeed=3;tower[1].shotcount=tower[1].curshotcount=10; + } + for (int k=0;k<6;++k) + for (int i=0;i<6;++i) + fr[k][i].update(); + elasped+=hge->Timer_GetDelta(); + if (elasped>3) + { + elasped=0;++cur; + if (cur>=6)cur=0; + double sr=re.NextInt(0,9)*pi/30.0f; + for (int i=0;i<6;++i) + { + fr[cur][i].drad=(i+1)*pi/3.0f+sr; + fr[cur][i].srad=i*pi/3.0f+sr; + fr[cur][i].init(); + } + } +} +double l3p5brk; +void Level3Part5() +{ + frameleft=ThirtySeconds;clrtime=2; + if (towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + All2pnt();BTarg.TargHide(); + ShowTip("Well, here is a..."); + return; + } + ++part;l3p5brk=0; +} +void Level3Part6() +{ + l3p5brk+=hge->Timer_GetDelta(); + if (l3p5brk>0.2) + { + l3p5brk=0; + for (int i=1;i<=8;++i)bullet[CreateBullet8(i*100-50,20,2,false)].setdir(-pi/2); + } +} +void Level4Part0() +{ + frameleft=50;All2pnt();towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("\ +Level 4-Reunion\n\ +What was the weather like yesterday?...\n\ +"); + IfCallLevel=false; + } + if (Current_Position==1) + { + frameleft=0;bulcnt=0;BTarg.TargHide(); + return; + } +} +void Level4Part1() +{ + frameleft=ThirtySeconds;clrtime=0; + if (towcnt!=1&&towcnt!=0)return ClearAll(); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Where is this idea from?"); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower9(400,300,1000,4,750,36,750); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +int redirs[400];int cred; +void Level4Part2() +{ + frameleft=TenSeconds/2;clrtime=0; + if (towcnt==1) + { + ClearAll(); + return; + } + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("..."); + } + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + ATarg.TargShow(); + posx=10,posy=10,doneredir=false; + } +} +void Level4Part3() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>30) + { + fskp=0; + if (posx<766) + { + posx+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part4() +{ + frameleft=TenSeconds/2;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx2=766,posy2=566,doneredir=false; + } +} +void Level4Part5() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>30) + { + fskp=0; + if (posx2>10) + { + posx2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part6() +{ + frameleft=TenSeconds/10*4;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + ATarg.TargShow(); + posx=10,posy=10,doneredir=false; + } +} +void Level4Part7() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>30) + { + fskp=0; + if (posx<766) + { + posx+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part8() +{ + frameleft=TenSeconds/10*4;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx2=766,posy2=566,doneredir=false; + } +} +void Level4Part9() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>30) + { + fskp=0; + if (posx2>10) + { + posx2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part10() +{ + frameleft=TenSeconds/10*3;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + ATarg.TargShow(); + posx=10,posy=10,doneredir=false; + } +} +void Level4Part11() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx<766) + { + posx+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part12() +{ + frameleft=TenSeconds/10*3;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx2=766,posy2=566,doneredir=false; + } +} +void Level4Part13() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx2>10) + { + posx2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part14() +{ + frameleft=TenSeconds/10*2;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + ATarg.TargShow(); + posx=10,posy=10,doneredir=false; + } +} +void Level4Part15() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx<766) + { + posx+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part16() +{ + frameleft=TenSeconds/10*2;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx2=766,posy2=566,doneredir=false; + } +} +void Level4Part17() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx2>10) + { + posx2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level4Part18() +{ + frameleft=TenSeconds;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx=10,posy=10,posx2=766,posy2=566,doneredir=false; + } +} +void Level4Part19() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>33) + { + fskp=0; + if (posx2>10) + { + posx2-=24; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=24; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=2,doneredir=true; + } + if (posx<766) + { + posx+=24; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=24; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + } + } + + } +} +double rot1,dta1,rot2,dta2,spd2,elsp1; +void Level4Part20() +{ + frameleft=AMinute;All2pnt();towcnt=0; + DisableAllTower=false;clrtime=0; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Double Spinner...?"); + } + if (Current_Position==1) + { + BTarg.TargHide();ATarg.TargHide();CreateTower3(400,300,999999999,0,0); + rot1=dta1=rot2=dta2=elsp1=0;spd2=1;++part;IfCallLevel=true; + return; + } +} +void Level4Part21() +{ + elsp1+=hge->Timer_GetDelta(); + if (elsp1<=0.3)return; + elsp1=0; + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + { + dta1+=2*pi/180;dta2-=2*pi/180;spd2=1+4.0f*((AMinute-frameleft)/(double)AMinute); + rot1+=dta1;rot2+=dta2; + } + for (int i=0;i<6;++i)CreateBullet2(400,300,4,rot1+i*pi/3); + for (int i=0;i<6;++i)CreateBullet2(400,300,spd2,rot2+i*pi/3); +} +void Level4Part22() +{ + frameleft=AMinute;clrtime=1; + if (towcnt==1) + { + ClearAll(); + return; + } + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Have problem breathing?\n...so try this!"); + } + if (Current_Position==1) + { + ++part; + pnt1=CreateTower3(10,10,50,20,1); + pnt2=CreateTower3(790,10,50,20,1); + CreateTower9(400,10,2000,2,2000,6,1000); + } +} +void Level4Part23() +{ + if (!LOWFPS) + tower[pnt1].towerpos.x+=0.006,tower[pnt2].towerpos.x-=0.006; + else + tower[pnt1].towerpos.x+=0.006*17,tower[pnt2].towerpos.x-=0.006*17; +} +void Level4Part24() +{ + frameleft=AMinute;clrtime=0; + if (towcnt!=5&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false;All2pnt(); + Current_Position=2; + ShowTip("Let's meet a more classical circle-drawing part...\n\ +...as the end of this level...\nCan you draw perfectly?"); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower4(400,300,2000,2.5); + CreateTower1(9,9,2000,3); + CreateTower1(767,11,2000,3); + CreateTower1(9,567,2000,3); + CreateTower1(767,567,2000,3); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part; + return; + } +} +void Level4Part25() +{ + if(re.NextInt(0,599)==10)NewMultpo(); + for (int i=2;i<=5;++i) + tower[i].towertimer=((frameleft)/(double)AMinute)*1800+200; +} +void Level5Part0() +{ + frameleft=50;All2pnt();towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + LE_Active=true;letex=TLeaf;lescale=0.75; + letr=TextureRect(0,0,108,108);lecolor=0xCCCC3333; + Leaf.Init(); + Current_Position=2; + ShowTip("\ +Level 5-Crazy Autumn\n\ +Autumn is considered as a miserable season for \n\ +thousands of years...\n\ +This autumn, however, is coming too fast...\ +"); + IfCallLevel=false; + } + if (Current_Position==1) + { + frameleft=0; + return; + } +} +void Level5Part1() +{ + frameleft=ThirtySeconds;clrtime=0; + if (towcnt!=2&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower9(400,300,2000,3,1000,36,750); + CreateTower4(400,50,2000,2.5,0); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +void Level5Part2() +{ + frameleft=ThirtySeconds;clrtime=0; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false;All2pnt(); + Current_Position=2; + ShowTip("What if your cheaser is faster than you..."); + return; + } + tower[2].bulletspeed=4;IfCallLevel=false; +} +int pos,lsrbrk; +bool rev; +/**********************\ + * Vortex of Leaves * +\**********************/ +void Level5Part3() +{ + frameleft=AMinute;clrtime=2; + if (towcnt!=0)return (void)ClearAll(); + Lasercnt=12; + for (int i=1;i<=12;++i) + { + laser[i].Init(32); + laser[i].SetTexture(SprSheet,0,264,248,8); + laser[i].RenCtr.x=406,laser[i].RenCtr.y=306; + } + ++part; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false;All2pnt(); + Current_Position=2; + ShowTip("Vortex of leaves..."); + return; + } +} +void Level5Part4() +{ + bool shot=false; + if (LOWFPS)lsrbrk+=16; + if (++lsrbrk>=100)lsrbrk=0,shot=true,++pos; + if (pos==32) + { + pos=0;rev=!rev; + for (int i=1;i<=bulcnt;++i) + if (bullet[i].bullettype==2&&bullet[i].bulletspeed<1e-5) + bullet[i].bulletaccel=0.001, + bullet[i].limv=1+1.5*(frameleft/(double)AMinute); + } + for (int i=1;i<=12;++i) + { + double initrad=pi/6.0f*(i-1); + double dist; + for (int j=0;j<32;++j) + { + dist=j*Resd; + double trad; + if (rev)trad=initrad-j*pi/36.0f;else trad=initrad+j*pi/36.0f; + vector2d t,tt,s; + t.x=cos(trad)*dist; + t.y=sin(trad)*dist; + dist=(j+1)*Resd; + if (rev)trad=initrad-(j+1)*pi/36.0f;else trad=initrad+(j+1)*pi/36.0f; + tt.x=cos(trad)*dist;tt.y=sin(trad)*dist; + tt.x-=t.x;tt.y-=t.y;trad=tt.x;tt.x=tt.y;tt.y=-trad; + trad=sqrt(sqr(tt.x)+sqr(tt.y)); + tt.x/=trad;tt.y/=trad; + //pos: 0~8, mult:0~8 + //pos: 24~32, mult: 8~0 + if (pos>=24) + tt.x*=(32-pos)/1.5f,tt.y*=(32-pos)/1.5f; + else + if (pos<=8) + tt.x*=pos/1.5f,tt.y*=pos/1.5f; + else + tt.x*=5.33f,tt.y*=5.33f; + //We only consider collisions when pos is between 9 and 23. + if (pos>9&&pos<23)laser[i].EnableColl=true;else laser[i].EnableColl=false; + s.x=t.x+tt.x;s.y=t.y+tt.y; + if (j==31) + for (int k=31;k<MaxRes;++k) + laser[i].Setdata(k,t,s,0xEEFF8800); + else + laser[i].Setdata(j,t,s,0xEEFF8800); + trad=initrad+j*pi/36.0f; + if (shot&&j==pos)bullet[CreateBullet2(400+t.x,300+t.y,0.0f,re.NextDouble(0,pi),1)].alterColor=orange; + if (shot&&j==pos&&re.NextInt(0,249)==99)NewMultpo(vector2d(400+t.x,300+t.y)); + } + if (pos>8&&pos<23) + laser[i].EnableColl=true; + else + laser[i].EnableColl=false; + } +} +int tbuls[1000];double lv5brk; +void Level5Part5() +{ + frameleft=AMinute;All2pnt();towcnt=0;Lasercnt=0; + memset(tbuls,0,sizeof(tbuls));lv5brk=0;++part; + clrtime=1; +} +void Level5Part6() +{ + lv5brk+=hge->Timer_GetDelta(); + if (lv5brk<=0.3)return; + lv5brk=0; + for (int i=1;i<=9;++i) + for (int j=0;j<1000;++j) + if (!tbuls[j]) + { + tbuls[j]=CreateBullet2(i*80,570,3,0.5*pi); + break; + } + for (int j=0;j<1000;++j) + if (tbuls[j]&&bullet[tbuls[j]].bulletpos.y<150) + { + if (re.NextInt(1,1000)>=800) + { + if (re.NextInt(1,1000)>=500) + CreateBullet6(bullet[tbuls[j]].bulletpos.x,bullet[tbuls[j]].bulletpos.y,3,200,1,18); + else + if (re.NextInt(1,1000)>=850) + CreateBullet9(bullet[tbuls[j]].bulletpos.x,bullet[tbuls[j]].bulletpos.y,3,500,18,300); + } + BulletEffect_Death(bullet[tbuls[j]],ColorToDWORD(blue)); + bullet[tbuls[j]].exist=false; + tbuls[j]=0; + } +} +void Level5Part7() +{ + frameleft=ThirtySeconds;Dis8ref=true;tbrk=0;clrtime=1; + if (towcnt!=33&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2;All2pnt(); + ShowTip("Threatening effect of high speed bullets"); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + for (int i=1;i<=33;++i)CreateTower8(i*24-12,12,500,10,20,30); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part;tcnt=0; + return; + } +} +void Level5Part8() +{ + tbrk+=hge->Timer_GetDelta(); + if (tbrk<=3)return; + tbrk=0;int tg;++tcnt; + if (re.NextInt(1,1000)>=500)tg=CreateBullet9(200,12,8,300,12,200);else tg=CreateBullet9(600,12,8,300,12,200); + bullet[tg].redir(playerpos); + if (tcnt>4)NewMultpo(),tcnt=0; +} +void Level5Part9() +{ + frameleft=ThirtySeconds;Dis8ref=true;tbrk=0;clrtime=1; + if (towcnt!=66&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2;All2pnt(); + ShowTip("Do not panic!"); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + for (int i=1;i<=33;++i)CreateTower8(i*24-12,12,750,1,1,1),CreateTower8(i*24-12,588,750,1,1,1); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part;tcnt=0; + return; + } +} +void Level5Part10() +{ + tbrk+=hge->Timer_GetDelta(); + if (tbrk<=3)return; + tbrk=0;++tcnt; + if(tcnt>4)NewMultpo(),tcnt=0; + for (int i=0;i<6;++i) + { + int p=CreateBullet2(playerpos.x+cos(i*pi/3.0f)*6,12+sin(i*pi/3.0f)*6,2,-pi/2); + bullet[p].alterColor=orange; + } +} +void Level5Part11() +{ + frameleft=TenSeconds/10*2;clrtime=0;Dis8ref=false; + if (towcnt==66) + { + ClearAll(); + return; + } + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("They are getting out of control...\n\ +Have you noticed that strange things are happening?..."); + } + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1;All2pnt(); + ATarg.TargShow(); + posx=10,posy=10,doneredir=false; + } +} +void Level5Part12() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx<766) + { + posx+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx-400)*0.95+400,(posy-300)*0.95+300,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx-400)*0.95+400,(posy-300)*0.95+300,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level5Part13() +{ + frameleft=TenSeconds/10*2;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx2=766,posy2=566,doneredir=false; + } +} +void Level5Part14() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx2>10) + { + posx2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx2-400)*0.95+400,(posy2-300)*0.95+300,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx2-400)*0.95+400,(posy2-300)*0.95+300,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level5Part15() +{ + frameleft=TenSeconds/10*2;clrtime=0; + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx=10,posy=10,doneredir=false; +} +void Level5Part16() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx<766) + { + posx+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx-400)*0.95+400,(posy-300)*0.95+300,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx-400)*0.9+400,(posy-300)*0.9+300,0,999999,1,999999); + } + else + { + if (posy<566) + { + posy+=12; + redirs[++cred]=CreateBullet9(posx,posy,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx-400)*0.95+400,(posy-300)*0.95+300,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx-400)*0.9+400,(posy-300)*0.9+300,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +void Level5Part17() +{ + frameleft=TenSeconds/2;clrtime=0; + DisableAllTower=false; + if (Current_Position==1) + { + ++part;memset(redirs,0,sizeof(redirs));cred=-1; + posx2=766,posy2=566,doneredir=false; + } +} +void Level5Part18() +{ + if (!LOWFPS)++fskp;else fskp+=17; + if (fskp>15) + { + fskp=0; + if (posx2>10) + { + posx2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx2-400)*0.95+400,(posy2-300)*0.95+300,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx2-400)*0.9+400,(posy2-300)*0.9+300,0,999999,1,999999); + } + else + { + if (posy2>10) + { + posy2-=12; + redirs[++cred]=CreateBullet9(posx2,posy2,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx2-400)*0.95+400,(posy2-300)*0.95+300,0,999999,1,999999); + redirs[++cred]=CreateBullet9((posx2-400)*0.9+400,(posy2-300)*0.9+300,0,999999,1,999999); + } + else + if (!doneredir) + for (int i=0;i<=cred;++i) + bullet[redirs[i]].redir(ATarg.targpos),bullet[redirs[i]].bulletspeed=4,doneredir=true; + } + } +} +double ntrot,ntbrk; +int ntcnt; +void Level5Part19() +{ + frameleft=AMinute;clrtime=1;ntrot=ntbrk=0;ntcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("You are the fish in my barrel."); + } + if (Current_Position==1) + { + ++part;All2pnt(); + ATarg.TargHide();tbrk=0; + } +} +void Level5Part20() +{ + ntbrk+=hge->Timer_GetDelta();tbrk+=hge->Timer_GetDelta(); + if(LOWFPS)ntrot+=16*pi/960.0f;else ntrot+=pi/960.0f; + if(ntbrk<0.01)return; + ntbrk=0;++ntcnt;if (ntcnt>15)ntcnt=0; + int rtatr; + if(frameleft>ThirtySeconds*1.5)rtatr=2; + if(frameleft<=ThirtySeconds*1.5&&frameleft>TenSeconds*4.2)rtatr=0; + if(frameleft<=TenSeconds*4.2&&frameleft>TenSeconds*2.2)rtatr=3; + if(frameleft<=TenSeconds*2.2&&frameleft>TwentySeconds)rtatr=0; + if(frameleft<=TwentySeconds)rtatr=4; + for(int i=0;i<rtatr;++i) + { + int a; + if(ntcnt==0) + a=CreateBullet9(400+250*sin(ntrot+i*2*pi/rtatr),300+250*cos(ntrot+i*2*pi/rtatr),2,500,1,500,true); + else + a=CreateBullet9(400+250*sin(ntrot+i*2*pi/rtatr),300+250*cos(ntrot+i*2*pi/rtatr),2,999999999,1,999999999,true); + bullet[a].redattrib=1;bullet[a].redir(vector2d(400,300)); + bullet[a].bulletdir.x=-bullet[a].bulletdir.x; + bullet[a].bulletdir.y=-bullet[a].bulletdir.y; + if(tbrk>5)NewMultpo(vector2d(400+250*sin(ntrot+i*2*pi/rtatr),300+250*cos(ntrot+i*2*pi/rtatr))); + } + if(tbrk>5)tbrk=0; +} +void Level5Part21() +{ + frameleft=ThirtySeconds; + All2pnt();clrtime=1; + Lasercnt=0; + CTarg.Init(18,75,5.0f); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("This is the UNBREAKABLE jail."); + } + if (Current_Position==1) + { + CreateTower1(30,10,500,2); + CreateTower1(746,10,500,2); + CreateTower1(30,556,500,2); + CreateTower1(746,556,500,2); + ++part; + } +} +void Level5Part22() +{ + int times=1;if (LOWFPS)times=16; + for (int i=1;i<=times;++i) + CTarg.SetRange(CTarg.GetRange()-0.002f); + CTarg.Update(); +} +void Level6Part0() +{ + frameleft=TenSeconds;All2pnt();towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + LE_Active=true;letex=TSflake;lescale=0.2; + letr=TextureRect(0,0,350,350);lecolor=0xCC3366CC; + Leaf.Init(); + Current_Position=2; + ShowTip("\ +Level 6-Peaceful(?) Winter\n\ +Look, there's a question mark in the title...\ +"); + } + if (Current_Position==1) + { + if (!LOWFPS) + DBGColor=ColorTransfer(DBGColor,0xFF60A0FF); + else + for (int i=1;i<=17;++i)DBGColor=ColorTransfer(DBGColor,0xFF60A0FF); + if(DBGColor==0xFF60A0FF)++part; + return; + } +} +void Level6Part1() +{ + //Some component of this level is in towernbullet... + frameleft=ThirtySeconds;clrtime=1; + DisableAllTower=false; + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + whicnt=10; + CreateTower7(400,300,750,3,500); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +int spcnt;double sixrad,sixbrk; +void Level6Part2() +{ + if (towcnt)return ClearAll(false); + All2pnt();frameleft=TenSeconds; + ++part;spcnt=2;sixrad=sixbrk=0; + whicnt=1;DisableAllTower=false; + tbrk=0;clrtime=3; +} +void Level6Part3() +{ + sixbrk+=hge->Timer_GetDelta(); + if (sixrad>2*pi){if(tbrk<1)NewMultpo(vector2d(400,300)),tbrk=100;return;} + if (sixbrk<0.04)return; + sixbrk=0; + sixrad+=pi/25.0f; + for (int i=0;i<spcnt;++i) + { + int pnt=CreateBullet7(400,300,2,1500); + bullet[pnt].setdir(pi/2+sixrad+((double)i/(double)spcnt)*2.0f*pi); + } +} +void Level6Part4() +{ + frameleft=TenSeconds;whrcnt=9; + ++part;spcnt=3;sixrad=sixbrk=0; + whicnt=1;DisableAllTower=false; + tbrk=0; +} +void Level6Part5() +{ + sixbrk+=hge->Timer_GetDelta(); + if (sixrad>2*pi){if(tbrk<1)NewMultpo(vector2d(400,300)),tbrk=100;return;} + if (sixbrk<0.04)return; + sixbrk=0; + sixrad+=pi/25.0f; + for (int i=0;i<spcnt;++i) + { + int pnt=CreateBullet7(400,300,2.2,1500); + bullet[pnt].setdir(pi/2+sixrad+((double)i/(double)spcnt)*2.0f*pi); + } +} +void Level6Part6() +{ + frameleft=TenSeconds;tbrk=0; + ++part;spcnt=4;sixrad=sixbrk=0; + whicnt=1;DisableAllTower=false; +} +void Level6Part7() +{ + sixbrk+=hge->Timer_GetDelta(); + if (sixrad>2*pi){if(tbrk<1)NewMultpo(vector2d(400,300)),tbrk=100;return;} + if (sixbrk<0.04)return; + sixbrk=0; + sixrad+=pi/25.0f; + for (int i=0;i<spcnt;++i) + { + int pnt=CreateBullet7(400,300,2.4,1500); + bullet[pnt].setdir(pi/2+sixrad+((double)i/(double)spcnt)*2.0f*pi); + } +} +void Level6Part8() +{ + frameleft=TenSeconds;whrcnt=6; + ++part;spcnt=5;sixrad=sixbrk=0; + whicnt=1;DisableAllTower=false; + tbrk=0; +} +void Level6Part9() +{ + sixbrk+=hge->Timer_GetDelta(); + if (sixrad>2*pi){if(tbrk<1)NewMultpo(vector2d(400,300)),tbrk=100;return;} + if (sixbrk<0.04)return; + sixbrk=0; + sixrad+=pi/25.0f; + for (int i=0;i<spcnt;++i) + { + int pnt=CreateBullet7(400,300,2.6,1500); + bullet[pnt].setdir(pi/2+sixrad+((double)i/(double)spcnt)*2.0f*pi); + } +} +void Level6Part10() +{ + frameleft=TenSeconds;whrcnt=6; + ++part;spcnt=6;sixrad=sixbrk=0; + whicnt=1;DisableAllTower=false; + tbrk=0; +} +void Level6Part11() +{ + sixbrk+=hge->Timer_GetDelta(); + if (sixrad>2*pi){if(tbrk<1)NewMultpo(vector2d(400,300)),tbrk=100;return;} + if (sixbrk<0.04)return; + sixbrk=0; + sixrad+=pi/25.0f; + for (int i=0;i<spcnt;++i) + { + int pnt=CreateBullet7(400,300,2.6,1500); + bullet[pnt].setdir(pi/2+sixrad+((double)i/(double)spcnt)*2.0f*pi); + } +} +void Level6Part12() +{ + frameleft=AMinute;clrtime=1; + if (towcnt!=8&&towcnt) + { + ClearAll(false); + return; + } + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Get out before you are squashed..."); + } + if (Current_Position==1) + { + ++part;squashrev=false;All2pnt(); + tbrk=0; + CreateTower3(10,10,400,2,1); + CreateTower3(766,10,400,2,1); + CreateTower3(10,566,400,2,1); + CreateTower3(766,566,400,2,1); + CreateTower1(9,9,1000,1.5); + CreateTower1(767,11,1000,1.5); + CreateTower1(9,567,1000,1.5); + CreateTower1(767,567,1000,1.5); + } +} +void Level6Part13() +{ + tbrk+=hge->Timer_GetDelta(); + if(tbrk>=12) + { + for(int i=1;i<=4;++i)NewMultpo(tower[i].towerpos); + tbrk=0; + } + if (!squashrev) + { + if (!LOWFPS) + { + tower[1].towerpos.x+=0.01; + tower[1].towerpos.y+=0.007354; + tower[2].towerpos.x-=0.01; + tower[2].towerpos.y+=0.007354; + tower[3].towerpos.x+=0.01; + tower[3].towerpos.y-=0.007354; + tower[4].towerpos.x-=0.01; + tower[4].towerpos.y-=0.007354; + } + else + { + tower[1].towerpos.x+=0.16; + tower[1].towerpos.y+=0.117664; + tower[2].towerpos.x-=0.16; + tower[2].towerpos.y+=0.117664; + tower[3].towerpos.x+=0.16; + tower[3].towerpos.y-=0.117664; + tower[4].towerpos.x-=0.16; + tower[4].towerpos.y-=0.117664; + } + } + else + { + if (!LOWFPS) + { + tower[1].towerpos.x-=0.01; + tower[1].towerpos.y-=0.007354; + tower[2].towerpos.x+=0.01; + tower[2].towerpos.y-=0.007354; + tower[3].towerpos.x-=0.01; + tower[3].towerpos.y+=0.007354; + tower[4].towerpos.x+=0.01; + tower[4].towerpos.y+=0.007354; + } + else + { + tower[1].towerpos.x-=0.16; + tower[1].towerpos.y-=0.117664; + tower[2].towerpos.x+=0.16; + tower[2].towerpos.y-=0.117664; + tower[3].towerpos.x-=0.16; + tower[3].towerpos.y+=0.117664; + tower[4].towerpos.x+=0.16; + tower[4].towerpos.y+=0.117664; + } + } + if (tower[1].towerpos.x>766||tower[1].towerpos.x<10)squashrev=!squashrev; +} +double avabrk,avacurbrk; +bool dir; +void Level6Part14()//Avalanche +{ + frameleft=AMinute;clrtime=1; + if (towcnt) + { + ClearAll(false); + return; + } + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Avalanche..."); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=1.0f;avacurbrk=tbrk=0;dir=false; + } +} +void Level6Part15() +{ + avacurbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + avabrk=((double)frameleft/(double)AMinute)*0.04f+0.01f; + if (avacurbrk>avabrk) + { + avacurbrk=0; + int pnt=CreateBullet2(re.NextDouble(10,790),200,-6.25,3*pi/2.0f); + bullet[pnt].limv=re.NextInt(2,8);bullet[pnt].bulletaccel=0.005; + } + if (tbrk>6)NewMultpo(vector2d(re.NextDouble(20,780),re.NextDouble(20,150))),tbrk=0; +} +void Level6Part16() +{ + frameleft=AMinute;clrtime=2; + if (towcnt) + { + ClearAll(false); + return; + } + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("?.."); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=1.0f; + avacurbrk=0;dir=false;ATarg.TargShow(); + ATarg.targpos=vector2d(400,300); + whicnt=3;avacurbrk=0; + } +} +void Level6Part17() +{ + avacurbrk+=hge->Timer_GetDelta(); + avabrk=((double)frameleft/(double)AMinute)*0.8f+0.2f; + if (avacurbrk>avabrk) + { + avacurbrk=0; + int pnt; + if (re.NextInt(1,100)<=80) + pnt=CreateBullet7(ATarg.targpos.x,ATarg.targpos.y,3,500); + else + pnt=CreateBullet6(ATarg.targpos.x,ATarg.targpos.y,4,1000); + bullet[pnt].dist=1;bullet[pnt].bulletdir=vector2d(0,0); + if(re.NextInt(0,19)==14)NewMultpo(); + } +} +//begin hexagon +Bullet bheader[100],*beewx[1500]; +static int sxcnt,seq,beecnt; +bool brdir; +double offset; +void Level6Part18() +{ + DisableAllTower=false;clrtime=3; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Hexagon loops"); + } + if (Current_Position==1) + { + sxcnt=-1;beecnt=-1;brdir=false;frameleft=TenSeconds;offset=86; + memset(bheader,0,sizeof(bheader)); + memset(beewx,0,sizeof(beewx)); + avacurbrk=1;avabrk=1;sixbrk=0.1;seq=3; + for (int i=1;i<=5;++i) + { + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,10,2,-pi/6); + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,10,2,-5*pi/6); + } + ++part;ATarg.TargHide();All2pnt(); + } +} +void Level6Part19() +{ + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + if (frameleft<TenSeconds/10*1&&!brdir) + { + brdir=true; + for (int i=0;i<=beecnt;++i) + { + beewx[i]->bulletaccel=0.001;beewx[i]->limv=1; + beewx[i]->setdir(re.NextDouble(0,pi)); + } + } + for (int i=0;i<=sxcnt;++i)ProcessBullet2(bheader[i]); + if (avacurbrk>avabrk) + { + avacurbrk=0;++seq;seq%=4; + for (int i=0;i<=sxcnt;++i) + { + if (i&1) + { + switch (seq) + { + case 0:bheader[i].setdir(-5*pi/6);break; + case 1:bheader[i].setdir(-pi/2);break; + case 2:bheader[i].setdir(-pi/6);break; + case 3:bheader[i].setdir(-pi/2);break; + } + } + else + { + switch (seq) + { + case 0:bheader[i].setdir(-pi/6);break; + case 1:bheader[i].setdir(-pi/2);break; + case 2:bheader[i].setdir(-5*pi/6);break; + case 3:bheader[i].setdir(-pi/2);break; + } + } + } + } + if (sixbrk>0.2&&!brdir) + { + sixbrk=0; + if (bheader[0].bulletpos.y>610)return; + for (int i=0;i<=sxcnt;++i) + { + beewx[++beecnt]=&bullet[CreateBullet2(bheader[i].bulletpos.x,bheader[i].bulletpos.y,0,pi,true)]; + } + } +} +void Level6Part20() +{ + sxcnt=-1;beecnt=-1;brdir=false;frameleft=TwentySeconds;offset=43; + memset(bheader,0,sizeof(bheader)); + memset(beewx,0,sizeof(beewx)); + avacurbrk=0.5;avabrk=0.5;sixbrk=0.1;seq=3; + for (int i=1;i<=10;++i) + { + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,10,2,-pi/6); + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,10,2,-5*pi/6); + } + ++part; +} +void Level6Part21() +{ + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + if (frameleft<TenSeconds/10*11&&!brdir) + { + brdir=true; + for (int i=0;i<=beecnt;++i) + { + beewx[i]->bulletaccel=0.001;beewx[i]->limv=1; + beewx[i]->setdir(re.NextDouble(0,pi)); + } + } + for (int i=0;i<=sxcnt;++i)ProcessBullet2(bheader[i]); + if (avacurbrk>avabrk) + { + avacurbrk=0;++seq;seq%=4; + for (int i=0;i<=sxcnt;++i) + { + if (i&1) + { + switch (seq) + { + case 0:bheader[i].setdir(-5*pi/6);break; + case 1:bheader[i].setdir(-pi/2);break; + case 2:bheader[i].setdir(-pi/6);break; + case 3:bheader[i].setdir(-pi/2);break; + } + } + else + { + switch (seq) + { + case 0:bheader[i].setdir(-pi/6);break; + case 1:bheader[i].setdir(-pi/2);break; + case 2:bheader[i].setdir(-5*pi/6);break; + case 3:bheader[i].setdir(-pi/2);break; + } + } + } + } + if (sixbrk>0.2&&!brdir) + { + sixbrk=0; + if (bheader[0].bulletpos.y>610)return; + for (int i=0;i<=sxcnt;++i) + { + beewx[++beecnt]=&bullet[CreateBullet2(bheader[i].bulletpos.x,bheader[i].bulletpos.y,0,pi,true)]; + } + } +} +void Level6Part22() +{ + sxcnt=-1;beecnt=-1;brdir=false;frameleft=TenSeconds/10*7;offset=43; + memset(bheader,0,sizeof(bheader)); + memset(beewx,0,sizeof(beewx)); + avacurbrk=0.25;avabrk=0.25;sixbrk=0.1;seq=3; + for (int i=1;i<=10;++i) + { + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,10,4,-pi/6); + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,10,4,-5*pi/6); + } + ++part; +} +void Level6Part23() +{ + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + if (frameleft<TenSeconds/10*1&&!brdir) + { + brdir=true; + for (int i=0;i<=beecnt;++i) + { + beewx[i]->bulletaccel=0.001;beewx[i]->limv=1; + beewx[i]->setdir(re.NextDouble(0,pi)); + } + } + for (int i=0;i<=sxcnt;++i)ProcessBullet2(bheader[i]); + if (avacurbrk>avabrk) + { + avacurbrk=0;++seq;seq%=4; + for (int i=0;i<=sxcnt;++i) + { + if (i&1) + { + switch (seq) + { + case 0:bheader[i].setdir(-5*pi/6);break; + case 1:bheader[i].setdir(-pi/2);break; + case 2:bheader[i].setdir(-pi/6);break; + case 3:bheader[i].setdir(-pi/2);break; + } + } + else + { + switch (seq) + { + case 0:bheader[i].setdir(-pi/6);break; + case 1:bheader[i].setdir(-pi/2);break; + case 2:bheader[i].setdir(-5*pi/6);break; + case 3:bheader[i].setdir(-pi/2);break; + } + } + } + } + if (sixbrk>0.1&&!brdir) + { + sixbrk=0; + if (bheader[0].bulletpos.y>610)return; + for (int i=0;i<=sxcnt;++i) + { + beewx[++beecnt]=&bullet[CreateBullet2(bheader[i].bulletpos.x,bheader[i].bulletpos.y,0,pi,true)]; + } + } +} +void Level6Part24() +{ + sxcnt=-1;beecnt=-1;brdir=false;frameleft=TenSeconds/10*7;offset=43; + memset(bheader,0,sizeof(bheader)); + memset(beewx,0,sizeof(beewx)); + avacurbrk=0.25;avabrk=0.25;sixbrk=0.1;seq=3; + for (int i=1;i<=10;++i) + { + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,590,4,pi/6); + CreateBullet2(bheader[++sxcnt],offset+2*(i-1)*offset,590,4,5*pi/6); + } + ++part; +} +void Level6Part25() +{ + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + if (frameleft<TenSeconds/10*1&&!brdir) + { + brdir=true; + for (int i=0;i<=beecnt;++i) + { + beewx[i]->bulletaccel=0.001;beewx[i]->limv=1; + beewx[i]->setdir(re.NextDouble(0,pi)); + } + } + for (int i=0;i<=sxcnt;++i)ProcessBullet2(bheader[i]); + if (avacurbrk>avabrk) + { + avacurbrk=0;++seq;seq%=4; + for (int i=0;i<=sxcnt;++i) + { + if (i&1) + { + switch (seq) + { + case 0:bheader[i].setdir(5*pi/6);break; + case 1:bheader[i].setdir(pi/2);break; + case 2:bheader[i].setdir(pi/6);break; + case 3:bheader[i].setdir(pi/2);break; + } + } + else + { + switch (seq) + { + case 0:bheader[i].setdir(pi/6);break; + case 1:bheader[i].setdir(pi/2);break; + case 2:bheader[i].setdir(5*pi/6);break; + case 3:bheader[i].setdir(pi/2);break; + } + } + } + } + if (sixbrk>0.1&&!brdir) + { + sixbrk=0; + if (bheader[0].bulletpos.y<-10)return; + for (int i=0;i<=sxcnt;++i) + { + beewx[++beecnt]=&bullet[CreateBullet2(bheader[i].bulletpos.x,bheader[i].bulletpos.y,0,pi,true)]; + } + } +} +void Level6Part26() +{ + sxcnt=-1;beecnt=-1;brdir=false;frameleft=TenSeconds/10*7;offset=43; + memset(bheader,0,sizeof(bheader)); + memset(beewx,0,sizeof(beewx)); + avacurbrk=0.25;avabrk=0.25;sixbrk=0.1;seq=3; + for (int i=1;i<=10;++i) + { + CreateBullet2(bheader[++sxcnt],790,offset+2*(i-1)*offset,4,5*pi/3); + CreateBullet2(bheader[++sxcnt],790,offset+2*(i-1)*offset,4,pi/3); + } + ++part; +} +void Level6Part27() +{ + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + if (frameleft<TenSeconds/10*1&&!brdir) + { + brdir=true; + for (int i=0;i<=beecnt;++i) + { + beewx[i]->bulletaccel=0.001;beewx[i]->limv=1; + beewx[i]->setdir(re.NextDouble(0,pi)); + } + } + for (int i=0;i<=sxcnt;++i)ProcessBullet2(bheader[i]); + if (avacurbrk>avabrk) + { + avacurbrk=0;++seq;seq%=4; + for (int i=0;i<=sxcnt;++i) + { + if (i&1) + { + switch (seq) + { + case 0:bheader[i].setdir(pi/3);break; + case 1:bheader[i].setdir(0);break; + case 2:bheader[i].setdir(5*pi/3);break; + case 3:bheader[i].setdir(0);break; + } + } + else + { + switch (seq) + { + case 0:bheader[i].setdir(5*pi/3);break; + case 1:bheader[i].setdir(0);break; + case 2:bheader[i].setdir(pi/3);break; + case 3:bheader[i].setdir(0);break; + } + } + } + } + if (sixbrk>0.1&&!brdir) + { + sixbrk=0; + if (bheader[0].bulletpos.x<-10)return; + for (int i=0;i<=sxcnt;++i) + { + beewx[++beecnt]=&bullet[CreateBullet2(bheader[i].bulletpos.x,bheader[i].bulletpos.y,0,pi,true)]; + } + } +} +void Level6Part28() +{ + sxcnt=-1;beecnt=-1;brdir=false;frameleft=TenSeconds+TenSeconds/10*9;offset=43; + memset(bheader,0,sizeof(bheader)); + memset(beewx,0,sizeof(beewx)); + avacurbrk=0.25;avabrk=0.25;sixbrk=0.1;seq=3; + for (int i=1;i<=10;++i) + { + CreateBullet2(bheader[++sxcnt],10,offset+2*(i-1)*offset,4,pi+5*pi/3); + CreateBullet2(bheader[++sxcnt],10,offset+2*(i-1)*offset,4,pi+pi/3); + } + ++part; +} +void Level6Part29() +{ + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + if (frameleft<TenSeconds/10*6&&!brdir) + { + brdir=true; + for (int i=0;i<=beecnt;++i) + { + beewx[i]->bulletaccel=0.001;beewx[i]->limv=1; + beewx[i]->setdir(re.NextDouble(0,pi)); + } + } + for (int i=0;i<=sxcnt;++i)ProcessBullet2(bheader[i]); + if (avacurbrk>avabrk) + { + avacurbrk=0;++seq;seq%=4; + for (int i=0;i<=sxcnt;++i) + { + if (i&1) + { + switch (seq) + { + case 0:bheader[i].setdir(pi+pi/3);break; + case 1:bheader[i].setdir(pi);break; + case 2:bheader[i].setdir(pi+5*pi/3);break; + case 3:bheader[i].setdir(pi);break; + } + } + else + { + switch (seq) + { + case 0:bheader[i].setdir(pi+5*pi/3);break; + case 1:bheader[i].setdir(pi);break; + case 2:bheader[i].setdir(pi+pi/3);break; + case 3:bheader[i].setdir(pi);break; + } + } + } + } + if (sixbrk>0.1&&!brdir) + { + sixbrk=0; + if (bheader[0].bulletpos.x>810)return; + for (int i=0;i<=sxcnt;++i) + { + beewx[++beecnt]=&bullet[CreateBullet2(bheader[i].bulletpos.x,bheader[i].bulletpos.y,0,pi,true)]; + } + } +} +void Level6Part30()//Hyperfluid! +{ + frameleft=AMinute;clrtime=2; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Hyperfluid!"); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=0.2f;avacurbrk=0;sixbrk=-1;tbrk=0; + } +} +void Level6Part999999999()//well this is not an easter egg! +{ + avabrk=(frameleft/(double)AMinute)*0.15f+0.05f; + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + if(tbrk>10)tbrk=0,NewMultpo(vector2d(re.NextDouble(40,100),re.NextDouble(30,75))); + if (avacurbrk>avabrk) + { + avacurbrk=0; + for (int i=1;i<=re.NextInt(1,10);++i) + if (re.NextInt(1,1000)>500) + { + int pnt=CreateBullet2(10,re.NextDouble(10,590),0,-3*pi/4); + bullet[pnt].bulletaccel=0.0025;bullet[pnt].limv=6; + } + else + { + int pnt=CreateBullet2(re.NextDouble(10,790),10,0,-3*pi/4); + bullet[pnt].bulletaccel=0.0025;bullet[pnt].limv=6; + } + } + if (sixbrk>0.5) + { + sixbrk=0; + for (int i=1;i<=re.NextInt(1,10);++i) + { + int pnt=CreateBullet2(re.NextDouble(10,790),590,1,pi/2); + bullet[pnt].alterColor=white; + } + } +} +int bgbrk; +double bgdbbrk; +void Level7Part0() +{ + frameleft=50;All2pnt();towcnt=0;bgbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + LE_Active=false; + Current_Position=2; + ShowTip("\ +Level 7-Rainbow of Spring\n\ +Will there be a clearer day?\ +"); + frameleft=TenSeconds;++part; + } +} +bool skystp; +void Level7Part1() +{ + ++bgbrk;if (LOWFPS)bgbrk+=16; + if (bgbrk<30)return; + bgbrk=0; + if (!LOWFPS) + DBGColor=ColorTransfer(DBGColor,0xFF0B0916); + else + for (int i=1;i<=17;++i)DBGColor=ColorTransfer(DBGColor,0xFF0B0916); + if (DBGColor==0xFF0B0916) + { + frameleft=AMinute,++part;tbrk=0;clrtime=2; + bgdbbrk=re.NextInt(5,20),bgbrk=0; + avabrk=0.2f;avacurbrk=0;skystp=false; + } +} +void Level7Part2() +{ + if (bgbrk==1||bgbrk==4) + { + int times=5;if (LOWFPS)times*=16; + for (int i=1;i<=times;++i)DBGColor=ColorTransfer(DBGColor,0xFF23459A); + if (DBGColor==0xFF23459A) + { + if(bgbrk==1)bgbrk=2; + if(bgbrk==4)bgbrk=5; + } + } + if (bgbrk==2||bgbrk==5) + { + int times=1;if (LOWFPS)times*=16; + for (int i=1;i<=times;++i)DBGColor=ColorTransfer(DBGColor,0xFF0B0916); + if (DBGColor==0xFF0B0916) + { + if(bgbrk==2)bgbrk=3,bgdbbrk=0.06; + if(bgbrk==5)bgbrk=0,bgdbbrk=re.NextInt(5,20); + } + } + if (bgbrk==3||bgbrk==0) + { + bgdbbrk-=hge->Timer_GetDelta(); + if (bgdbbrk<=0) + { + if (bgbrk==0)bgbrk=1; + if (bgbrk==3)bgbrk=4; + } + } + avabrk=(frameleft/(double)AMinute)*0.15f+0.15f; + avacurbrk+=hge->Timer_GetDelta(); + sixbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + if (tbrk>10)tbrk=0,NewMultpo(vector2d(re.NextDouble(200,600),re.NextDouble(500,575))); + if (avacurbrk>avabrk) + { + avacurbrk=0; + for (int i=1;i<=re.NextInt(1,10);++i) + { + if (re.NextInt(1,1000)>=500) + { + int pnt=CreateBullet2(10,re.NextDouble(10,590),0,-3*pi/4); + bullet[pnt].bulletaccel=0.0025;bullet[pnt].limv=6; + } + else + { + int pnt=CreateBullet2(re.NextDouble(10,790),10,0,-3*pi/4); + bullet[pnt].bulletaccel=0.0025;bullet[pnt].limv=6; + } + if (re.NextInt(1,1000)>=500) + { + int pnt=CreateBullet2(780,re.NextDouble(10,590),0,-pi/4); + bullet[pnt].bulletaccel=0.0025;bullet[pnt].limv=6; + } + else + { + int pnt=CreateBullet2(re.NextDouble(10,790),10,0,-pi/4); + bullet[pnt].bulletaccel=0.0025;bullet[pnt].limv=6; + } + } + } +} +void Level7Part3() +{ + frameleft=TenSeconds; + if (!skystp) + { + ++bgbrk;if (LOWFPS)bgbrk+=16; + if (bgbrk<30)return; + bgbrk=0; + if (!LOWFPS) + DBGColor=ColorTransfer(DBGColor,0xFFFFFFFF); + else + for (int i=1;i<=17;++i)DBGColor=ColorTransfer(DBGColor,0xFFFFFFFF); + if (DBGColor==0xFFFFFFFF)skystp=skyactive=true,sky.SkySetFadeIn(),sky.SetSpeed(0.01); + sky.SetTime(9); + } + else + { + ++bgbrk;if (LOWFPS)bgbrk+=16; + if (bgbrk<30)return; + bgbrk=0; + if (!LOWFPS) + DBGColor=ColorTransfer(DBGColor,0x00FFFFFF); + else + for (int i=1;i<=17;++i)DBGColor=ColorTransfer(DBGColor,0x00FFFFFF); + if (DBGColor==0x00FFFFFF) + ++part; + } +} +void Level7Part4() +{ + frameleft=(AMinute+ThirtySeconds);clrtime=3; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Rainbow tower..."); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + towcnt=0; + deltadelta=pi/720; + CreateTower6(400,300,600,2,1000,3,72); + ++part;All2pnt(); +} +void Level7Part5() +{ + ++frameskips; + if (tower[1].towertype==6) + { + if (frameskips>TenSeconds/5) + { + frameskips=0; + towcnt=0; + CreateTower9(400,300,600,2,1500,72,1200); + } + } + if (tower[1].towertype==9) + { + if (frameskips>TenSeconds/5) + { + frameskips=0; + towcnt=0; + CreateTower4(400,300,500,1,500); + } + } + if (tower[1].towertype==4) + { + if (frameskips>TenSeconds/5) + { + frameskips=0; + towcnt=0; + CreateTower1(400,300,50,4); + } + } + if (tower[1].towertype==1) + { + if (frameskips>TenSeconds/5) + { + frameskips=0; + towcnt=0; + CreateTower2(400,300,50,4); + } + } + if (tower[1].towertype==2) + { + if (frameskips>TenSeconds/2) + { + frameskips=0; + towcnt=0; + CreateTower8(400,300,500,5,20,50); + } + } + if (tower[1].towertype==8) + { + BTarg.TargHide(); + if (frameskips>TenSeconds/5) + { + frameskips=0; + towcnt=0; + CreateTower5(400,300,50,5); + } + } + if (tower[1].towertype==5) + { + if (frameskips>TenSeconds/5) + { + frameskips=0; + towcnt=0; + CreateTower6(400,300,600,2,1000,3,72); + } + } +} +void Level7Part6() +{ + frameleft=AMinute;clrtime=2;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Hit Z..."); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=1.0f;avacurbrk=0; + } +} +void Level7Part7() +{ + avabrk=frameleft/(double)AMinute*0.5f+0.5f; + avacurbrk+=hge->Timer_GetDelta(); + if (avacurbrk>avabrk) + { + if(re.NextInt(0,4)==0)NewMultpo(); + avacurbrk=0; + bool lasta,lastb; + lasta=re.NextInt(1,1000)<500;lastb=re.NextInt(1,1000)<500; + for (int i=0;i<31;++i) + { + int rf=re.NextInt(0,999); + if ((lasta&&rf<600)||(!lasta&&rf<250)) + { + int pnt=CreateBullet2(-15,i*20,2,pi); + bullet[pnt].alterColor=(TColors)(i%8); + bullet[pnt].limv=2+2*(AMinute-frameleft)/(double)AMinute;bullet[pnt].bulletaccel=0.002; + lasta=true; + }else lasta=false; + rf=re.NextInt(0,999); + if ((lastb&&rf<600)||(!lastb&&rf<250)) + { + int pnt=CreateBullet2(815,i*20-10,2,0); + bullet[pnt].alterColor=(TColors)(i%8); + bullet[pnt].limv=2+2*(AMinute-frameleft)/(double)AMinute;bullet[pnt].bulletaccel=0.002; + lastb=true; + }else lastb=false; + } + } +} +double sntang; +void Level7Part8() +{ + frameleft=AMinute;clrtime=2;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Rainbow!"); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=0.03f;avacurbrk=1.0f;sntang=-pi/2; + } +} +void rainbowCreator(double rl,double rr,double rad,TColors col,double speed,bool invi=false) +{ + double r=re.NextDouble(rr,rl); + int pnt=CreateBullet2(900+cos(rad)*r,700+sin(rad)*r,speed,re.NextDouble(0,pi),true,invi); + bullet[pnt].alterColor=col; +} +void Level7Part9() +{ + if (sntang>-pi) + { + avacurbrk+=hge->Timer_GetDelta(); + if (avacurbrk>avabrk) + { + sntang-=pi/180;avacurbrk=0; + for(int i=0;i<6;++i)rainbowCreator(660,600,sntang,red,0,1); + for(int i=0;i<6;++i)rainbowCreator(610,550,sntang,orange,0,1); + for(int i=0;i<6;++i)rainbowCreator(560,500,sntang,yellow,0,1); + for(int i=0;i<6;++i)rainbowCreator(510,450,sntang,green,0,1); + for(int i=0;i<6;++i)rainbowCreator(460,410,sntang,blue,0,1); + for(int i=0;i<6;++i)rainbowCreator(420,360,sntang,dblue,0,1); + for(int i=0;i<6;++i)rainbowCreator(365,310,sntang,purple,0,1); + } + } + else + { + avabrk=0.25+(frameleft/(double)AMinute)*0.5f; + avacurbrk+=hge->Timer_GetDelta(); + if (avacurbrk>avabrk) + { + avacurbrk=0; + if(re.NextInt(0,19)==7)NewMultpo(); + double spd=((AMinute-frameleft)/(double)AMinute)+1; + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(660,600,sntang,red,spd); + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(610,550,sntang,orange,spd); + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(560,500,sntang,yellow,spd); + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(510,450,sntang,green,spd); + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(460,410,sntang,blue,spd); + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(420,360,sntang,dblue,spd); + for(int i=0;i<((AMinute-frameleft)/(double)AMinute)*20;++i) + sntang=re.NextDouble(-pi,-pi/2), + rainbowCreator(365,310,sntang,purple,spd); + sntang=-pi-0.1; + } + } +} +SimpleThing aa,bb; +void Level7Part10() +{ + frameleft=AMinute*2;clrtime=1;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Interference(fake)"); + } + if (Current_Position==1) + { + ++part;All2pnt();skyactive=false;DBGColor=0xFF000000; + binter.Init("./Resources/b_inter.png",PicBack::Centered,0x80); + binter.SetFadeIn();aa.Init(vector2d(260,292));bb.Init(vector2d(523,292)); + } +} +void Level7Part11() +{ +//260,292;523,292 + aa.Update(true);bb.Update(false); +} +diffCreator dfc[200]; +void Level7Part12() +{ + frameleft=AMinute*2;clrtime=3;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false;bulcnt=0; + aa.toPoint();bb.toPoint(); + Current_Position=2; + ShowTip("Diffraction(fake)"); + } + if (Current_Position==1) + { + ++part;memset(dfc,0,sizeof(dfc)); + binter.SetFadeOut();bdiff.Init("./resources/b_diff.png",PicBack::Tiled,0x80); + bdiff.SetFadeIn();bdiff.SetScale(0.5); + avabrk=2.0f;avacurbrk=0; + } +} +void Level7Part13() +{ + avabrk=1.0f+frameleft/(double)AMinute; + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk&&frameleft>=TenSeconds/5) + { + for(int i=0;i<200;++i) + if (!dfc[i].isActive()) + { + if(re.NextInt(1,100)>=75) + { + if(re.NextInt(1,100)>=50) + { + vector2d pos=vector2d(playerpos.x,re.NextDouble(0,600)); + while (GetDist(pos,playerpos)<100) + pos=vector2d(playerpos.x,re.NextDouble(0,600)); + dfc[i].init(pos); + } + else + { + vector2d pos=vector2d(re.NextDouble(0,800),playerpos.y); + while (GetDist(pos,playerpos)<100) + pos=vector2d(re.NextDouble(0,800),playerpos.y); + dfc[i].init(pos); + } + } + else + { + vector2d pos=vector2d(re.NextDouble(0,800),re.NextDouble(0,600)); + while (GetDist(pos,playerpos)<100) + pos=vector2d(re.NextDouble(0,800),re.NextDouble(0,600)); + dfc[i].init(pos); + if(re.NextInt(0,7)==3)NewMultpo(pos); + } + break; + } + avacurbrk=0; + } + for(int i=0;i<200;++i) + if(dfc[i].isActive())dfc[i].update(); +} +BulletSine bnl[100]; +double ykbrk; +void Level7Part14()//Photon school +{ + memset(bnl,0,sizeof(bnl)); + frameleft=AMinute;clrtime=2; + ykbrk=0.5f;skyactive=true;bdiff.SetFadeOut(); + if((DBGColor=ColorTransfer(DBGColor,0x00000000))==0x0)++part; +} +void Level7Part15() +{ + ykbrk-=hge->Timer_GetDelta(); + if (ykbrk<0&&frameleft>TenSeconds/10*3) + { + ykbrk=(double)frameleft/AMinute*0.75f+0.75f; + for (int i=0;i<100;++i) + if (!bnl[i].active) + { + vector2d a,b; + if (re.NextInt(1,100)>=50) + { + if (re.NextInt(1,100)>=50)a=vector2d(re.NextDouble(10,790),610);else a=vector2d(re.NextDouble(10,790),-10); + } + else + { + if (re.NextInt(1,100)>=50)a=vector2d(-10,re.NextDouble(10,590));else a=vector2d(810,re.NextDouble(10,590)); + } + if (re.NextInt(1,100)>=50) + { + if (re.NextInt(1,100)>=50)b=vector2d(re.NextDouble(10,790),610);else b=vector2d(re.NextDouble(10,790),-10); + } + else + { + if (re.NextInt(1,100)>=50)b=vector2d(-10,re.NextDouble(10,590));else b=vector2d(810,re.NextDouble(10,590)); + } + bnl[i].Init(a,b); + break; + } + } + for (int i=0;i<100;++i) + if (bnl[i].active)bnl[i].Update(); +} +double DTCircle; +BCircle Circles[20]; +int CCnt,state; +void Level7Part16()//Great circles +{ + towcnt=0;clrtime=0; + frameleft=Infinity;All2pnt(); + Circles[0].Init(444,20*pi/50000.0f,6,vector2d(400,300)); + Circles[1].Init(444,-20*pi/50000.0f,6,vector2d(400,300)); + CCnt=1;state=0; + DTCircle=0.0f; + ++part;playerpos.x=400,playerpos.y=300; +} +void Level7Part17()//Great circles-child1 +{ + frameleft=Infinity; + DTCircle+=hge->Timer_GetDelta(); + if (DTCircle>1&&CCnt<3) + { + Circles[2].Init(444,10*pi/50000.0f,12,vector2d(400,300)); + Circles[3].Init(444,-10*pi/50000.0f,12,vector2d(400,300)); + CCnt=3; + } + if (DTCircle>2&&CCnt<5) + { + Circles[4].Init(444,8*pi/50000.0f,18,vector2d(400,300)); + Circles[5].Init(444,-8*pi/50000.0f,18,vector2d(400,300)); + CCnt=5; + } + if (DTCircle>3&&CCnt<7) + { + Circles[6].Init(444,8*pi/50000.0f,27,vector2d(400,300)); + Circles[7].Init(444,-8*pi/50000.0f,27,vector2d(400,300)); + CCnt=7; + } + if (DTCircle>4&&CCnt<9) + { + Circles[8].Init(444,6*pi/50000.0f,45,vector2d(400,300)); + Circles[9].Init(444,-6*pi/50000.0f,45,vector2d(400,300)); + CCnt=9; + } + if (DTCircle>5&&CCnt<11) + { + Circles[10].Init(444,6*pi/50000.0f,60,vector2d(400,300)); + Circles[11].Init(444,-6*pi/50000.0f,60,vector2d(400,300)); + CCnt=11; + } + if (DTCircle>5&&CCnt<13) + { + Circles[12].Init(444,3*pi/50000.0f,96,vector2d(400,300)); + Circles[13].Init(444,-3*pi/50000.0f,96,vector2d(400,300)); + CCnt=13; + } + if (Circles[0].GetRange()>=50) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[0].SetRange(Circles[0].GetRange()-0.1), + Circles[1].SetRange(Circles[1].GetRange()-0.1); + } + if (Circles[2].GetRange()>=100&&CCnt>=3) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[2].SetRange(Circles[2].GetRange()-0.1), + Circles[3].SetRange(Circles[3].GetRange()-0.1); + } + if (Circles[4].GetRange()>=150&&CCnt>=5) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[4].SetRange(Circles[4].GetRange()-0.1), + Circles[5].SetRange(Circles[5].GetRange()-0.1); + } + if (Circles[6].GetRange()>=210&&CCnt>=7) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[6].SetRange(Circles[6].GetRange()-0.1), + Circles[7].SetRange(Circles[7].GetRange()-0.1); + } + if (Circles[8].GetRange()>=270&&CCnt>=9) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[8].SetRange(Circles[8].GetRange()-0.1), + Circles[9].SetRange(Circles[9].GetRange()-0.1); + } + if (Circles[10].GetRange()>=320&&CCnt>=11) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[10].SetRange(Circles[10].GetRange()-0.1), + Circles[11].SetRange(Circles[11].GetRange()-0.1); + } + if (Circles[12].GetRange()>=420&&CCnt>=13) + { + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + Circles[12].SetRange(Circles[12].GetRange()-0.1), + Circles[13].SetRange(Circles[13].GetRange()-0.1); + } + else + { + if (CCnt>=13)++part; + for (int i=1;i<=CCnt;++i) + Circles[i].SetDT(i*pi); + } + for (int i=0;i<=CCnt;++i)Circles[i].Update(); + state=0; + towerspr[red]->RenderStretch(770,0,800,30); + towerspr[green]->RenderStretch(380,280,420,320); +} +void Level7Part18()//Great circles-child2 +{ + if(state) + { + towerspr[green]->RenderStretch(770,0,800,30); + towerspr[red]->RenderStretch(380,280,420,320); + } + else + { + towerspr[red]->RenderStretch(770,0,800,30); + towerspr[green]->RenderStretch(380,280,420,320); + } + hgeRect col; + if (state) + { + col=hgeRect(380,280,420,320); + if (col.TestPoint(playerpos.x,playerpos.y))++part; + } + else + { + col=hgeRect(770,0,800,30); + if (col.TestPoint(playerpos.x,playerpos.y))state=1; + } + frameleft=Infinity; + for (int i=0;i<=CCnt;++i) + { + if (i==0||i==1)Circles[i].SetRange(50+10*sin(Circles[i].GetDT())); + if (i==2||i==3)Circles[i].SetRange(100+10*sin(Circles[i].GetDT())); + if (i==4||i==5)Circles[i].SetRange(150+10*sin(Circles[i].GetDT())); + if (i==6||i==7)Circles[i].SetRange(210+20*sin(Circles[i].GetDT())); + if (i==8||i==9)Circles[i].SetRange(270+20*sin(Circles[i].GetDT())); + if (i==10||i==11)Circles[i].SetRange(320+20*sin(Circles[i].GetDT())); + if (i==12||i==13)Circles[i].SetRange(420+30*sin(Circles[i].GetDT())); + Circles[i].Update(); + } +} +BTail btails[50]; +void Level7Part19() +{ + frameleft=AMinute*2;clrtime=3;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Warning: Trypophobia caution ahead!"); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=1.0f;avacurbrk=1.0f;memset(btails,0,sizeof(btails)); + } +} +void Level7Part20() +{ + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + avacurbrk=0;avabrk=(frameleft/(double)(AMinute*2))*0.7+0.3; + for(int i=0;i<50;++i) + if(!btails[i].isActive()) + {btails[i].Create();break;} + if(re.NextInt(0,24)==15)NewMultpo(); + } + for(int i=0;i<50;++i) + if(btails[i].isActive())btails[i].Update(); +} +int sttnt; +void Level7Part21() +{ + frameleft=AMinute+ThirtySeconds;All2pnt();clrtime=1; + if (towcnt!=1&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + t8special=true; + sttnt=CreateTower8(400,300,2000,2,75,20); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part; + return; + } +} +void Level7Part22() +{ + tower[sttnt].towertimer=(frameleft/(double)(AMinute+ThirtySeconds))*1250+750; +} +WOP wop[100]; +void Level7Part23()//Wave of Photon +{ + memset(bnl,0,sizeof(bnl));t8special=false; + frameleft=AMinute;All2pnt();towcnt=0; + ykbrk=0.5f;++part;clrtime=1; +} +void Level7Part24() +{ + ykbrk-=hge->Timer_GetDelta(); + if (ykbrk<0&&frameleft>TenSeconds/10*3) + { + ykbrk=(double)frameleft/AMinute/2.0f+0.2f; + for (int i=0;i<100;++i) + if (!wop[i].active) + { + vector2d a,b; + if (re.NextInt(1,100)>=50) + { + if (re.NextInt(1,100)>=50)a=vector2d(re.NextDouble(10,790),610);else a=vector2d(re.NextDouble(10,790),-10); + } + else + { + if (re.NextInt(1,100)>=50)a=vector2d(-10,re.NextDouble(10,590));else a=vector2d(810,re.NextDouble(10,590)); + } + if (re.NextInt(1,100)>=50) + { + if (re.NextInt(1,100)>=50)b=vector2d(re.NextDouble(10,790),610);else b=vector2d(re.NextDouble(10,790),-10); + } + else + { + if (re.NextInt(1,100)>=50)b=vector2d(-10,re.NextDouble(10,590));else b=vector2d(810,re.NextDouble(10,590)); + } + if (re.NextInt(1,100)>=80) + { + vector2d d=playerpos-a; + b=playerpos; + while(b.x>-5&&b.x<805&&b.y>-5&&b.y<605)b=b+d; + } + wop[i].Init(a,b,1+(AMinute-frameleft)/(double)AMinute,0.02); + break; + } + } + for (int i=0;i<100;++i) + if (wop[i].active)wop[i].Update(); +} +RTV rtv[100]; +void Level7Part25() +{ + frameleft=AMinute+ThirtySeconds; + All2pnt();towcnt=Lasercnt=0; + ++part;memset(rtv,0,sizeof(rtv)); + avabrk=1;avacurbrk=0.7;clrtime=1; +} +void Level7Part26() +{ + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk&&frameleft>TenSeconds/3) + { + avacurbrk=0;avabrk=frameleft/(double)(AMinute+ThirtySeconds)*1.25+0.75; + for(int i=0;i<100;++i)if(!rtv[i].isActive()) + { + int spinner=6; + if(frameleft<AMinute)spinner=8; + if(frameleft<ThirtySeconds)spinner=12; + if(re.NextInt(1,100)>=40)rtv[i].Init(1,(re.NextInt(0,1)?1:-1)*pi/123,spinner,(TColors)(re.NextInt(0,7)),re.NextInt(0,11)); + else if(re.NextInt(0,1)) + rtv[i].Init(2,(re.NextInt(0,1)?1:-1)*pi/60,spinner,(TColors)(re.NextInt(0,7)),re.NextInt(0,11)); + else + rtv[i].Init(3,pi/48,spinner,(TColors)(re.NextInt(0,7)),re.NextInt(0,11)); + break; + } + } + for(int i=0;i<100;++i)if(rtv[i].isActive())rtv[i].Update(); +} +//Level-1 stats from here +void Levelm1Part0() +{ + frameleft=50;All2pnt();towcnt=0;bgbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + LE_Active=false; + Current_Position=2; + ShowTip("\ +Level -1-Over the Horizon\n\ +Level -1! Getting ready?\ +"); + frameleft=TenSeconds;++part; + } +} +void Levelm1Part1()//3 circles +{ + frameleft=AMinute;clrtime=2;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("RGB..."); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=1.0f;avacurbrk=0;tbrk=0; + } +} +void CircCreator(vector2d p,int cnt,TColors col) +{ + for (int i=0;i<cnt;++i) + { + int pnt=CreateBullet2(p.x,p.y,6,frameleft*pi/AMinute+i*(2*pi/cnt)); + // ^ + // Nowhere can be safe! + bullet[pnt].alterColor=col; + bullet[pnt].bulletaccel=-0.003;bullet[pnt].limv=((AMinute-frameleft)/(double)AMinute)+1.0f; + } +} +void Levelm1Part2() +{ + avacurbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + avabrk=(frameleft/(double)AMinute)*0.5f+0.5f; + if(tbrk>8)tbrk=0,NewMultpo(vector2d(400,300)); + if(avacurbrk>avabrk) + { + avacurbrk=0; + CircCreator(vector2d(400,250),60,red); + CircCreator(vector2d(350,336.6),60,green); + CircCreator(vector2d(450,336.6),60,blue); + } +} +BCircle scircles[200]; +double rspd[200]; +void Levelm1Part3()//circles +{ + frameleft=AMinute;clrtime=1;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("??????"); + } + if (Current_Position==1) + { + ++part;All2pnt();avabrk=1.0f;avacurbrk=1.0f;memset(scircles,0,sizeof(scircles)); + } +} +void Levelm1Part4() +{ + avacurbrk+=hge->Timer_GetDelta(); + avabrk=0.1+(frameleft/(double)AMinute)*0.4f; + if(avacurbrk>avabrk) + { + avacurbrk=0; + for(int i=0;i<200;++i) + { + if (scircles[i].GetRange()>510||scircles[i].GetRange()<1e-7) + { + scircles[i].Init(1,(re.NextInt(0,1)?1:-1)*(frameleft<TwentySeconds?0.0003:0.0002),36,vector2d(400,300),(TColors)re.NextInt(0,7),(TColors)re.NextInt(0,7)); + rspd[i]=0.575+(frameleft/(double)AMinute)*0.1;break; + } + } + } + for(int i=0;i<200;++i) + { + if (scircles[i].GetRange()>1e-7&&scircles[i].GetRange()<510) + { + scircles[i].SetRange(scircles[i].GetRange()+(LOWFPS?17:1)*rspd[i]); + if (rspd[i]>0.002)rspd[i]-=0.0005*(LOWFPS?17:1); + if (rspd[i]<=0.002)rspd[i]=0.002; + scircles[i].Update(); + } + } +} +void Levelm1Part5()//Spiky +{ + frameleft=AMinute+ThirtySeconds; + for(int i=0;i<200;++i) + if (scircles[i].GetRange()>1e-7&&scircles[i].GetRange()<510) + scircles[i].circ2pnt(); + towcnt=0;clrtime=1; + Lasercnt=0; + ++part;avabrk=1;avacurbrk=0.5; +} +void Levelm1Part6()//Spiky-child +{ + avacurbrk+=hge->Timer_GetDelta(); + if (avacurbrk>avabrk) + { + avacurbrk=0;avabrk=frameleft/(double)(AMinute+ThirtySeconds)*0.4+0.1; + for (int i=0;i<1000;++i) + { + if (!noname[i].Exist()) + { + if (frameleft<TenSeconds) + noname[i].Init(re.NextDouble(0,800),4,100,150,60,0x8033CCFF); + else if (frameleft<TwentySeconds) + noname[i].Init(re.NextDouble(0,800),4,100,150,65,0x8033CCFF); + else noname[i].Init(re.NextDouble(0,800),4,100,150,75,0x8033CCFF); + break; + } + } + if(re.NextInt(0,19)==8)NewMultpo(); + } + for (int i=0;i<1000;++i)if (noname[i].Exist())noname[i].Process(); +} +achromaGroup aca,acb; +void Levelm1Part7()//Achromatopsia1 +{ + frameleft=AMinute;for(int i=0;i<1000;++i)if(noname[i].Exist())noname[i].noname2pnt(); + aca.Init(red,0.075);acb.Init(green,0.075);clrtime=1; + ++part;avabrk=2.0f;avacurbrk=0;achromab=false; +} +void Levelm1Part8()//Achromatopsia1-child +{ + avacurbrk+=hge->Timer_GetDelta(); + if (avacurbrk>avabrk) + { + avacurbrk=0;avabrk=2; + aca.Reverse();acb.Reverse(); + if(re.NextInt(0,7)==3)NewMultpo(vector2d(re.NextInt(10,790),re.NextInt(500,590))); + } + aca.Update(1);acb.Update(); +} +void Levelm1Part9()//Achromatopsia2 +{ + frameleft=AMinute;clrtime=1; + aca.Init(red,1);acb.Init(green,1); + ++part;avabrk=1.5f;avacurbrk=0;achromab=true; +} +void Levelm1Part10()//Achromatopsia2-child +{ + avacurbrk+=hge->Timer_GetDelta(); + if (avacurbrk>avabrk) + { + avacurbrk=0;avabrk=2; + aca.Reverse();acb.Reverse(); + } + aca.Update();acb.Update(); +} +void Levelm1Part11() +{ + frameleft=AMinute+ThirtySeconds;clrtime=2; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("I've heard that all of you\n\ +support hyper-threading?"); + return; + } + ++frameskips; + if(!PlayerSplit)playerpos=vector2d(200,150),PlayerSplit=true; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower8(400,300,857,3,57,20,false); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + { + aca.achroma2pnt();acb.achroma2pnt(); + tower[i].RendColor=0x00FFFFFF; + } + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +void Levelm1Part12() +{ + frameleft=ThirtySeconds;if(tower[towcnt].towertype!=6)towcnt=0; + DisableAllTower=false; + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower6(400,300,2500,2,2000,3,12); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false;BTarg.TargHide(); + return; + } +} +int m19lead[10],m19gen[700]; +double m19rad; +int m19step,m19cnt; +bool m19pldir; +void Levelm1Part13()//Gravity Vortex +{ + frameleft=AMinute*2;towcnt=0;PlayerSplit=false; + clrtime=2; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Who's collecting such great power here?"); + return; + } + if (!LOWFPS) + DBGColor=ColorTransfer(DBGColor,0xFF000000); + else + for (int i=1;i<=17;++i)DBGColor=ColorTransfer(DBGColor,0xFF000000); + if (DBGColor==0xFF000000) + { + All2pnt();memset(m19lead,0,sizeof(m19lead)); + memset(m19gen,0,sizeof(m19gen)); + ++part;m19rad=m19step=m19cnt=0; + avabrk=0.05;avacurbrk=0; + for(int i=0;i<8;++i) + { + m19lead[i]=CreateBullet2(400,300,0,0); + bullet[m19lead[i]].bulletpos=vector2d(400+250*cos(m19rad+i*pi/4),300+250*sin(m19rad+i*pi/4)); + bullet[m19lead[i]].alterColor=(TColors)i; + bullet[m19lead[i]].inv=true; + } + m19pldir=false;BTarg.targpos=playerpos; + } +} +void Levelm1Part20update() +{ + if(!m19pldir)BTarg.TargGoto(vector2d(400,300)),playerpos=BTarg.targpos; + if(!m19pldir&&GetDist(playerpos,vector2d(400,300))<0.01)m19pldir=true; + for(int i=0;i<m19cnt;++i) + { + if(bullet[m19gen[i]].redattrib) + { + if(bullet[m19gen[i]].redattrib>1) + { + double r=re.NextDouble(0,75-50*(frameleft/(double)(AMinute*2))),theta=re.NextDouble(-pi,pi); + bullet[m19gen[i]].bulletpos=vector2d(400+r*cos(theta),300+r*sin(theta)); + bullet[m19gen[i]].bulletspeed=0; + } + else + { + if(GetDist(bullet[m19gen[i]].bulletpos,vector2d(400,300))<4) + { + bullet[m19gen[i]].redattrib=2; + bullet[m19gen[i]].setdir(re.NextDouble(-pi,pi)); + bullet[m19gen[i]].bulletaccel=0.0015; + bullet[m19gen[i]].limv=re.NextDouble(1,8-2*(frameleft/(double)(AMinute*2))); + } + } + } + } +} +void Levelm1Part14() +{ + avacurbrk+=hge->Timer_GetDelta(); + m19rad+=pi/(5400.0f+1800.0f*(frameleft/(double)(AMinute*2)))*(1000.0f/hge->Timer_GetFPS()); + for(int i=0;i<8;++i)bullet[m19lead[i]].bulletpos=vector2d(400+250*cos(m19rad+i*pi/4),300+250*sin(m19rad+i*pi/4)); + switch(m19step) + { + case 0: + if(avacurbrk>avabrk) + { + for(int i=0;i<8;++i) + { + m19gen[m19cnt]=CreateBullet2(bullet[m19lead[i]].bulletpos.x,bullet[m19lead[i]].bulletpos.y,0,0); + bullet[m19gen[m19cnt]].redir(vector2d(400,300)); + bullet[m19gen[m19cnt]].alterColor=(TColors)i; + bullet[m19gen[m19cnt]].bulletaccel=0.002; + bullet[m19gen[m19cnt]].limv=3; + bullet[m19gen[m19cnt]].whirem=1000; + bullet[m19gen[m19cnt]].addblend=true; + bullet[m19gen[m19cnt++]].redattrib=re.NextInt(0,3)?0:1; + } + if(m19cnt/8>80-50*(frameleft/(double)(AMinute*2)))m19step=1,avabrk=3,tbrk=0; + avacurbrk=0; + } + Levelm1Part20update(); + break; + case 1: + if(avacurbrk>avabrk) + { + m19step=0;avabrk=0.05;memset(m19gen,0,sizeof(m19gen));m19cnt=0; + } + tbrk+=hge->Timer_GetDelta(); + if(tbrk>0.05) + { + tbrk=0; + for(int i=0;i<8;++i) + { + int pnt=CreateBullet2(bullet[m19lead[i]].bulletpos.x,bullet[m19lead[i]].bulletpos.y,0,0); + bullet[pnt].redir(vector2d(400,300)); + bullet[pnt].alterColor=(TColors)i; + bullet[pnt].bulletdir.x=-bullet[pnt].bulletdir.x; + bullet[pnt].bulletdir.y=-bullet[pnt].bulletdir.y; + bullet[pnt].bulletaccel=0.002;bullet[pnt].limv=2; + bullet[pnt].whirem=2500;bullet[pnt].addblend=true; + } + } + Levelm1Part20update(); + break; + } +} +vector2d snextarg; +int snexcnt,snexstep; +Target snexTarg; +void Levelm1Part15()//"Supernova" +{ + frameleft=AMinute*2;clrtime=1; + ++bgbrk;if (LOWFPS)bgbrk+=16; + if (bgbrk<30)return; + bgbrk=0;towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Super...\n\ +...nova!!"); + return; + } + if (Current_Position==1) + { + snexTarg.Init(0.001,vector2d(400,300)); + All2pnt(); + ++part;avabrk=12.0f;avacurbrk=0;tbrk=0; + snexstep=0;snexcnt=10;snexTarg.TargShow(); + } +} +void snCircCreator(vector2d p,int cnt,TColors col,bool mode) +{ + if(mode) + for (int i=0;i<cnt;++i) + { + int pnt=CreateBullet2(p.x,p.y,6,acos((playerpos-vector2d(400,300))^vector2d(1,0))+(i-0.5f)*(2*pi/cnt)); + bullet[pnt].redir(playerpos);bullet[pnt].bulletdir.Rotate((i+0.5f)*(2*pi/cnt)); + bullet[pnt].alterColor=col;bullet[pnt].addblend=true; + } + else + for (int i=0;i<cnt;++i) + { + int pnt=CreateBullet2(p.x,p.y,2,acos((playerpos-vector2d(400,300))^vector2d(1,0))+i*(2*pi/cnt)); + bullet[pnt].redir(playerpos);bullet[pnt].bulletdir.Rotate(i*(2*pi/cnt)); + bullet[pnt].alterColor=col;bullet[pnt].addblend=true; + } +} +void Levelm1Part16() +{ + snexTarg.TargRender(); + avacurbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta(); + if((AMinute*2-frameleft)<TenSeconds) + { + if(tbrk>0.016&&(AMinute*2-frameleft)>TenSeconds/5) + { + tbrk=0; + snCircCreator(vector2d(400,300),144,(TColors)re.NextInt(0,7),true); + } + } + else + { + if(tbrk>0.5) + { + tbrk=0; + snCircCreator(vector2d(400,300),27,(TColors)re.NextInt(0,7),false); + } + } + switch (snexstep) + { + case 0: + if(avacurbrk>avabrk)snexstep=1,snextarg=playerpos; + break; + case 1: + snexTarg.TargGoto(snextarg); + if(GetDist(snexTarg.targpos,snextarg)<0.01) + { + snexstep=2; + avabrk=(frameleft/(double)(AMinute*2))*0.01666+0.01667; + avacurbrk=0; + snexcnt=40-(frameleft/(double)(AMinute*2))*20; + } + break; + case 2: + if(avacurbrk>avabrk) + { + if(--snexcnt>0) + { + avacurbrk=0; + for(int i=0;i<10;++i) + bullet[CreateBullet2(snexTarg.targpos.x,snexTarg.targpos.y,2,re.NextDouble(-pi,pi),true)].addblend=true; + } + else snexstep=0,avabrk=(frameleft/(double)(AMinute*2))*1+1.5f,avacurbrk=0; + } + break; + } +} +yellowGroup fyg[100]; +//Spinner fygs; +void Levelm1Part17() +{ + frameleft=AMinute+ThirtySeconds;clrtime=2; + All2pnt();towcnt=0;memset(fyg,0,sizeof(fyg)); + ++part;avabrk=1;avacurbrk=0.5;//fygs.Init(3,20); +} +void Levelm1Part18() +{ + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + avacurbrk=0; + for(int i=0;i<100;++i) + if(!fyg[i].isActive()) + { + if(frameleft>AMinute) + fyg[i].Init(12,2.5-1.5*(frameleft/(double)(AMinute+ThirtySeconds))); + else + fyg[i].Init(36,2.5-1.5*(frameleft/(double)(AMinute+ThirtySeconds))); + break; + } + CircCreator(vector2d(400,300),36,blue); + } + for(int i=0;i<100;++i)if(fyg[i].isActive())fyg[i].Update(); + //fygs.Update(pi/7200*(0.5+frameleft/(double)(AMinute+ThirtySeconds))); +} +int m17lead[4]; +void Levelm1Part19() +{ + frameleft=AMinute+ThirtySeconds;towcnt=0;clrtime=1; + All2pnt();memset(m17lead,0,sizeof(m17lead)); + ++part;avabrk=0; + m17lead[0]=CreateBullet2(10,10,4,0);bullet[m17lead[0]].redir(vector2d(780,10));bullet[m17lead[0]].alterColor=red; + m17lead[1]=CreateBullet2(780,10,4,0);bullet[m17lead[1]].redir(vector2d(780,580));bullet[m17lead[1]].alterColor=green; + m17lead[2]=CreateBullet2(780,580,4,0);bullet[m17lead[2]].redir(vector2d(10,580));bullet[m17lead[2]].alterColor=dblue; + m17lead[3]=CreateBullet2(10,580,4,0);bullet[m17lead[3]].redir(vector2d(10,10));bullet[m17lead[3]].alterColor=white; + for(int i=0;i<4;++i)bullet[m17lead[i]].inv=true;snexTarg.Init(0.001,vector2d(400,300)); + snexstep=0;snexTarg.TargShow();avabrk=5.0f;avacurbrk=0;tbrk=0; +} +void Levelm1Part20() +{ + snexTarg.TargRender();avacurbrk+=hge->Timer_GetDelta(); + tbrk+=hge->Timer_GetDelta();avabrk+=hge->Timer_GetDelta(); + if(avabrk>10)NewMultpo(),avabrk=0; + switch (snexstep) + { + case 0: + if(avacurbrk>avabrk)snexstep=1,snextarg=playerpos; + break; + case 1: + snexTarg.TargGoto(snextarg); + if(GetDist(snexTarg.targpos,snextarg)<0.01) + { + snexstep=0; + avabrk=(frameleft/(double)(AMinute*2))*3+2; + avacurbrk=0; + } + break; + } + if(bullet[m17lead[0]].bulletpos.x>780.01f)bullet[m17lead[0]].bulletpos=vector2d(780,10),bullet[m17lead[0]].redir(vector2d(780,580)); + if(bullet[m17lead[0]].bulletpos.y>580.01f)bullet[m17lead[0]].bulletpos=vector2d(780,580),bullet[m17lead[0]].redir(vector2d(10,580)); + if(bullet[m17lead[0]].bulletpos.x<9.99f)bullet[m17lead[0]].bulletpos=vector2d(10,580),bullet[m17lead[0]].redir(vector2d(10,10)); + if(bullet[m17lead[0]].bulletpos.y<9.99f)bullet[m17lead[0]].bulletpos=vector2d(10,10),bullet[m17lead[0]].redir(vector2d(780,10)); + + if(bullet[m17lead[1]].bulletpos.x>780.01)bullet[m17lead[1]].bulletpos=vector2d(780,10),bullet[m17lead[1]].redir(vector2d(780,580)); + if(bullet[m17lead[1]].bulletpos.y>580.01f)bullet[m17lead[1]].bulletpos=vector2d(780,580),bullet[m17lead[1]].redir(vector2d(10,580)); + if(bullet[m17lead[1]].bulletpos.x<9.99f)bullet[m17lead[1]].bulletpos=vector2d(10,580),bullet[m17lead[1]].redir(vector2d(10,10)); + if(bullet[m17lead[1]].bulletpos.y<9.99f)bullet[m17lead[1]].bulletpos=vector2d(10,10),bullet[m17lead[1]].redir(vector2d(780,10)); + + if(bullet[m17lead[2]].bulletpos.x>780.01f)bullet[m17lead[2]].bulletpos=vector2d(780,10),bullet[m17lead[2]].redir(vector2d(780,580)); + if(bullet[m17lead[2]].bulletpos.y>580.01f)bullet[m17lead[2]].bulletpos=vector2d(780,580),bullet[m17lead[2]].redir(vector2d(10,580)); + if(bullet[m17lead[2]].bulletpos.x<9.99f)bullet[m17lead[2]].bulletpos=vector2d(10,580),bullet[m17lead[2]].redir(vector2d(10,10)); + if(bullet[m17lead[2]].bulletpos.y<9.99f)bullet[m17lead[2]].bulletpos=vector2d(10,10),bullet[m17lead[2]].redir(vector2d(780,10)); + + if(bullet[m17lead[3]].bulletpos.x>780.01f)bullet[m17lead[3]].bulletpos=vector2d(780,10),bullet[m17lead[3]].redir(vector2d(780,580)); + if(bullet[m17lead[3]].bulletpos.y>580.01f)bullet[m17lead[3]].bulletpos=vector2d(780,580),bullet[m17lead[3]].redir(vector2d(10,580)); + if(bullet[m17lead[3]].bulletpos.x<9.99f)bullet[m17lead[3]].bulletpos=vector2d(10,580),bullet[m17lead[3]].redir(vector2d(10,10)); + if(bullet[m17lead[3]].bulletpos.y<9.99f)bullet[m17lead[3]].bulletpos=vector2d(10,10),bullet[m17lead[3]].redir(vector2d(780,10)); + if(tbrk>0.02+(frameleft/(double)(AMinute+ThirtySeconds))*0.08) + { + for(int i=0;i<4;++i) + { + int pnt=CreateBullet2(bullet[m17lead[i]].bulletpos.x,bullet[m17lead[i]].bulletpos.y,0,0,true); + bullet[pnt].redir(snexTarg.targpos); + bullet[pnt].bulletaccel=0.002;bullet[pnt].limv=3; + bullet[pnt].whirem=1500-(frameleft/(double)(AMinute+ThirtySeconds))*500; + bullet[pnt].alterColor=i==0?red:i==1?green:i==2?dblue:white; + } + tbrk=0; + } +} +void Levelm1Part21() +{ + //some part of this level is in towernbullet... + frameleft=AMinute*1.5;clrtime=1; + if (towcnt!=4&&towcnt!=0)return ClearAll(false); + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Zzz..."); + All2pnt(); + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + CreateTower8(30,10,1500,3,20,30,false); + CreateTower8(746,10,1500,3,20,30,false); + CreateTower8(30,556,1500,3,20,30,false); + CreateTower8(746,556,1500,3,20,30,false); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + IfCallLevel=false; + return; + } +} +void Levelm2Part0() +{ + frameleft=10;All2pnt();towcnt=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("\ +Level -2-Assessments\n\ +Welcome to assessment mode!\n\ +You won't step to the next level until\n\ +you have a collision.\n\ +Good luck and go for the highest score!\ +"); + } + if (Current_Position==1) + { + if((DBGColor=ColorTransfer(DBGColor,0xFF1B2065))!=0xFF1B2065) + DBGColor=ColorTransfer(DBGColor,0xFF1B2065),frameleft=10; + else{++part;IfShowTip=true;bulcnt=0;return;} + } +} +Tower* dbtows[200]; +double dbroll[10]; +void Levelm2Part1() +{ + frameleft=Infinity;tbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 1 - Directed bullet"); + return; + } + for(int i=0;i<5;++i) + { + dbroll[i]=-i*120-20; + for(int j=0;j<20;++j) + dbtows[i*20+j]=&tower[CreateTower1(j*40+10,dbroll[i],4000,4)]; + } + ++part; +} +void Levelm2Part2() +{ + frameleft=Infinity; + tbrk+=hge->Timer_GetDelta(); + for(int i=0;i<5;++i) + { + dbroll[i]+=0.05*(1000.0f/hge->Timer_GetFPS()); + if(dbroll[i]>600)dbroll[i]=-20; + for(int j=0;j<20;++j) + { + dbtows[i*20+j]->towerpos=vector2d(j*40+10,dbroll[i]); + if(tbrk>0.033&&dbtows[i*20+j]->towertimer>2000)dbtows[i*20+j]->towertimer-=2; + } + } + if(tbrk>0.033)tbrk=0; +} +void Levelm2Part3() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 2 - Random bullets"); + All2pnt(); + return; + } + if (towcnt!=1&&towcnt!=0)return ClearAll(false); + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + CreateTower2(400,300,999999999,0); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else + { + ++part;assetime=tbrk=0; + return; + } +} +int rcnt; +void Levelm2Part4() +{ + frameleft=Infinity; + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=0.5; + if(assetime>=5)tbrk=re.NextDouble(0.25,0.5); + if(assetime>=10)tbrk=re.NextDouble(0.1,0.2); + if(assetime>=20)tbrk=re.NextDouble(0.05,0.08); + if(assetime>=30)tbrk=re.NextDouble(0.02,0.035); + if(assetime>=60)tbrk=0.02;if(assetime>=90)tbrk=0.01; + if(assetime<90)rcnt=1;if(assetime>=90)rcnt=2; + if(assetime>=120)rcnt=4;if(assetime>=150)rcnt=8; + if(assetime>=180)rcnt=16; + double rspeed=re.NextDouble(0.5+3*assetime/180.0f,1+9*assetime/180.0f); + for(int i=0;i<rcnt;++i) + CreateBullet2(400,300,rspeed,re.NextDouble(-pi,pi)); + } +} + +expSpinner es; +void Levelm2Part5() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 3 - Constant patterns"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + ++part;avabrk=0;avacurbrk=0; + } +} +void Levelm2Part6() +{ + frameleft=Infinity; + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + avacurbrk=0; + avabrk=6-2*assetime/120.0f; + if(avabrk<3)avabrk=1; + es.Init(3+5*assetime/120.0f,10,re.NextInt(-pi,pi)); + } + if(es.isActive())es.Update(); +} + +BCircle asscircles[200]; +void Levelm2Part7() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 4 - Crossing 1"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + memset(asscircles,0,sizeof(asscircles)); + ++part;avabrk=0;avacurbrk=0; + } +} +void Levelm2Part8() +{ + frameleft=Infinity; + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + shots=1; + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7) + { + asscircles[i].Init(1,assetime/120.0f*0.00025,36,vector2d(250,300),blue);break; + } + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7) + { + asscircles[i].Init(1,-assetime/120.0f*0.00025,36,vector2d(550,300),blue);break; + } + avacurbrk=0; + avabrk=3-assetime/60; + if(avabrk<0.5)avabrk=0.5; + } + for(int i=0;i<200;++i) + { + if (asscircles[i].GetRange()>1e-7&&asscircles[i].GetRange()<800) + { + asscircles[i].SetRange(asscircles[i].GetRange()+(LOWFPS?17:1)*0.05); + asscircles[i].Update(); + } + } +} +void Levelm2Part9() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 5 - Crossing 2"); + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>1e-7&&asscircles[i].GetRange()<800) + asscircles[i].circ2pnt(); + return; + } + if(Current_Position==1) + { + memset(asscircles,0,sizeof(asscircles)); + ++part;avabrk=0;avacurbrk=0; + } +} +void Levelm2Part10() +{ + frameleft=Infinity; + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + shots=1; + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7) + { + asscircles[i].Init(1,0.0001,36+(24*assetime/120.0f),vector2d(400,300),blue);break; + } + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>800||asscircles[i].GetRange()<1e-7) + { + asscircles[i].Init(1,-0.0001,36+(24*assetime/120.0f),vector2d(400,300),blue);break; + } + avacurbrk=0; + avabrk=2-assetime/60; + if(avabrk<0.3)avabrk=0.3; + } + for(int i=0;i<200;++i) + { + if (asscircles[i].GetRange()>1e-7&&asscircles[i].GetRange()<800) + { + asscircles[i].SetRange(asscircles[i].GetRange()+(LOWFPS?17:1)*0.05); + asscircles[i].Update(); + } + } +} +double assrad; +SELineLaser trap[100]; +void Levelm2Part11() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 6 - Trappy"); + for(int i=0;i<200;++i) + if (asscircles[i].GetRange()>1e-7&&asscircles[i].GetRange()<800) + asscircles[i].circ2pnt(); + return; + } + if(Current_Position==1) + { + memset(asscircles,0,sizeof(asscircles)); + ++part;avabrk=0;avacurbrk=0;tbrk=0;memset(trap,0,sizeof(trap)); + } +} +void Levelm2Part12() +{ + frameleft=Infinity; + avacurbrk+=hge->Timer_GetDelta(); + for(int i=0;i<100;++i) + if(trap[i].isActive())trap[i].Update(); + if(avacurbrk>avabrk) + { + bool sh=re.NextInt(0,1); + for(int c=0;c<(assetime>30?(assetime-30)/30:1);++c,sh^=1) + for(int i=0;i<100;++i) + if(!trap[i].isActive()) + { + if(sh)trap[i].Init(re.NextInt(10,590),1); + else trap[i].Init(re.NextInt(10,790),0); + break; + } + avacurbrk=0; + if(assetime<60)avabrk=3-2*assetime/60.0f; + else avabrk=2.5-(assetime-60)/120.0f; + } +} +double asssrd1; +void Levelm2Part13() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 7 - Sine wave"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + ++part;tbrk=asssrd1=avacurbrk=0; + } +} +void Levelm2Part14() +{ + frameleft=Infinity; + tbrk+=hge->Timer_GetDelta(); + if(tbrk>0.075) + { + tbrk=0; + asssrd1+=pi/45; + //right + for(int i=0;i<5;++i) + CreateBullet2(810,120*(i+1)+120*sin(asssrd1),2,0,true); + //right2 + if(assetime>15) + { + for(int i=0;i<5;++i) + CreateBullet2(810,120*(i+1)+120*sin(asssrd1+pi/12),2,0,true); + } + //left + if(assetime>30) + { + for(int i=0;i<5;++i) + CreateBullet2(-10,120*(i+1)+120*sin(asssrd1),2,pi,true); + } + //left2 + if(assetime>45) + { + for(int i=0;i<5;++i) + CreateBullet2(-10,120*(i+1)+120*sin(asssrd1+pi/12),2,pi,true); + } + if(assetime>60) + { + avacurbrk-=hge->Timer_GetDelta(); + if(avacurbrk<0) + { + CreateBullet1(0,0,3,0);CreateBullet1(800,0,3,0); + CreateBullet1(0,600,3,0);CreateBullet1(800,600,3,0); + avacurbrk=0.5-0.3*(assetime-60.0f)/60.0f; + if(avacurbrk<0.1)avacurbrk=0.1; + } + } + } +} +int resvpos,rpbcnt; +double delx; +void Levelm2Part15() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 8 - Density test"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + ++part;tbrk=asssrd1=avacurbrk=0;resvpos=re.NextInt(0,49);rpbcnt=0; + } +} +void Levelm2Part16() +{ + frameleft=Infinity; + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=0.1-0.05*(assetime/120.0f);if(tbrk<0.05)tbrk=0.05; + if(re.NextInt(0,100)==37&&!rpbcnt) + { + rpbcnt=6;int oldrp=resvpos; + for(resvpos=re.NextInt(0,49);abs(resvpos-oldrp)>20||abs(resvpos-oldrp)<5;resvpos=re.NextInt(0,49)); + delx=re.NextDouble(300,650); + } + for(int i=0;i<50;++i) + { + if(abs(i-resvpos)>2) + { + int pnt=CreateBullet2(810,12*i,1+3*assetime/180.0f,0,true); + if(rpbcnt>0)bullet[pnt].limpos=vector2d(delx,12*i); + } + } + if(rpbcnt)--rpbcnt; + if(resvpos==0)resvpos+=re.NextInt(0,1); + else if(resvpos==49)resvpos+=re.NextInt(-1,0); + else resvpos+=re.NextInt(-1,1); + } +} +CPinBall pinballs[200]; +void Levelm2Part17() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 9 - Pinball"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + ++part;tbrk=0;memset(pinballs,0,sizeof(pinballs)); + } +} +void Levelm2Part18() +{ + frameleft=Infinity; + //Always clean up! + for(int i=0;i<200;++i)if(pinballs[i].Getlifetime()>5)pinballs[i].Kill(); + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=1.25-0.5*assetime/120.0f;if(tbrk<0.5)tbrk=0.5; + for(int i=0;i<200;++i) + if(pinballs[i].Getlifetime()==0) + { + int lay=4+4*assetime/120.0f;if(lay>8)lay=9; + lay=re.NextInt(3,lay); + vector2d pos; + while(1) + { + pos=vector2d(re.NextDouble(100,600),re.NextDouble(100,500)); + bool place=(GetDist(pos,playerpos)>=100); + for(int j=0;j<200;++j) + if(pinballs[j].Getlifetime()>0&&j!=i) + if(GetDist(pinballs[j].Position(),pos)<pinballs[j].Radius()+lay*10.0) + {place=false;break;} + if(place)break; + } + pinballs[i].Init(pos,lay); + break; + } + } + for(int i=0;i<200;++i) + if(pinballs[i].Getlifetime()>0) + { + vector2d pos=pinballs[i].Position(); + if(pos.x<pinballs[i].Radius()-5||pos.x>790-pinballs[i].Radius()) + pinballs[i].Delta().x=-pinballs[i].Delta().x,++pinballs[i].Getlifetime(),pinballs[i].UpdateDelta(); + if(pos.y<pinballs[i].Radius()-5||pos.y>590-pinballs[i].Radius()) + pinballs[i].Delta().y=-pinballs[i].Delta().y,++pinballs[i].Getlifetime(),pinballs[i].UpdateDelta(); + for(int j=i+1;j<200;++j) + if(pinballs[j].Getlifetime()>0&&pinballs[j].Getlifetime()<=5) + if(GetDist(pinballs[j].Position(),pinballs[i].Position())<pinballs[j].Radius()+pinballs[i].Radius()) + { + double sqrdis=sqr(GetDist(pinballs[j].Position(),pinballs[i].Position())); + vector2d colline(pinballs[j].Position().x-pinballs[i].Position().x, + pinballs[j].Position().y-pinballs[i].Position().y); + double vp=pinballs[i].Delta()|colline; + double wp=pinballs[j].Delta()|colline; + vector2d ddelta((wp-vp)*colline.x/sqrdis,(wp-vp)*colline.y/sqrdis); + pinballs[i].Delta().x+=ddelta.x;pinballs[i].Delta().y+=ddelta.y; + pinballs[j].Delta().x-=ddelta.x;pinballs[j].Delta().y-=ddelta.y; + //prevent them to stick together... + vector2d stkprv=0.05*(pinballs[j].Radius()/sqrt(sqrdis)-1)*colline; + pinballs[j].Position()=pinballs[j].Position()-stkprv; + pinballs[i].UpdateDelta();pinballs[j].UpdateDelta(); + } + pinballs[i].Update(); + } +} +void Levelm2Part19() +{ + frameleft=Infinity; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 10 - Road blocks"); + All2pnt(); + return; + } + if (towcnt!=0)return ClearAll(false); + if(Current_Position==1) + { + ++part;tbrk=0;memset(pinballs,0,sizeof(pinballs)); + } +} +void Levelm2Part20() +{ + frameleft=Infinity; + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=2-1*(assetime/120.0f);if(tbrk<0.75)tbrk=0.75; + delx=re.NextDouble(350,700); + resvpos=re.NextInt(0,49); + for(int i=0;i<50;++i) + { + int pnt=CreateBullet2(810,12*i,1+2*assetime/180.0f,0,true); + if(abs(i-resvpos)<=3)bullet[pnt].limpos=vector2d(delx,12*i); + } + } +} +void Levelm2Part21() +{ + frameleft=Infinity;Dis8ref=true;tbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 11 - Extreme speeds"); + All2pnt();towcnt=0; + return; + } + ++frameskips; + if (frameskips<10&&!LOWFPS)return; + frameskips=0; + for (int i=1;i<=33;++i)CreateTower8(i*24-12,12,500,6,20,30); + for (int i=1;i<=towcnt;++i) + if (tower[i].RendColor==0x80FFFFFF) + tower[i].RendColor=0x00FFFFFF; + for (int i=1;i<=towcnt;++i) + if ((tower[i].RendColor>>24)<=0x80) + tower[i].RendColor=tower[i].RendColor+0x01FFFFFF; + else{++part;return;} +} +void Levelm2Part22() +{ + frameleft=Infinity; + double nspd=6+4*assetime/120.0f;if(nspd>10)nspd=10; + for(int i=1;i<=33;++i)tower[i].bulletspeed=nspd; + tbrk-=hge->Timer_GetDelta(); + if (tbrk>0)return; + tbrk=3-2*(assetime/120.0f); + if(tbrk<0.5)tbrk=0.5; + for (int i=0;i<6;++i) + { + int p=CreateBullet2(playerpos.x+cos(i*pi/3.0f)*6,12+sin(i*pi/3.0f)*6,2,-pi/2); + bullet[p].alterColor=orange; + } +} +SimpLL SLL[200]; +void Levelm2Part23() +{ + frameleft=Infinity;Dis8ref=true;tbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Test 12 - Messed up"); + All2pnt();towcnt=0; + return; + } + if (towcnt!=0)return ClearAll(false); + ++part;tbrk=avacurbrk=avabrk=0;memset(SLL,0,sizeof(SLL)); +} +void Levelm2Part24() +{ + frameleft=Infinity; + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=3-2.5*(assetime/120.0f); + if(tbrk<0.5)tbrk=0.5; + /*int cnt=12+12*assetime/120.0f; + if(cnt>24)cnt=24; + for(int i=0;i<cnt;++i) + { + vector2d dir=vector2d(400-playerpos.x,300-playerpos.y); + dir.ToUnitCircle();dir=50*dir;dir.Rotate(i*2*pi/cnt); + int pnt=CreateBullet2(400+dir.x,300+dir.y,0,0,true); + bullet[pnt].limv=-2;bullet[pnt].bulletaccel=-0.001;bullet[pnt].whirem=500; + bullet[pnt].redir(vector2d(400,300)); + }*/ + } + avacurbrk+=hge->Timer_GetDelta(); + if(avacurbrk>avabrk) + { + avacurbrk=0;avabrk=4-3*assetime/120.0f;if(avabrk<0.5)avabrk=0.5; + vector2d a,b;int cnt=re.NextInt(5,10); + for (int i=0;i<cnt;++i) + { + if (re.NextInt(1,100)>=50) + { + if (re.NextInt(1,100)>=50)a=vector2d(re.NextDouble(10,790),610);else a=vector2d(re.NextDouble(10,790),-10); + } + else + { + if (re.NextInt(1,100)>=50)a=vector2d(-10,re.NextDouble(10,590));else a=vector2d(810,re.NextDouble(10,590)); + } + if (re.NextInt(1,100)>=50) + { + if (re.NextInt(1,100)>=50)b=vector2d(re.NextDouble(10,790),610);else b=vector2d(re.NextDouble(10,790),-10); + } + else + { + if (re.NextInt(1,100)>=50)b=vector2d(-10,re.NextDouble(10,590));else b=vector2d(810,re.NextDouble(10,590)); + } + for(int i=0;i<200;++i) + if(!SLL[i].active) + { + SLL[i].InitLine(a,b,0.1,SETA(ColorToDWORD(blue),0x80)); + SLL[i].active=true;SLL[i].stp=0;SLL[i].brk=0;SLL[i].EnableColl=false; + break; + } + } + } + for(int i=0;i<200;++i) + if(SLL[i].active) + { + SLL[i].Process(); + SLL[i].brk+=hge->Timer_GetDelta(); + if(SLL[i].stp==2) + if(SLL[i].brk>0.02) + { + SLL[i].SetWidth(SLL[i].GetWidth()-0.2); + if(SLL[i].GetWidth()<1)SLL[i].EnableColl=false; + if(SLL[i].GetWidth()<0.05)SLL[i].active=false; + SLL[i].brk=0; + } + if(SLL[i].stp==0) + if(SLL[i].brk>0.02) + { + SLL[i].SetWidth(SLL[i].GetWidth()+0.2); + if(SLL[i].GetWidth()>1)SLL[i].EnableColl=true; + if(SLL[i].GetWidth()>4)SLL[i].stp=1; + SLL[i].brk=0; + } + if(SLL[i].stp==1) + if(SLL[i].brk>5){SLL[i].brk=0;SLL[i].stp=2;} + } +} +void Levelm2Part25() +{ + frameleft=Infinity;Dis8ref=true;tbrk=0; + DisableAllTower=false; + if (IfShowTip) + { + IfShowTip=false; + FadeTip=false; + Current_Position=2; + ShowTip("Bonus test - Lunatic Lunar!"); + All2pnt();towcnt=0; + for(int i=0;i<200;++i)if(SLL[i].active)SLL[i].llsrtopnt(10); + return; + } + ++part;tbrk=0;memset(SLL,0,sizeof(SLL));avabrk=1; +} +void Levelm2Part26() +{ + frameleft=Infinity; + tbrk-=hge->Timer_GetDelta(); + if(tbrk<0) + { + tbrk=0.05; + int cnt=1; + if(!re.NextInt(0,19))avabrk=avabrk?0:1; + for(int i=0;i<cnt;++i) + { + if(avabrk) + { + int cc=assetime/120.0f*18+18; + vector2d centre(re.NextDouble(380,420),re.NextDouble(280,320)); + double rnd=atan2(playerpos.y-centre.y,playerpos.x-centre.x),spd=assetime/120.0f*4+6; + if(re.NextInt(0,3)) + rnd+=re.NextDouble(-assetime/120.0f*pi/24,assetime/120.0f*pi/24); + for(int i=0;i<cc;++i) + CreateBullet2(centre.x,centre.y,spd,i*2*pi/cc+rnd,false); + } + else + { + vector2d pos=vector2d(400+re.NextDouble(-20,20),300+re.NextDouble(-20,20)); + double spd=assetime/120.0f*4+6; + int cc=assetime/120.0f*18+18; + double rnd=atan2(playerpos.y-pos.y,playerpos.x-pos.x); + if(re.NextInt(0,3)) + rnd+=re.NextDouble(-assetime/120.0f*pi/24,assetime/120.0f*pi/24); + for(int i=0;i<cc;++i) + { + double dir=i*2*pi/cc+rnd,ran=re.NextDouble(-pi,pi); + for(int i=0;i<6;++i) + CreateBullet2(pos.x+6*sin(ran+i*(pi/3)),pos.y+6*cos(ran+i*(pi/3)),spd,dir,false); + CreateBullet2(pos.x,pos.y,spd,dir,false); + } + } + } + } +} diff --git a/archive/blr2/src/libcgh.h b/archive/blr2/src/libcgh.h new file mode 100644 index 0000000..324ba42 --- /dev/null +++ b/archive/blr2/src/libcgh.h @@ -0,0 +1,140 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Chrisoft Game Helper header +// Copyright Chrisoft 2014 +// libcgh version 0007 +// Last full compatible version 0007 +// ^Modify that when big change is made^ +#include <hge.h> +#include <hgefont.h> +#include <hgedistort.h> +#include <hgecolor.h> +#include <math.h> +#ifndef libcgh_H +#define libcgh_H +#define pi 3.1415926535 +#define sqr(x) ((x)*(x)) +//static const char* LIBCGH_H_FN="libcgh.h"; + +struct vector2d +{ + double x,y; + vector2d(double _x,double _y){x=_x;y=_y;} + vector2d(){x=y=0;} + double l(){return sqrt(sqr(x)+sqr(y));} + void ToUnitCircle(){double len=l();x/=len;y/=len;} + void Swap(){double t=x;x=y;y=t;} + void Rotate(double rad){double tx=x*cos(rad)+y*sin(rad),ty=y*cos(rad)-x*sin(rad);x=tx,y=ty;} + friend vector2d operator -(vector2d a,vector2d b) + { + return vector2d(a.x-b.x,a.y-b.y); + } + friend vector2d operator +(vector2d a,vector2d b) + { + return vector2d(a.x+b.x,a.y+b.y); + } + friend double operator |(vector2d a,vector2d b)//dot product + { + return a.x*b.x+a.y*b.y; + } + friend double operator *(vector2d a,vector2d b)//length of cross product + { + return a.x*b.y-b.x*a.y; + } + friend vector2d operator *(double a,vector2d b) + { + return vector2d(b.x*a,b.y*a); + } + friend double operator ^(vector2d a,vector2d b)//cosine of angle + { + return (a|b)/a.l()/b.l(); + } +}; +inline vector2d ToUnitCircle(vector2d input) +{ + vector2d res=input; + res.x=res.x/input.l(); + res.y=res.y/input.l(); + return res; +} +inline double GetDist(const vector2d a,const vector2d b) +{ + return sqrt(sqr(a.x-b.x)+sqr(a.y-b.y)); +} +inline double GetDistSeg(const vector2d a,const vector2d b,const vector2d c) +{ + double l2=GetDist(a,b)*GetDist(a,b); + if (l2==0.0)return GetDist(c,a); + double t=((c-a)|(b-a))/l2; + if (t<0)return GetDist(c,a); + else if (t>1)return GetDist(c,b); + vector2d projection=a+t*(b-a); + return GetDist(c,projection); +} +inline double normalizerad(double a) +{ + while (a<0)a+=2*pi; + while (a>2*pi)a-=2*pi; + return a; +} +struct TextureRect +{ + double x,y,w,h; + TextureRect(){} + TextureRect(double _x,double _y,double _w,double _h){x=_x,y=_y,w=_w,h=_h;} +}; +class RandomEngine +{ +private: + unsigned int cseed; +public: + void SetSeed(unsigned int seed); + int NextInt(int min,int max); + double NextDouble(double min,double max); +}; +class CircleIndicator +{ +private: + hgeDistortionMesh *circle; + double value,radius,thk; + DWORD ccolour; + bool gradient; + BYTE alpha; +public: + void Init(double _r,double _thk,BYTE _a,bool _gr,HTEXTURE _Texture,TextureRect _TR,DWORD _cc=0); + void SetAlpha(BYTE _alpha); + void SetValue(double _value); + void Render(double x,double y); +}; +class LinearProgresser +{ +private: + double a,b,val; + double Elapsed,Limit; +public: + void Init(double _a,double _b,double _Lim); + void Launch(); + void Update(double DT); + double GetA(); + double GetB(); + double GetValue(); + double GetPercentage(); + double GetDelta(); + double GetElapsed(); +}; +class HangUpText +{ +private: + hgeFont *TFont; + vector2d Position; + double Elapsed,Limit,dlim,delta; + BYTE alim,alpha; + char Text[255]; + LinearProgresser Progresser,Progalpha; + bool done; +public: + bool Active(); + void Init(const char *Font,const char *_Text,double _tlim,double _alim,double _dlim,DWORD _color=0x00FFFFFF); + void Launch(vector2d pos); + void Process(double DT); +}; +#endif diff --git a/archive/blr2/src/libcghEx.cpp b/archive/blr2/src/libcghEx.cpp new file mode 100644 index 0000000..a8fa698 --- /dev/null +++ b/archive/blr2/src/libcghEx.cpp @@ -0,0 +1,113 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Chrisoft Game Helper Extras implementations +// Copyright Chrisoft 2014 +#include "libcgh.h" +#include <cmath> +#include <cstring> +//static const char* LIBCGH_SRC_FN="libcghEx.cpp"; + +void RandomEngine::SetSeed(unsigned int seed){cseed=seed;} +int RandomEngine::NextInt(int min,int max) +{ + if (min>max){int t=min;min=max;max=t;} + cseed*=214013;cseed+=2531011; + return min+(cseed^cseed>>15)%(max-min+1); +} +double RandomEngine::NextDouble(double min,double max) +{ + if (min>max){double t=min;min=max;max=t;} + cseed*=214013;cseed+=2531011; + return min+(cseed>>16)*(1.0f/65535.0f)*(max-min); +} +void CircleIndicator::Init(double _r,double _thk,BYTE _a,bool _gr,HTEXTURE _Texture,TextureRect _TR,DWORD _cc) +{ + circle=new hgeDistortionMesh(1025,3); + circle->SetTexture(_Texture); + circle->SetTextureRect(_TR.x,_TR.y,_TR.w,_TR.h); + radius=_r;thk=_thk;gradient=_gr;alpha=_a; + if (_gr)ccolour=SETA(0x00FF0000,alpha);else ccolour=_cc; + for (int i=0;i<=1024;++i) + { + double tang,tx,ty; + tang=(double)i/1024.0f*pi*2-pi/2; + tx=-cos(tang)*radius;ty=sin(tang)*radius; + circle->SetDisplacement(i,2,tx,ty,HGEDISP_TOPLEFT); + tx*=thk;ty*=thk; + circle->SetDisplacement(i,1,tx,ty,HGEDISP_TOPLEFT); + tx*=thk;ty*=thk; + circle->SetDisplacement(i,0,tx,ty,HGEDISP_TOPLEFT); + } +} +void CircleIndicator::SetAlpha(BYTE _alpha){alpha=_alpha;} +void CircleIndicator::SetValue(double _value) +{ + value=_value; + for (int i=0;i<=1024;++i) + { + int tr=(int)((1.0f-value)*255); + int tg=(int)(value*255); + DWORD tcolour=ARGB(alpha,tr,tg,0); + hgeColorHSV *tc=new hgeColorHSV(tcolour); + if (tc->v<0.85)tc->v=0.85; + if (gradient)tcolour=SETA(tc->GetHWColor(),alpha);else tcolour=SETA(ccolour,alpha); + if ((double)i/1024.0f<=value) + { + circle->SetColor(i,0,tcolour); + circle->SetColor(i,1,SETA(0x00FFFFFF,alpha)); + circle->SetColor(i,2,tcolour); + } + else + { + circle->SetColor(i,0,0x00000000); + circle->SetColor(i,1,0x00000000); + circle->SetColor(i,2,0x00000000); + } + delete tc; + } +} +void CircleIndicator::Render(double x,double y){circle->Render(x,y);} + +void LinearProgresser::Init(double _a,double _b,double _Lim){a=_a,b=_b,Limit=_Lim;} +void LinearProgresser::Launch(){Elapsed=0;val=a;} +void LinearProgresser::Update(double DT){if (Elapsed+DT>=Limit)return (void)(val=b,Elapsed=Limit);Elapsed+=DT;val=(b-a)*(Elapsed/Limit)+a;} +double LinearProgresser::GetValue(){return val;} +double LinearProgresser::GetA(){return a;} +double LinearProgresser::GetB(){return b;} +double LinearProgresser::GetPercentage(){return (Elapsed/Limit);} +double LinearProgresser::GetDelta(){return val-a;} +double LinearProgresser::GetElapsed(){return Elapsed;} + +bool HangUpText::Active(){return TFont&&!done;} +void HangUpText::Init(const char *Font,const char *_Text,double _tlim,double _alim,double _dlim,DWORD _color) +{ + TFont=new hgeFont(Font); + TFont->SetScale(0.8); + strcpy(Text,_Text); + Limit=_tlim;alim=_alim;dlim=_dlim;TFont->SetColor(_color); + Progresser.Init(0,dlim,Limit);Progalpha.Init(0,255,Limit/2); +} +void HangUpText::Launch(vector2d pos) +{ + Position=pos;Elapsed=0;delta=0;Progresser.Launch();Progalpha.Launch();done=false; +} +void HangUpText::Process(double DT) +{ + Progresser.Update(DT); + Position.y-=delta; + delta=Progresser.GetDelta(); + Position.y+=delta; + if (Progresser.GetElapsed()>Limit/2&&Progalpha.GetA()<Progalpha.GetB()) + { + Progalpha.Init(255,0,Limit/2); + Progalpha.Launch(); + } + if (Progalpha.GetA()>Progalpha.GetB()&&Progresser.GetElapsed()>=Limit) + { + delete TFont;TFont=0; + return (void)(done=true); + } + Progalpha.Update(DT); + if(!TFont)return; + TFont->SetColor(SETA(TFont->GetColor(),Progalpha.GetValue())); + TFont->printf(Position.x,Position.y,HGETEXT_CENTER,Text); +} diff --git a/archive/blr2/src/loading.h b/archive/blr2/src/loading.h new file mode 100644 index 0000000..acf59aa --- /dev/null +++ b/archive/blr2/src/loading.h @@ -0,0 +1,384 @@ +unsigned char Loading[]= +{0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x60, +0x00,0x00,0x00,0x20,0x08,0x06,0x00,0x00,0x00,0xED,0xC0,0x7D,0x54,0x00,0x00,0x00,0x09,0x70,0x48, +0x59,0x73,0x00,0x00,0x0B,0x13,0x00,0x00,0x0B,0x13,0x01,0x00,0x9A,0x9C,0x18,0x00,0x00,0x0A,0x4D, +0x69,0x43,0x43,0x50,0x50,0x68,0x6F,0x74,0x6F,0x73,0x68,0x6F,0x70,0x20,0x49,0x43,0x43,0x20,0x70, +0x72,0x6F,0x66,0x69,0x6C,0x65,0x00,0x00,0x78,0xDA,0x9D,0x53,0x77,0x58,0x93,0xF7,0x16,0x3E,0xDF, +0xF7,0x65,0x0F,0x56,0x42,0xD8,0xF0,0xB1,0x97,0x6C,0x81,0x00,0x22,0x23,0xAC,0x08,0xC8,0x10,0x59, +0xA2,0x10,0x92,0x00,0x61,0x84,0x10,0x12,0x40,0xC5,0x85,0x88,0x0A,0x56,0x14,0x15,0x11,0x9C,0x48, +0x55,0xC4,0x82,0xD5,0x0A,0x48,0x9D,0x88,0xE2,0xA0,0x28,0xB8,0x67,0x41,0x8A,0x88,0x5A,0x8B,0x55, +0x5C,0x38,0xEE,0x1F,0xDC,0xA7,0xB5,0x7D,0x7A,0xEF,0xED,0xED,0xFB,0xD7,0xFB,0xBC,0xE7,0x9C,0xE7, +0xFC,0xCE,0x79,0xCF,0x0F,0x80,0x11,0x12,0x26,0x91,0xE6,0xA2,0x6A,0x00,0x39,0x52,0x85,0x3C,0x3A, +0xD8,0x1F,0x8F,0x4F,0x48,0xC4,0xC9,0xBD,0x80,0x02,0x15,0x48,0xE0,0x04,0x20,0x10,0xE6,0xCB,0xC2, +0x67,0x05,0xC5,0x00,0x00,0xF0,0x03,0x79,0x78,0x7E,0x74,0xB0,0x3F,0xFC,0x01,0xAF,0x6F,0x00,0x02, +0x00,0x70,0xD5,0x2E,0x24,0x12,0xC7,0xE1,0xFF,0x83,0xBA,0x50,0x26,0x57,0x00,0x20,0x91,0x00,0xE0, +0x22,0x12,0xE7,0x0B,0x01,0x90,0x52,0x00,0xC8,0x2E,0x54,0xC8,0x14,0x00,0xC8,0x18,0x00,0xB0,0x53, +0xB3,0x64,0x0A,0x00,0x94,0x00,0x00,0x6C,0x79,0x7C,0x42,0x22,0x00,0xAA,0x0D,0x00,0xEC,0xF4,0x49, +0x3E,0x05,0x00,0xD8,0xA9,0x93,0xDC,0x17,0x00,0xD8,0xA2,0x1C,0xA9,0x08,0x00,0x8D,0x01,0x00,0x99, +0x28,0x47,0x24,0x02,0x40,0xBB,0x00,0x60,0x55,0x81,0x52,0x2C,0x02,0xC0,0xC2,0x00,0xA0,0xAC,0x40, +0x22,0x2E,0x04,0xC0,0xAE,0x01,0x80,0x59,0xB6,0x32,0x47,0x02,0x80,0xBD,0x05,0x00,0x76,0x8E,0x58, +0x90,0x0F,0x40,0x60,0x00,0x80,0x99,0x42,0x2C,0xCC,0x00,0x20,0x38,0x02,0x00,0x43,0x1E,0x13,0xCD, +0x03,0x20,0x4C,0x03,0xA0,0x30,0xD2,0xBF,0xE0,0xA9,0x5F,0x70,0x85,0xB8,0x48,0x01,0x00,0xC0,0xCB, +0x95,0xCD,0x97,0x4B,0xD2,0x33,0x14,0xB8,0x95,0xD0,0x1A,0x77,0xF2,0xF0,0xE0,0xE2,0x21,0xE2,0xC2, +0x6C,0xB1,0x42,0x61,0x17,0x29,0x10,0x66,0x09,0xE4,0x22,0x9C,0x97,0x9B,0x23,0x13,0x48,0xE7,0x03, +0x4C,0xCE,0x0C,0x00,0x00,0x1A,0xF9,0xD1,0xC1,0xFE,0x38,0x3F,0x90,0xE7,0xE6,0xE4,0xE1,0xE6,0x66, +0xE7,0x6C,0xEF,0xF4,0xC5,0xA2,0xFE,0x6B,0xF0,0x6F,0x22,0x3E,0x21,0xF1,0xDF,0xFE,0xBC,0x8C,0x02, +0x04,0x00,0x10,0x4E,0xCF,0xEF,0xDA,0x5F,0xE5,0xE5,0xD6,0x03,0x70,0xC7,0x01,0xB0,0x75,0xBF,0x6B, +0xA9,0x5B,0x00,0xDA,0x56,0x00,0x68,0xDF,0xF9,0x5D,0x33,0xDB,0x09,0xA0,0x5A,0x0A,0xD0,0x7A,0xF9, +0x8B,0x79,0x38,0xFC,0x40,0x1E,0x9E,0xA1,0x50,0xC8,0x3C,0x1D,0x1C,0x0A,0x0B,0x0B,0xED,0x25,0x62, +0xA1,0xBD,0x30,0xE3,0x8B,0x3E,0xFF,0x33,0xE1,0x6F,0xE0,0x8B,0x7E,0xF6,0xFC,0x40,0x1E,0xFE,0xDB, +0x7A,0xF0,0x00,0x71,0x9A,0x40,0x99,0xAD,0xC0,0xA3,0x83,0xFD,0x71,0x61,0x6E,0x76,0xAE,0x52,0x8E, +0xE7,0xCB,0x04,0x42,0x31,0x6E,0xF7,0xE7,0x23,0xFE,0xC7,0x85,0x7F,0xFD,0x8E,0x29,0xD1,0xE2,0x34, +0xB1,0x5C,0x2C,0x15,0x8A,0xF1,0x58,0x89,0xB8,0x50,0x22,0x4D,0xC7,0x79,0xB9,0x52,0x91,0x44,0x21, +0xC9,0x95,0xE2,0x12,0xE9,0x7F,0x32,0xF1,0x1F,0x96,0xFD,0x09,0x93,0x77,0x0D,0x00,0xAC,0x86,0x4F, +0xC0,0x4E,0xB6,0x07,0xB5,0xCB,0x6C,0xC0,0x7E,0xEE,0x01,0x02,0x8B,0x0E,0x58,0xD2,0x76,0x00,0x40, +0x7E,0xF3,0x2D,0x8C,0x1A,0x0B,0x91,0x00,0x10,0x67,0x34,0x32,0x79,0xF7,0x00,0x00,0x93,0xBF,0xF9, +0x8F,0x40,0x2B,0x01,0x00,0xCD,0x97,0xA4,0xE3,0x00,0x00,0xBC,0xE8,0x18,0x5C,0xA8,0x94,0x17,0x4C, +0xC6,0x08,0x00,0x00,0x44,0xA0,0x81,0x2A,0xB0,0x41,0x07,0x0C,0xC1,0x14,0xAC,0xC0,0x0E,0x9C,0xC1, +0x1D,0xBC,0xC0,0x17,0x02,0x61,0x06,0x44,0x40,0x0C,0x24,0xC0,0x3C,0x10,0x42,0x06,0xE4,0x80,0x1C, +0x0A,0xA1,0x18,0x96,0x41,0x19,0x54,0xC0,0x3A,0xD8,0x04,0xB5,0xB0,0x03,0x1A,0xA0,0x11,0x9A,0xE1, +0x10,0xB4,0xC1,0x31,0x38,0x0D,0xE7,0xE0,0x12,0x5C,0x81,0xEB,0x70,0x17,0x06,0x60,0x18,0x9E,0xC2, +0x18,0xBC,0x86,0x09,0x04,0x41,0xC8,0x08,0x13,0x61,0x21,0x3A,0x88,0x11,0x62,0x8E,0xD8,0x22,0xCE, +0x08,0x17,0x99,0x8E,0x04,0x22,0x61,0x48,0x34,0x92,0x80,0xA4,0x20,0xE9,0x88,0x14,0x51,0x22,0xC5, +0xC8,0x72,0xA4,0x02,0xA9,0x42,0x6A,0x91,0x5D,0x48,0x23,0xF2,0x2D,0x72,0x14,0x39,0x8D,0x5C,0x40, +0xFA,0x90,0xDB,0xC8,0x20,0x32,0x8A,0xFC,0x8A,0xBC,0x47,0x31,0x94,0x81,0xB2,0x51,0x03,0xD4,0x02, +0x75,0x40,0xB9,0xA8,0x1F,0x1A,0x8A,0xC6,0xA0,0x73,0xD1,0x74,0x34,0x0F,0x5D,0x80,0x96,0xA2,0x6B, +0xD1,0x1A,0xB4,0x1E,0x3D,0x80,0xB6,0xA2,0xA7,0xD1,0x4B,0xE8,0x75,0x74,0x00,0x7D,0x8A,0x8E,0x63, +0x80,0xD1,0x31,0x0E,0x66,0x8C,0xD9,0x61,0x5C,0x8C,0x87,0x45,0x60,0x89,0x58,0x1A,0x26,0xC7,0x16, +0x63,0xE5,0x58,0x35,0x56,0x8F,0x35,0x63,0x1D,0x58,0x37,0x76,0x15,0x1B,0xC0,0x9E,0x61,0xEF,0x08, +0x24,0x02,0x8B,0x80,0x13,0xEC,0x08,0x5E,0x84,0x10,0xC2,0x6C,0x82,0x90,0x90,0x47,0x58,0x4C,0x58, +0x43,0xA8,0x25,0xEC,0x23,0xB4,0x12,0xBA,0x08,0x57,0x09,0x83,0x84,0x31,0xC2,0x27,0x22,0x93,0xA8, +0x4F,0xB4,0x25,0x7A,0x12,0xF9,0xC4,0x78,0x62,0x3A,0xB1,0x90,0x58,0x46,0xAC,0x26,0xEE,0x21,0x1E, +0x21,0x9E,0x25,0x5E,0x27,0x0E,0x13,0x5F,0x93,0x48,0x24,0x0E,0xC9,0x92,0xE4,0x4E,0x0A,0x21,0x25, +0x90,0x32,0x49,0x0B,0x49,0x6B,0x48,0xDB,0x48,0x2D,0xA4,0x53,0xA4,0x3E,0xD2,0x10,0x69,0x9C,0x4C, +0x26,0xEB,0x90,0x6D,0xC9,0xDE,0xE4,0x08,0xB2,0x80,0xAC,0x20,0x97,0x91,0xB7,0x90,0x0F,0x90,0x4F, +0x92,0xFB,0xC9,0xC3,0xE4,0xB7,0x14,0x3A,0xC5,0x88,0xE2,0x4C,0x09,0xA2,0x24,0x52,0xA4,0x94,0x12, +0x4A,0x35,0x65,0x3F,0xE5,0x04,0xA5,0x9F,0x32,0x42,0x99,0xA0,0xAA,0x51,0xCD,0xA9,0x9E,0xD4,0x08, +0xAA,0x88,0x3A,0x9F,0x5A,0x49,0x6D,0xA0,0x76,0x50,0x2F,0x53,0x87,0xA9,0x13,0x34,0x75,0x9A,0x25, +0xCD,0x9B,0x16,0x43,0xCB,0xA4,0x2D,0xA3,0xD5,0xD0,0x9A,0x69,0x67,0x69,0xF7,0x68,0x2F,0xE9,0x74, +0xBA,0x09,0xDD,0x83,0x1E,0x45,0x97,0xD0,0x97,0xD2,0x6B,0xE8,0x07,0xE9,0xE7,0xE9,0x83,0xF4,0x77, +0x0C,0x0D,0x86,0x0D,0x83,0xC7,0x48,0x62,0x28,0x19,0x6B,0x19,0x7B,0x19,0xA7,0x18,0xB7,0x19,0x2F, +0x99,0x4C,0xA6,0x05,0xD3,0x97,0x99,0xC8,0x54,0x30,0xD7,0x32,0x1B,0x99,0x67,0x98,0x0F,0x98,0x6F, +0x55,0x58,0x2A,0xF6,0x2A,0x7C,0x15,0x91,0xCA,0x12,0x95,0x3A,0x95,0x56,0x95,0x7E,0x95,0xE7,0xAA, +0x54,0x55,0x73,0x55,0x3F,0xD5,0x79,0xAA,0x0B,0x54,0xAB,0x55,0x0F,0xAB,0x5E,0x56,0x7D,0xA6,0x46, +0x55,0xB3,0x50,0xE3,0xA9,0x09,0xD4,0x16,0xAB,0xD5,0xA9,0x1D,0x55,0xBB,0xA9,0x36,0xAE,0xCE,0x52, +0x77,0x52,0x8F,0x50,0xCF,0x51,0x5F,0xA3,0xBE,0x5F,0xFD,0x82,0xFA,0x63,0x0D,0xB2,0x86,0x85,0x46, +0xA0,0x86,0x48,0xA3,0x54,0x63,0xB7,0xC6,0x19,0x8D,0x21,0x16,0xC6,0x32,0x65,0xF1,0x58,0x42,0xD6, +0x72,0x56,0x03,0xEB,0x2C,0x6B,0x98,0x4D,0x62,0x5B,0xB2,0xF9,0xEC,0x4C,0x76,0x05,0xFB,0x1B,0x76, +0x2F,0x7B,0x4C,0x53,0x43,0x73,0xAA,0x66,0xAC,0x66,0x91,0x66,0x9D,0xE6,0x71,0xCD,0x01,0x0E,0xC6, +0xB1,0xE0,0xF0,0x39,0xD9,0x9C,0x4A,0xCE,0x21,0xCE,0x0D,0xCE,0x7B,0x2D,0x03,0x2D,0x3F,0x2D,0xB1, +0xD6,0x6A,0xAD,0x66,0xAD,0x7E,0xAD,0x37,0xDA,0x7A,0xDA,0xBE,0xDA,0x62,0xED,0x72,0xED,0x16,0xED, +0xEB,0xDA,0xEF,0x75,0x70,0x9D,0x40,0x9D,0x2C,0x9D,0xF5,0x3A,0x6D,0x3A,0xF7,0x75,0x09,0xBA,0x36, +0xBA,0x51,0xBA,0x85,0xBA,0xDB,0x75,0xCF,0xEA,0x3E,0xD3,0x63,0xEB,0x79,0xE9,0x09,0xF5,0xCA,0xF5, +0x0E,0xE9,0xDD,0xD1,0x47,0xF5,0x6D,0xF4,0xA3,0xF5,0x17,0xEA,0xEF,0xD6,0xEF,0xD1,0x1F,0x37,0x30, +0x34,0x08,0x36,0x90,0x19,0x6C,0x31,0x38,0x63,0xF0,0xCC,0x90,0x63,0xE8,0x6B,0x98,0x69,0xB8,0xD1, +0xF0,0x84,0xE1,0xA8,0x11,0xCB,0x68,0xBA,0x91,0xC4,0x68,0xA3,0xD1,0x49,0xA3,0x27,0xB8,0x26,0xEE, +0x87,0x67,0xE3,0x35,0x78,0x17,0x3E,0x66,0xAC,0x6F,0x1C,0x62,0xAC,0x34,0xDE,0x65,0xDC,0x6B,0x3C, +0x61,0x62,0x69,0x32,0xDB,0xA4,0xC4,0xA4,0xC5,0xE4,0xBE,0x29,0xCD,0x94,0x6B,0x9A,0x66,0xBA,0xD1, +0xB4,0xD3,0x74,0xCC,0xCC,0xC8,0x2C,0xDC,0xAC,0xD8,0xAC,0xC9,0xEC,0x8E,0x39,0xD5,0x9C,0x6B,0x9E, +0x61,0xBE,0xD9,0xBC,0xDB,0xFC,0x8D,0x85,0xA5,0x45,0x9C,0xC5,0x4A,0x8B,0x36,0x8B,0xC7,0x96,0xDA, +0x96,0x7C,0xCB,0x05,0x96,0x4D,0x96,0xF7,0xAC,0x98,0x56,0x3E,0x56,0x79,0x56,0xF5,0x56,0xD7,0xAC, +0x49,0xD6,0x5C,0xEB,0x2C,0xEB,0x6D,0xD6,0x57,0x6C,0x50,0x1B,0x57,0x9B,0x0C,0x9B,0x3A,0x9B,0xCB, +0xB6,0xA8,0xAD,0x9B,0xAD,0xC4,0x76,0x9B,0x6D,0xDF,0x14,0xE2,0x14,0x8F,0x29,0xD2,0x29,0xF5,0x53, +0x6E,0xDA,0x31,0xEC,0xFC,0xEC,0x0A,0xEC,0x9A,0xEC,0x06,0xED,0x39,0xF6,0x61,0xF6,0x25,0xF6,0x6D, +0xF6,0xCF,0x1D,0xCC,0x1C,0x12,0x1D,0xD6,0x3B,0x74,0x3B,0x7C,0x72,0x74,0x75,0xCC,0x76,0x6C,0x70, +0xBC,0xEB,0xA4,0xE1,0x34,0xC3,0xA9,0xC4,0xA9,0xC3,0xE9,0x57,0x67,0x1B,0x67,0xA1,0x73,0x9D,0xF3, +0x35,0x17,0xA6,0x4B,0x90,0xCB,0x12,0x97,0x76,0x97,0x17,0x53,0x6D,0xA7,0x8A,0xA7,0x6E,0x9F,0x7A, +0xCB,0x95,0xE5,0x1A,0xEE,0xBA,0xD2,0xB5,0xD3,0xF5,0xA3,0x9B,0xBB,0x9B,0xDC,0xAD,0xD9,0x6D,0xD4, +0xDD,0xCC,0x3D,0xC5,0x7D,0xAB,0xFB,0x4D,0x2E,0x9B,0x1B,0xC9,0x5D,0xC3,0x3D,0xEF,0x41,0xF4,0xF0, +0xF7,0x58,0xE2,0x71,0xCC,0xE3,0x9D,0xA7,0x9B,0xA7,0xC2,0xF3,0x90,0xE7,0x2F,0x5E,0x76,0x5E,0x59, +0x5E,0xFB,0xBD,0x1E,0x4F,0xB3,0x9C,0x26,0x9E,0xD6,0x30,0x6D,0xC8,0xDB,0xC4,0x5B,0xE0,0xBD,0xCB, +0x7B,0x60,0x3A,0x3E,0x3D,0x65,0xFA,0xCE,0xE9,0x03,0x3E,0xC6,0x3E,0x02,0x9F,0x7A,0x9F,0x87,0xBE, +0xA6,0xBE,0x22,0xDF,0x3D,0xBE,0x23,0x7E,0xD6,0x7E,0x99,0x7E,0x07,0xFC,0x9E,0xFB,0x3B,0xFA,0xCB, +0xFD,0x8F,0xF8,0xBF,0xE1,0x79,0xF2,0x16,0xF1,0x4E,0x05,0x60,0x01,0xC1,0x01,0xE5,0x01,0xBD,0x81, +0x1A,0x81,0xB3,0x03,0x6B,0x03,0x1F,0x04,0x99,0x04,0xA5,0x07,0x35,0x05,0x8D,0x05,0xBB,0x06,0x2F, +0x0C,0x3E,0x15,0x42,0x0C,0x09,0x0D,0x59,0x1F,0x72,0x93,0x6F,0xC0,0x17,0xF2,0x1B,0xF9,0x63,0x33, +0xDC,0x67,0x2C,0x9A,0xD1,0x15,0xCA,0x08,0x9D,0x15,0x5A,0x1B,0xFA,0x30,0xCC,0x26,0x4C,0x1E,0xD6, +0x11,0x8E,0x86,0xCF,0x08,0xDF,0x10,0x7E,0x6F,0xA6,0xF9,0x4C,0xE9,0xCC,0xB6,0x08,0x88,0xE0,0x47, +0x6C,0x88,0xB8,0x1F,0x69,0x19,0x99,0x17,0xF9,0x7D,0x14,0x29,0x2A,0x32,0xAA,0x2E,0xEA,0x51,0xB4, +0x53,0x74,0x71,0x74,0xF7,0x2C,0xD6,0xAC,0xE4,0x59,0xFB,0x67,0xBD,0x8E,0xF1,0x8F,0xA9,0x8C,0xB9, +0x3B,0xDB,0x6A,0xB6,0x72,0x76,0x67,0xAC,0x6A,0x6C,0x52,0x6C,0x63,0xEC,0x9B,0xB8,0x80,0xB8,0xAA, +0xB8,0x81,0x78,0x87,0xF8,0x45,0xF1,0x97,0x12,0x74,0x13,0x24,0x09,0xED,0x89,0xE4,0xC4,0xD8,0xC4, +0x3D,0x89,0xE3,0x73,0x02,0xE7,0x6C,0x9A,0x33,0x9C,0xE4,0x9A,0x54,0x96,0x74,0x63,0xAE,0xE5,0xDC, +0xA2,0xB9,0x17,0xE6,0xE9,0xCE,0xCB,0x9E,0x77,0x3C,0x59,0x35,0x59,0x90,0x7C,0x38,0x85,0x98,0x12, +0x97,0xB2,0x3F,0xE5,0x83,0x20,0x42,0x50,0x2F,0x18,0x4F,0xE5,0xA7,0x6E,0x4D,0x1D,0x13,0xF2,0x84, +0x9B,0x85,0x4F,0x45,0xBE,0xA2,0x8D,0xA2,0x51,0xB1,0xB7,0xB8,0x4A,0x3C,0x92,0xE6,0x9D,0x56,0x95, +0xF6,0x38,0xDD,0x3B,0x7D,0x43,0xFA,0x68,0x86,0x4F,0x46,0x75,0xC6,0x33,0x09,0x4F,0x52,0x2B,0x79, +0x91,0x19,0x92,0xB9,0x23,0xF3,0x4D,0x56,0x44,0xD6,0xDE,0xAC,0xCF,0xD9,0x71,0xD9,0x2D,0x39,0x94, +0x9C,0x94,0x9C,0xA3,0x52,0x0D,0x69,0x96,0xB4,0x2B,0xD7,0x30,0xB7,0x28,0xB7,0x4F,0x66,0x2B,0x2B, +0x93,0x0D,0xE4,0x79,0xE6,0x6D,0xCA,0x1B,0x93,0x87,0xCA,0xF7,0xE4,0x23,0xF9,0x73,0xF3,0xDB,0x15, +0x6C,0x85,0x4C,0xD1,0xA3,0xB4,0x52,0xAE,0x50,0x0E,0x16,0x4C,0x2F,0xA8,0x2B,0x78,0x5B,0x18,0x5B, +0x78,0xB8,0x48,0xBD,0x48,0x5A,0xD4,0x33,0xDF,0x66,0xFE,0xEA,0xF9,0x23,0x0B,0x82,0x16,0x7C,0xBD, +0x90,0xB0,0x50,0xB8,0xB0,0xB3,0xD8,0xB8,0x78,0x59,0xF1,0xE0,0x22,0xBF,0x45,0xBB,0x16,0x23,0x8B, +0x53,0x17,0x77,0x2E,0x31,0x5D,0x52,0xBA,0x64,0x78,0x69,0xF0,0xD2,0x7D,0xCB,0x68,0xCB,0xB2,0x96, +0xFD,0x50,0xE2,0x58,0x52,0x55,0xF2,0x6A,0x79,0xDC,0xF2,0x8E,0x52,0x83,0xD2,0xA5,0xA5,0x43,0x2B, +0x82,0x57,0x34,0x95,0xA9,0x94,0xC9,0xCB,0x6E,0xAE,0xF4,0x5A,0xB9,0x63,0x15,0x61,0x95,0x64,0x55, +0xEF,0x6A,0x97,0xD5,0x5B,0x56,0x7F,0x2A,0x17,0x95,0x5F,0xAC,0x70,0xAC,0xA8,0xAE,0xF8,0xB0,0x46, +0xB8,0xE6,0xE2,0x57,0x4E,0x5F,0xD5,0x7C,0xF5,0x79,0x6D,0xDA,0xDA,0xDE,0x4A,0xB7,0xCA,0xED,0xEB, +0x48,0xEB,0xA4,0xEB,0x6E,0xAC,0xF7,0x59,0xBF,0xAF,0x4A,0xBD,0x6A,0x41,0xD5,0xD0,0x86,0xF0,0x0D, +0xAD,0x1B,0xF1,0x8D,0xE5,0x1B,0x5F,0x6D,0x4A,0xDE,0x74,0xA1,0x7A,0x6A,0xF5,0x8E,0xCD,0xB4,0xCD, +0xCA,0xCD,0x03,0x35,0x61,0x35,0xED,0x5B,0xCC,0xB6,0xAC,0xDB,0xF2,0xA1,0x36,0xA3,0xF6,0x7A,0x9D, +0x7F,0x5D,0xCB,0x56,0xFD,0xAD,0xAB,0xB7,0xBE,0xD9,0x26,0xDA,0xD6,0xBF,0xDD,0x77,0x7B,0xF3,0x0E, +0x83,0x1D,0x15,0x3B,0xDE,0xEF,0x94,0xEC,0xBC,0xB5,0x2B,0x78,0x57,0x6B,0xBD,0x45,0x7D,0xF5,0x6E, +0xD2,0xEE,0x82,0xDD,0x8F,0x1A,0x62,0x1B,0xBA,0xBF,0xE6,0x7E,0xDD,0xB8,0x47,0x77,0x4F,0xC5,0x9E, +0x8F,0x7B,0xA5,0x7B,0x07,0xF6,0x45,0xEF,0xEB,0x6A,0x74,0x6F,0x6C,0xDC,0xAF,0xBF,0xBF,0xB2,0x09, +0x6D,0x52,0x36,0x8D,0x1E,0x48,0x3A,0x70,0xE5,0x9B,0x80,0x6F,0xDA,0x9B,0xED,0x9A,0x77,0xB5,0x70, +0x5A,0x2A,0x0E,0xC2,0x41,0xE5,0xC1,0x27,0xDF,0xA6,0x7C,0x7B,0xE3,0x50,0xE8,0xA1,0xCE,0xC3,0xDC, +0xC3,0xCD,0xDF,0x99,0x7F,0xB7,0xF5,0x08,0xEB,0x48,0x79,0x2B,0xD2,0x3A,0xBF,0x75,0xAC,0x2D,0xA3, +0x6D,0xA0,0x3D,0xA1,0xBD,0xEF,0xE8,0x8C,0xA3,0x9D,0x1D,0x5E,0x1D,0x47,0xBE,0xB7,0xFF,0x7E,0xEF, +0x31,0xE3,0x63,0x75,0xC7,0x35,0x8F,0x57,0x9E,0xA0,0x9D,0x28,0x3D,0xF1,0xF9,0xE4,0x82,0x93,0xE3, +0xA7,0x64,0xA7,0x9E,0x9D,0x4E,0x3F,0x3D,0xD4,0x99,0xDC,0x79,0xF7,0x4C,0xFC,0x99,0x6B,0x5D,0x51, +0x5D,0xBD,0x67,0x43,0xCF,0x9E,0x3F,0x17,0x74,0xEE,0x4C,0xB7,0x5F,0xF7,0xC9,0xF3,0xDE,0xE7,0x8F, +0x5D,0xF0,0xBC,0x70,0xF4,0x22,0xF7,0x62,0xDB,0x25,0xB7,0x4B,0xAD,0x3D,0xAE,0x3D,0x47,0x7E,0x70, +0xFD,0xE1,0x48,0xAF,0x5B,0x6F,0xEB,0x65,0xF7,0xCB,0xED,0x57,0x3C,0xAE,0x74,0xF4,0x4D,0xEB,0x3B, +0xD1,0xEF,0xD3,0x7F,0xFA,0x6A,0xC0,0xD5,0x73,0xD7,0xF8,0xD7,0x2E,0x5D,0x9F,0x79,0xBD,0xEF,0xC6, +0xEC,0x1B,0xB7,0x6E,0x26,0xDD,0x1C,0xB8,0x25,0xBA,0xF5,0xF8,0x76,0xF6,0xED,0x17,0x77,0x0A,0xEE, +0x4C,0xDC,0x5D,0x7A,0x8F,0x78,0xAF,0xFC,0xBE,0xDA,0xFD,0xEA,0x07,0xFA,0x0F,0xEA,0x7F,0xB4,0xFE, +0xB1,0x65,0xC0,0x6D,0xE0,0xF8,0x60,0xC0,0x60,0xCF,0xC3,0x59,0x0F,0xEF,0x0E,0x09,0x87,0x9E,0xFE, +0x94,0xFF,0xD3,0x87,0xE1,0xD2,0x47,0xCC,0x47,0xD5,0x23,0x46,0x23,0x8D,0x8F,0x9D,0x1F,0x1F,0x1B, +0x0D,0x1A,0xBD,0xF2,0x64,0xCE,0x93,0xE1,0xA7,0xB2,0xA7,0x13,0xCF,0xCA,0x7E,0x56,0xFF,0x79,0xEB, +0x73,0xAB,0xE7,0xDF,0xFD,0xE2,0xFB,0x4B,0xCF,0x58,0xFC,0xD8,0xF0,0x0B,0xF9,0x8B,0xCF,0xBF,0xAE, +0x79,0xA9,0xF3,0x72,0xEF,0xAB,0xA9,0xAF,0x3A,0xC7,0x23,0xC7,0x1F,0xBC,0xCE,0x79,0x3D,0xF1,0xA6, +0xFC,0xAD,0xCE,0xDB,0x7D,0xEF,0xB8,0xEF,0xBA,0xDF,0xC7,0xBD,0x1F,0x99,0x28,0xFC,0x40,0xFE,0x50, +0xF3,0xD1,0xFA,0x63,0xC7,0xA7,0xD0,0x4F,0xF7,0x3E,0xE7,0x7C,0xFE,0xFC,0x2F,0xF7,0x84,0xF3,0xFB, +0x25,0xD2,0x9F,0x33,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4D,0x00,0x00,0x7A,0x25,0x00,0x00,0x80, +0x83,0x00,0x00,0xF9,0xFF,0x00,0x00,0x80,0xE9,0x00,0x00,0x75,0x30,0x00,0x00,0xEA,0x60,0x00,0x00, +0x3A,0x98,0x00,0x00,0x17,0x6F,0x92,0x5F,0xC5,0x46,0x00,0x00,0x03,0x40,0x49,0x44,0x41,0x54,0x78, +0xDA,0xEC,0x5A,0xED,0x71,0xE2,0x40,0x0C,0x7D,0x64,0xEE,0x3F,0x7B,0x15,0x9C,0xAF,0x82,0x38,0x15, +0x9C,0xA9,0xE0,0xA0,0x82,0x90,0x0A,0xC2,0x55,0x00,0x54,0xC0,0xA5,0x02,0xE8,0xC0,0x50,0x81,0x49, +0x05,0x71,0x07,0xB8,0x03,0x7C,0x15,0xE8,0xFE,0x68,0x27,0x42,0xD1,0x62,0xC2,0x67,0x48,0xF6,0xCD, +0x78,0x6C,0xCB,0xFB,0xA1,0x5D,0xAD,0xA4,0xB7,0x0B,0x2D,0x22,0x42,0xC4,0xE5,0x70,0x13,0xA7,0x20, +0x1A,0x20,0x1A,0x20,0x22,0x1A,0x20,0x1A,0x20,0xE2,0x32,0xF8,0xC6,0x77,0x07,0x20,0xE5,0xE7,0x8A, +0xAF,0x6B,0x80,0xD7,0x3B,0x05,0x50,0x03,0x98,0x5D,0xAB,0x07,0xA4,0x00,0x0A,0xBE,0xEE,0xAF,0x48, +0x7F,0xAF,0xF7,0x44,0xE9,0xDD,0x07,0x30,0x60,0x03,0x5D,0x85,0x07,0x7C,0x26,0xF4,0x01,0x4C,0xF9, +0xF9,0x16,0xC0,0x43,0xCC,0x01,0xE7,0x0F,0x4B,0xD6,0x73,0xF4,0x80,0x33,0xE1,0x2F,0xDF,0xDB,0x00, +0x9E,0xBE,0x8A,0x01,0x64,0x12,0x5F,0x9E,0xA0,0xBC,0x47,0xC6,0xF7,0x92,0x93,0xAE,0x44,0x69,0x18, +0x61,0x57,0x3D,0x6A,0x55,0x7F,0x17,0x7D,0x53,0x96,0x2F,0x0F,0x9A,0x39,0x22,0x02,0x11,0x65,0xF4, +0x8A,0x21,0xCB,0x76,0xB9,0x52,0x22,0x2A,0xE8,0x2D,0xA6,0x44,0xE4,0x8C,0xF2,0x09,0x11,0xE5,0xAA, +0xEC,0x9A,0x88,0x06,0xFC,0x7D,0x25,0xEA,0xFB,0x3A,0x8E,0x88,0x26,0x46,0x1F,0xC3,0x80,0xDE,0x21, +0x59,0xC1,0x7D,0x65,0xDC,0xE6,0x54,0xB5,0xB7,0xE2,0xF1,0x40,0xF5,0x3D,0x35,0xF4,0xED,0xAA,0x71, +0x67,0xEF,0x98,0xB3,0x8D,0xEB,0x10,0x0F,0xF0,0x0C,0xC4,0x05,0x12,0x61,0x0A,0xA0,0x23,0x56,0x6A, +0x02,0xE0,0xC5,0x28,0xEF,0x98,0xC5,0xB4,0xB9,0x0C,0x14,0x0D,0x2E,0xC4,0xEA,0x93,0x18,0x35,0xAC, +0x5A,0xDD,0x87,0xF7,0x9E,0x47,0x7E,0xD6,0x7A,0x24,0x00,0x72,0x00,0x3F,0x85,0x2C,0x17,0xF5,0x64, +0x5B,0xF9,0xB1,0xA8,0xFA,0xCD,0x01,0x21,0x27,0xE7,0x7B,0xCD,0x4C,0xA3,0x05,0xE0,0x3B,0x4F,0x8C, +0x37,0xD0,0x54,0xD4,0x99,0x8A,0x41,0xCF,0x79,0xA0,0x2D,0x36,0x52,0x29,0xEA,0x49,0x0C,0xC5,0xE4, +0x97,0x5C,0xB6,0xC5,0x75,0xE7,0x01,0xC3,0x58,0x90,0xE1,0xAA,0xCB,0xEF,0x1D,0xD1,0xBF,0x5C,0x24, +0xA9,0x58,0x44,0x32,0xE4,0xDD,0x71,0xF9,0x3B,0x7E,0x4F,0x8E,0x12,0xBC,0xF7,0x0C,0x41,0x7D,0x51, +0xBE,0x6B,0x7C,0x97,0x21,0x23,0xE1,0x4B,0xBA,0xBA,0x15,0x9A,0xD6,0x86,0x4B,0xAF,0x55,0x3B,0xBA, +0xDE,0x6A,0xC7,0x10,0x04,0xD5,0xBF,0xDB,0xA2,0xAF,0xEF,0xBB,0xD8,0xD2,0x77,0xA2,0xC2,0xD2,0xDE, +0x21,0x68,0x5F,0x0F,0xF8,0x2D,0x42,0xC5,0xDC,0xF8,0xFE,0xA4,0x56,0x5C,0x57,0xBC,0x8F,0x8D,0xF2, +0x56,0x3B,0xA9,0xF0,0x98,0x59,0xC0,0xE5,0xC7,0x7B,0xE8,0x5E,0x19,0x09,0xBC,0x6E,0x48,0xF8,0x95, +0xD1,0x46,0xA9,0xDE,0xCF,0xCA,0x82,0x5C,0x43,0xC7,0x52,0xDE,0xDE,0xF2,0x6D,0x9B,0xDC,0xED,0x51, +0xE7,0x14,0xA8,0x77,0x90,0x57,0xE7,0xCE,0x01,0x4D,0x1B,0x1D,0xF7,0x01,0xEA,0x1C,0x8A,0x4A,0x78, +0x82,0xDB,0x92,0xD4,0x2F,0x92,0x84,0x17,0x22,0x4C,0x58,0x8A,0x3C,0xAA,0xB2,0xCF,0x81,0x6F,0x72, +0x40,0x7D,0x25,0x5B,0x2A,0x56,0x65,0x4D,0xF6,0x29,0xCF,0xAD,0x64,0x48,0x9C,0x88,0xFE,0x3D,0x6B, +0x3B,0xFB,0x51,0x84,0xB7,0x7A,0xC2,0x31,0xB9,0x16,0xCA,0x25,0x2A,0x76,0x0E,0xC4,0x24,0x96,0x7C, +0xAF,0x8C,0xEF,0x72,0x40,0x72,0x82,0x7F,0x89,0xD8,0xAF,0x59,0x97,0xC7,0x40,0xE5,0x96,0x63,0x63, +0x2C,0xC6,0xD8,0x07,0xB0,0x62,0x4A,0xBC,0x32,0x16,0x8B,0x64,0x7A,0x64,0xB0,0x3F,0x2D,0xDB,0xCA, +0x82,0x9A,0x30,0x34,0x98,0x10,0x31,0x6B,0x78,0x51,0x1B,0x96,0x54,0x6D,0xDA,0xF4,0xC6,0xA7,0x10, +0x4C,0x67,0x6D,0xF4,0xE1,0x94,0x7C,0xCD,0x75,0x56,0xA2,0x0D,0x52,0x9B,0xB7,0x26,0x16,0x54,0x18, +0x6C,0x64,0x18,0x60,0x34,0xA9,0xEA,0xC3,0x23,0x57,0x63,0xB5,0xE6,0x30,0x0B,0xC8,0x0E,0x66,0x41, +0xFF,0xC4,0xEA,0x7C,0x10,0xAB,0x24,0xC3,0xE6,0x6F,0x0A,0x1D,0xC5,0x14,0x4A,0x83,0x73,0xFB,0xF8, +0x3A,0x02,0xD0,0x0B,0x24,0x3A,0xD9,0x8E,0xF6,0xC2,0x3F,0x6A,0x23,0x75,0x6C,0x94,0xBC,0xE7,0xE8, +0xB1,0x8E,0x23,0xDE,0x07,0xF4,0x8C,0x5C,0x21,0xD9,0x55,0x8D,0xD7,0xDF,0x55,0xB4,0x6C,0x03,0x2D, +0xFE,0x5B,0x8A,0xDB,0x71,0x53,0x93,0x70,0x6C,0xAC,0x8D,0xD0,0x74,0xCB,0xEF,0xCF,0x0D,0xE7,0x23, +0x8E,0x43,0xC7,0x0F,0x36,0xE6,0x5C,0x85,0xA7,0x2A,0xC0,0x2A,0xBA,0xA2,0x8F,0x85,0x30,0x4A,0x26, +0x06,0x58,0x22,0xFC,0xE3,0x92,0x2E,0xA7,0xC7,0x95,0x18,0xE7,0x4C,0x43,0x96,0x2F,0x78,0x4C,0x35, +0xBF,0xDF,0x8B,0x8D,0xE3,0x4C,0x1C,0x79,0xA7,0x4C,0xD1,0xA5,0x7E,0x96,0xEC,0x8D,0x01,0x22,0x6C, +0xE4,0x0D,0x79,0xA6,0x66,0x8F,0xB8,0x18,0x0D,0xFD,0xEC,0x18,0x07,0x36,0x9A,0x9E,0x60,0x74,0x0E, +0xDD,0x8B,0x44,0x0F,0x78,0xFF,0x51,0x78,0xE8,0x38,0x3C,0x1A,0xE0,0x1A,0x11,0x43,0x50,0x34,0x40, +0x34,0x40,0x44,0x34,0xC0,0xD7,0xC5,0xFF,0x01,0x00,0xCC,0x01,0x97,0x8B,0x00,0x58,0xE9,0x5F,0x00, +0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE,0x42,0x60,0x82}; +unsigned char LoadCircle[]= +{0x89,0x50,0x4E,0x47,0x0D,0x0A,0x1A,0x0A,0x00,0x00,0x00,0x0D,0x49,0x48,0x44,0x52,0x00,0x00,0x00,0x30, +0x00,0x00,0x00,0x2E,0x08,0x06,0x00,0x00,0x00,0x6E,0xDE,0x9A,0x6C,0x00,0x00,0x00,0x09,0x70,0x48, +0x59,0x73,0x00,0x00,0x0B,0x13,0x00,0x00,0x0B,0x13,0x01,0x00,0x9A,0x9C,0x18,0x00,0x00,0x0A,0x4D, +0x69,0x43,0x43,0x50,0x50,0x68,0x6F,0x74,0x6F,0x73,0x68,0x6F,0x70,0x20,0x49,0x43,0x43,0x20,0x70, +0x72,0x6F,0x66,0x69,0x6C,0x65,0x00,0x00,0x78,0xDA,0x9D,0x53,0x77,0x58,0x93,0xF7,0x16,0x3E,0xDF, +0xF7,0x65,0x0F,0x56,0x42,0xD8,0xF0,0xB1,0x97,0x6C,0x81,0x00,0x22,0x23,0xAC,0x08,0xC8,0x10,0x59, +0xA2,0x10,0x92,0x00,0x61,0x84,0x10,0x12,0x40,0xC5,0x85,0x88,0x0A,0x56,0x14,0x15,0x11,0x9C,0x48, +0x55,0xC4,0x82,0xD5,0x0A,0x48,0x9D,0x88,0xE2,0xA0,0x28,0xB8,0x67,0x41,0x8A,0x88,0x5A,0x8B,0x55, +0x5C,0x38,0xEE,0x1F,0xDC,0xA7,0xB5,0x7D,0x7A,0xEF,0xED,0xED,0xFB,0xD7,0xFB,0xBC,0xE7,0x9C,0xE7, +0xFC,0xCE,0x79,0xCF,0x0F,0x80,0x11,0x12,0x26,0x91,0xE6,0xA2,0x6A,0x00,0x39,0x52,0x85,0x3C,0x3A, +0xD8,0x1F,0x8F,0x4F,0x48,0xC4,0xC9,0xBD,0x80,0x02,0x15,0x48,0xE0,0x04,0x20,0x10,0xE6,0xCB,0xC2, +0x67,0x05,0xC5,0x00,0x00,0xF0,0x03,0x79,0x78,0x7E,0x74,0xB0,0x3F,0xFC,0x01,0xAF,0x6F,0x00,0x02, +0x00,0x70,0xD5,0x2E,0x24,0x12,0xC7,0xE1,0xFF,0x83,0xBA,0x50,0x26,0x57,0x00,0x20,0x91,0x00,0xE0, +0x22,0x12,0xE7,0x0B,0x01,0x90,0x52,0x00,0xC8,0x2E,0x54,0xC8,0x14,0x00,0xC8,0x18,0x00,0xB0,0x53, +0xB3,0x64,0x0A,0x00,0x94,0x00,0x00,0x6C,0x79,0x7C,0x42,0x22,0x00,0xAA,0x0D,0x00,0xEC,0xF4,0x49, +0x3E,0x05,0x00,0xD8,0xA9,0x93,0xDC,0x17,0x00,0xD8,0xA2,0x1C,0xA9,0x08,0x00,0x8D,0x01,0x00,0x99, +0x28,0x47,0x24,0x02,0x40,0xBB,0x00,0x60,0x55,0x81,0x52,0x2C,0x02,0xC0,0xC2,0x00,0xA0,0xAC,0x40, +0x22,0x2E,0x04,0xC0,0xAE,0x01,0x80,0x59,0xB6,0x32,0x47,0x02,0x80,0xBD,0x05,0x00,0x76,0x8E,0x58, +0x90,0x0F,0x40,0x60,0x00,0x80,0x99,0x42,0x2C,0xCC,0x00,0x20,0x38,0x02,0x00,0x43,0x1E,0x13,0xCD, +0x03,0x20,0x4C,0x03,0xA0,0x30,0xD2,0xBF,0xE0,0xA9,0x5F,0x70,0x85,0xB8,0x48,0x01,0x00,0xC0,0xCB, +0x95,0xCD,0x97,0x4B,0xD2,0x33,0x14,0xB8,0x95,0xD0,0x1A,0x77,0xF2,0xF0,0xE0,0xE2,0x21,0xE2,0xC2, +0x6C,0xB1,0x42,0x61,0x17,0x29,0x10,0x66,0x09,0xE4,0x22,0x9C,0x97,0x9B,0x23,0x13,0x48,0xE7,0x03, +0x4C,0xCE,0x0C,0x00,0x00,0x1A,0xF9,0xD1,0xC1,0xFE,0x38,0x3F,0x90,0xE7,0xE6,0xE4,0xE1,0xE6,0x66, +0xE7,0x6C,0xEF,0xF4,0xC5,0xA2,0xFE,0x6B,0xF0,0x6F,0x22,0x3E,0x21,0xF1,0xDF,0xFE,0xBC,0x8C,0x02, +0x04,0x00,0x10,0x4E,0xCF,0xEF,0xDA,0x5F,0xE5,0xE5,0xD6,0x03,0x70,0xC7,0x01,0xB0,0x75,0xBF,0x6B, +0xA9,0x5B,0x00,0xDA,0x56,0x00,0x68,0xDF,0xF9,0x5D,0x33,0xDB,0x09,0xA0,0x5A,0x0A,0xD0,0x7A,0xF9, +0x8B,0x79,0x38,0xFC,0x40,0x1E,0x9E,0xA1,0x50,0xC8,0x3C,0x1D,0x1C,0x0A,0x0B,0x0B,0xED,0x25,0x62, +0xA1,0xBD,0x30,0xE3,0x8B,0x3E,0xFF,0x33,0xE1,0x6F,0xE0,0x8B,0x7E,0xF6,0xFC,0x40,0x1E,0xFE,0xDB, +0x7A,0xF0,0x00,0x71,0x9A,0x40,0x99,0xAD,0xC0,0xA3,0x83,0xFD,0x71,0x61,0x6E,0x76,0xAE,0x52,0x8E, +0xE7,0xCB,0x04,0x42,0x31,0x6E,0xF7,0xE7,0x23,0xFE,0xC7,0x85,0x7F,0xFD,0x8E,0x29,0xD1,0xE2,0x34, +0xB1,0x5C,0x2C,0x15,0x8A,0xF1,0x58,0x89,0xB8,0x50,0x22,0x4D,0xC7,0x79,0xB9,0x52,0x91,0x44,0x21, +0xC9,0x95,0xE2,0x12,0xE9,0x7F,0x32,0xF1,0x1F,0x96,0xFD,0x09,0x93,0x77,0x0D,0x00,0xAC,0x86,0x4F, +0xC0,0x4E,0xB6,0x07,0xB5,0xCB,0x6C,0xC0,0x7E,0xEE,0x01,0x02,0x8B,0x0E,0x58,0xD2,0x76,0x00,0x40, +0x7E,0xF3,0x2D,0x8C,0x1A,0x0B,0x91,0x00,0x10,0x67,0x34,0x32,0x79,0xF7,0x00,0x00,0x93,0xBF,0xF9, +0x8F,0x40,0x2B,0x01,0x00,0xCD,0x97,0xA4,0xE3,0x00,0x00,0xBC,0xE8,0x18,0x5C,0xA8,0x94,0x17,0x4C, +0xC6,0x08,0x00,0x00,0x44,0xA0,0x81,0x2A,0xB0,0x41,0x07,0x0C,0xC1,0x14,0xAC,0xC0,0x0E,0x9C,0xC1, +0x1D,0xBC,0xC0,0x17,0x02,0x61,0x06,0x44,0x40,0x0C,0x24,0xC0,0x3C,0x10,0x42,0x06,0xE4,0x80,0x1C, +0x0A,0xA1,0x18,0x96,0x41,0x19,0x54,0xC0,0x3A,0xD8,0x04,0xB5,0xB0,0x03,0x1A,0xA0,0x11,0x9A,0xE1, +0x10,0xB4,0xC1,0x31,0x38,0x0D,0xE7,0xE0,0x12,0x5C,0x81,0xEB,0x70,0x17,0x06,0x60,0x18,0x9E,0xC2, +0x18,0xBC,0x86,0x09,0x04,0x41,0xC8,0x08,0x13,0x61,0x21,0x3A,0x88,0x11,0x62,0x8E,0xD8,0x22,0xCE, +0x08,0x17,0x99,0x8E,0x04,0x22,0x61,0x48,0x34,0x92,0x80,0xA4,0x20,0xE9,0x88,0x14,0x51,0x22,0xC5, +0xC8,0x72,0xA4,0x02,0xA9,0x42,0x6A,0x91,0x5D,0x48,0x23,0xF2,0x2D,0x72,0x14,0x39,0x8D,0x5C,0x40, +0xFA,0x90,0xDB,0xC8,0x20,0x32,0x8A,0xFC,0x8A,0xBC,0x47,0x31,0x94,0x81,0xB2,0x51,0x03,0xD4,0x02, +0x75,0x40,0xB9,0xA8,0x1F,0x1A,0x8A,0xC6,0xA0,0x73,0xD1,0x74,0x34,0x0F,0x5D,0x80,0x96,0xA2,0x6B, +0xD1,0x1A,0xB4,0x1E,0x3D,0x80,0xB6,0xA2,0xA7,0xD1,0x4B,0xE8,0x75,0x74,0x00,0x7D,0x8A,0x8E,0x63, +0x80,0xD1,0x31,0x0E,0x66,0x8C,0xD9,0x61,0x5C,0x8C,0x87,0x45,0x60,0x89,0x58,0x1A,0x26,0xC7,0x16, +0x63,0xE5,0x58,0x35,0x56,0x8F,0x35,0x63,0x1D,0x58,0x37,0x76,0x15,0x1B,0xC0,0x9E,0x61,0xEF,0x08, +0x24,0x02,0x8B,0x80,0x13,0xEC,0x08,0x5E,0x84,0x10,0xC2,0x6C,0x82,0x90,0x90,0x47,0x58,0x4C,0x58, +0x43,0xA8,0x25,0xEC,0x23,0xB4,0x12,0xBA,0x08,0x57,0x09,0x83,0x84,0x31,0xC2,0x27,0x22,0x93,0xA8, +0x4F,0xB4,0x25,0x7A,0x12,0xF9,0xC4,0x78,0x62,0x3A,0xB1,0x90,0x58,0x46,0xAC,0x26,0xEE,0x21,0x1E, +0x21,0x9E,0x25,0x5E,0x27,0x0E,0x13,0x5F,0x93,0x48,0x24,0x0E,0xC9,0x92,0xE4,0x4E,0x0A,0x21,0x25, +0x90,0x32,0x49,0x0B,0x49,0x6B,0x48,0xDB,0x48,0x2D,0xA4,0x53,0xA4,0x3E,0xD2,0x10,0x69,0x9C,0x4C, +0x26,0xEB,0x90,0x6D,0xC9,0xDE,0xE4,0x08,0xB2,0x80,0xAC,0x20,0x97,0x91,0xB7,0x90,0x0F,0x90,0x4F, +0x92,0xFB,0xC9,0xC3,0xE4,0xB7,0x14,0x3A,0xC5,0x88,0xE2,0x4C,0x09,0xA2,0x24,0x52,0xA4,0x94,0x12, +0x4A,0x35,0x65,0x3F,0xE5,0x04,0xA5,0x9F,0x32,0x42,0x99,0xA0,0xAA,0x51,0xCD,0xA9,0x9E,0xD4,0x08, +0xAA,0x88,0x3A,0x9F,0x5A,0x49,0x6D,0xA0,0x76,0x50,0x2F,0x53,0x87,0xA9,0x13,0x34,0x75,0x9A,0x25, +0xCD,0x9B,0x16,0x43,0xCB,0xA4,0x2D,0xA3,0xD5,0xD0,0x9A,0x69,0x67,0x69,0xF7,0x68,0x2F,0xE9,0x74, +0xBA,0x09,0xDD,0x83,0x1E,0x45,0x97,0xD0,0x97,0xD2,0x6B,0xE8,0x07,0xE9,0xE7,0xE9,0x83,0xF4,0x77, +0x0C,0x0D,0x86,0x0D,0x83,0xC7,0x48,0x62,0x28,0x19,0x6B,0x19,0x7B,0x19,0xA7,0x18,0xB7,0x19,0x2F, +0x99,0x4C,0xA6,0x05,0xD3,0x97,0x99,0xC8,0x54,0x30,0xD7,0x32,0x1B,0x99,0x67,0x98,0x0F,0x98,0x6F, +0x55,0x58,0x2A,0xF6,0x2A,0x7C,0x15,0x91,0xCA,0x12,0x95,0x3A,0x95,0x56,0x95,0x7E,0x95,0xE7,0xAA, +0x54,0x55,0x73,0x55,0x3F,0xD5,0x79,0xAA,0x0B,0x54,0xAB,0x55,0x0F,0xAB,0x5E,0x56,0x7D,0xA6,0x46, +0x55,0xB3,0x50,0xE3,0xA9,0x09,0xD4,0x16,0xAB,0xD5,0xA9,0x1D,0x55,0xBB,0xA9,0x36,0xAE,0xCE,0x52, +0x77,0x52,0x8F,0x50,0xCF,0x51,0x5F,0xA3,0xBE,0x5F,0xFD,0x82,0xFA,0x63,0x0D,0xB2,0x86,0x85,0x46, +0xA0,0x86,0x48,0xA3,0x54,0x63,0xB7,0xC6,0x19,0x8D,0x21,0x16,0xC6,0x32,0x65,0xF1,0x58,0x42,0xD6, +0x72,0x56,0x03,0xEB,0x2C,0x6B,0x98,0x4D,0x62,0x5B,0xB2,0xF9,0xEC,0x4C,0x76,0x05,0xFB,0x1B,0x76, +0x2F,0x7B,0x4C,0x53,0x43,0x73,0xAA,0x66,0xAC,0x66,0x91,0x66,0x9D,0xE6,0x71,0xCD,0x01,0x0E,0xC6, +0xB1,0xE0,0xF0,0x39,0xD9,0x9C,0x4A,0xCE,0x21,0xCE,0x0D,0xCE,0x7B,0x2D,0x03,0x2D,0x3F,0x2D,0xB1, +0xD6,0x6A,0xAD,0x66,0xAD,0x7E,0xAD,0x37,0xDA,0x7A,0xDA,0xBE,0xDA,0x62,0xED,0x72,0xED,0x16,0xED, +0xEB,0xDA,0xEF,0x75,0x70,0x9D,0x40,0x9D,0x2C,0x9D,0xF5,0x3A,0x6D,0x3A,0xF7,0x75,0x09,0xBA,0x36, +0xBA,0x51,0xBA,0x85,0xBA,0xDB,0x75,0xCF,0xEA,0x3E,0xD3,0x63,0xEB,0x79,0xE9,0x09,0xF5,0xCA,0xF5, +0x0E,0xE9,0xDD,0xD1,0x47,0xF5,0x6D,0xF4,0xA3,0xF5,0x17,0xEA,0xEF,0xD6,0xEF,0xD1,0x1F,0x37,0x30, +0x34,0x08,0x36,0x90,0x19,0x6C,0x31,0x38,0x63,0xF0,0xCC,0x90,0x63,0xE8,0x6B,0x98,0x69,0xB8,0xD1, +0xF0,0x84,0xE1,0xA8,0x11,0xCB,0x68,0xBA,0x91,0xC4,0x68,0xA3,0xD1,0x49,0xA3,0x27,0xB8,0x26,0xEE, +0x87,0x67,0xE3,0x35,0x78,0x17,0x3E,0x66,0xAC,0x6F,0x1C,0x62,0xAC,0x34,0xDE,0x65,0xDC,0x6B,0x3C, +0x61,0x62,0x69,0x32,0xDB,0xA4,0xC4,0xA4,0xC5,0xE4,0xBE,0x29,0xCD,0x94,0x6B,0x9A,0x66,0xBA,0xD1, +0xB4,0xD3,0x74,0xCC,0xCC,0xC8,0x2C,0xDC,0xAC,0xD8,0xAC,0xC9,0xEC,0x8E,0x39,0xD5,0x9C,0x6B,0x9E, +0x61,0xBE,0xD9,0xBC,0xDB,0xFC,0x8D,0x85,0xA5,0x45,0x9C,0xC5,0x4A,0x8B,0x36,0x8B,0xC7,0x96,0xDA, +0x96,0x7C,0xCB,0x05,0x96,0x4D,0x96,0xF7,0xAC,0x98,0x56,0x3E,0x56,0x79,0x56,0xF5,0x56,0xD7,0xAC, +0x49,0xD6,0x5C,0xEB,0x2C,0xEB,0x6D,0xD6,0x57,0x6C,0x50,0x1B,0x57,0x9B,0x0C,0x9B,0x3A,0x9B,0xCB, +0xB6,0xA8,0xAD,0x9B,0xAD,0xC4,0x76,0x9B,0x6D,0xDF,0x14,0xE2,0x14,0x8F,0x29,0xD2,0x29,0xF5,0x53, +0x6E,0xDA,0x31,0xEC,0xFC,0xEC,0x0A,0xEC,0x9A,0xEC,0x06,0xED,0x39,0xF6,0x61,0xF6,0x25,0xF6,0x6D, +0xF6,0xCF,0x1D,0xCC,0x1C,0x12,0x1D,0xD6,0x3B,0x74,0x3B,0x7C,0x72,0x74,0x75,0xCC,0x76,0x6C,0x70, +0xBC,0xEB,0xA4,0xE1,0x34,0xC3,0xA9,0xC4,0xA9,0xC3,0xE9,0x57,0x67,0x1B,0x67,0xA1,0x73,0x9D,0xF3, +0x35,0x17,0xA6,0x4B,0x90,0xCB,0x12,0x97,0x76,0x97,0x17,0x53,0x6D,0xA7,0x8A,0xA7,0x6E,0x9F,0x7A, +0xCB,0x95,0xE5,0x1A,0xEE,0xBA,0xD2,0xB5,0xD3,0xF5,0xA3,0x9B,0xBB,0x9B,0xDC,0xAD,0xD9,0x6D,0xD4, +0xDD,0xCC,0x3D,0xC5,0x7D,0xAB,0xFB,0x4D,0x2E,0x9B,0x1B,0xC9,0x5D,0xC3,0x3D,0xEF,0x41,0xF4,0xF0, +0xF7,0x58,0xE2,0x71,0xCC,0xE3,0x9D,0xA7,0x9B,0xA7,0xC2,0xF3,0x90,0xE7,0x2F,0x5E,0x76,0x5E,0x59, +0x5E,0xFB,0xBD,0x1E,0x4F,0xB3,0x9C,0x26,0x9E,0xD6,0x30,0x6D,0xC8,0xDB,0xC4,0x5B,0xE0,0xBD,0xCB, +0x7B,0x60,0x3A,0x3E,0x3D,0x65,0xFA,0xCE,0xE9,0x03,0x3E,0xC6,0x3E,0x02,0x9F,0x7A,0x9F,0x87,0xBE, +0xA6,0xBE,0x22,0xDF,0x3D,0xBE,0x23,0x7E,0xD6,0x7E,0x99,0x7E,0x07,0xFC,0x9E,0xFB,0x3B,0xFA,0xCB, +0xFD,0x8F,0xF8,0xBF,0xE1,0x79,0xF2,0x16,0xF1,0x4E,0x05,0x60,0x01,0xC1,0x01,0xE5,0x01,0xBD,0x81, +0x1A,0x81,0xB3,0x03,0x6B,0x03,0x1F,0x04,0x99,0x04,0xA5,0x07,0x35,0x05,0x8D,0x05,0xBB,0x06,0x2F, +0x0C,0x3E,0x15,0x42,0x0C,0x09,0x0D,0x59,0x1F,0x72,0x93,0x6F,0xC0,0x17,0xF2,0x1B,0xF9,0x63,0x33, +0xDC,0x67,0x2C,0x9A,0xD1,0x15,0xCA,0x08,0x9D,0x15,0x5A,0x1B,0xFA,0x30,0xCC,0x26,0x4C,0x1E,0xD6, +0x11,0x8E,0x86,0xCF,0x08,0xDF,0x10,0x7E,0x6F,0xA6,0xF9,0x4C,0xE9,0xCC,0xB6,0x08,0x88,0xE0,0x47, +0x6C,0x88,0xB8,0x1F,0x69,0x19,0x99,0x17,0xF9,0x7D,0x14,0x29,0x2A,0x32,0xAA,0x2E,0xEA,0x51,0xB4, +0x53,0x74,0x71,0x74,0xF7,0x2C,0xD6,0xAC,0xE4,0x59,0xFB,0x67,0xBD,0x8E,0xF1,0x8F,0xA9,0x8C,0xB9, +0x3B,0xDB,0x6A,0xB6,0x72,0x76,0x67,0xAC,0x6A,0x6C,0x52,0x6C,0x63,0xEC,0x9B,0xB8,0x80,0xB8,0xAA, +0xB8,0x81,0x78,0x87,0xF8,0x45,0xF1,0x97,0x12,0x74,0x13,0x24,0x09,0xED,0x89,0xE4,0xC4,0xD8,0xC4, +0x3D,0x89,0xE3,0x73,0x02,0xE7,0x6C,0x9A,0x33,0x9C,0xE4,0x9A,0x54,0x96,0x74,0x63,0xAE,0xE5,0xDC, +0xA2,0xB9,0x17,0xE6,0xE9,0xCE,0xCB,0x9E,0x77,0x3C,0x59,0x35,0x59,0x90,0x7C,0x38,0x85,0x98,0x12, +0x97,0xB2,0x3F,0xE5,0x83,0x20,0x42,0x50,0x2F,0x18,0x4F,0xE5,0xA7,0x6E,0x4D,0x1D,0x13,0xF2,0x84, +0x9B,0x85,0x4F,0x45,0xBE,0xA2,0x8D,0xA2,0x51,0xB1,0xB7,0xB8,0x4A,0x3C,0x92,0xE6,0x9D,0x56,0x95, +0xF6,0x38,0xDD,0x3B,0x7D,0x43,0xFA,0x68,0x86,0x4F,0x46,0x75,0xC6,0x33,0x09,0x4F,0x52,0x2B,0x79, +0x91,0x19,0x92,0xB9,0x23,0xF3,0x4D,0x56,0x44,0xD6,0xDE,0xAC,0xCF,0xD9,0x71,0xD9,0x2D,0x39,0x94, +0x9C,0x94,0x9C,0xA3,0x52,0x0D,0x69,0x96,0xB4,0x2B,0xD7,0x30,0xB7,0x28,0xB7,0x4F,0x66,0x2B,0x2B, +0x93,0x0D,0xE4,0x79,0xE6,0x6D,0xCA,0x1B,0x93,0x87,0xCA,0xF7,0xE4,0x23,0xF9,0x73,0xF3,0xDB,0x15, +0x6C,0x85,0x4C,0xD1,0xA3,0xB4,0x52,0xAE,0x50,0x0E,0x16,0x4C,0x2F,0xA8,0x2B,0x78,0x5B,0x18,0x5B, +0x78,0xB8,0x48,0xBD,0x48,0x5A,0xD4,0x33,0xDF,0x66,0xFE,0xEA,0xF9,0x23,0x0B,0x82,0x16,0x7C,0xBD, +0x90,0xB0,0x50,0xB8,0xB0,0xB3,0xD8,0xB8,0x78,0x59,0xF1,0xE0,0x22,0xBF,0x45,0xBB,0x16,0x23,0x8B, +0x53,0x17,0x77,0x2E,0x31,0x5D,0x52,0xBA,0x64,0x78,0x69,0xF0,0xD2,0x7D,0xCB,0x68,0xCB,0xB2,0x96, +0xFD,0x50,0xE2,0x58,0x52,0x55,0xF2,0x6A,0x79,0xDC,0xF2,0x8E,0x52,0x83,0xD2,0xA5,0xA5,0x43,0x2B, +0x82,0x57,0x34,0x95,0xA9,0x94,0xC9,0xCB,0x6E,0xAE,0xF4,0x5A,0xB9,0x63,0x15,0x61,0x95,0x64,0x55, +0xEF,0x6A,0x97,0xD5,0x5B,0x56,0x7F,0x2A,0x17,0x95,0x5F,0xAC,0x70,0xAC,0xA8,0xAE,0xF8,0xB0,0x46, +0xB8,0xE6,0xE2,0x57,0x4E,0x5F,0xD5,0x7C,0xF5,0x79,0x6D,0xDA,0xDA,0xDE,0x4A,0xB7,0xCA,0xED,0xEB, +0x48,0xEB,0xA4,0xEB,0x6E,0xAC,0xF7,0x59,0xBF,0xAF,0x4A,0xBD,0x6A,0x41,0xD5,0xD0,0x86,0xF0,0x0D, +0xAD,0x1B,0xF1,0x8D,0xE5,0x1B,0x5F,0x6D,0x4A,0xDE,0x74,0xA1,0x7A,0x6A,0xF5,0x8E,0xCD,0xB4,0xCD, +0xCA,0xCD,0x03,0x35,0x61,0x35,0xED,0x5B,0xCC,0xB6,0xAC,0xDB,0xF2,0xA1,0x36,0xA3,0xF6,0x7A,0x9D, +0x7F,0x5D,0xCB,0x56,0xFD,0xAD,0xAB,0xB7,0xBE,0xD9,0x26,0xDA,0xD6,0xBF,0xDD,0x77,0x7B,0xF3,0x0E, +0x83,0x1D,0x15,0x3B,0xDE,0xEF,0x94,0xEC,0xBC,0xB5,0x2B,0x78,0x57,0x6B,0xBD,0x45,0x7D,0xF5,0x6E, +0xD2,0xEE,0x82,0xDD,0x8F,0x1A,0x62,0x1B,0xBA,0xBF,0xE6,0x7E,0xDD,0xB8,0x47,0x77,0x4F,0xC5,0x9E, +0x8F,0x7B,0xA5,0x7B,0x07,0xF6,0x45,0xEF,0xEB,0x6A,0x74,0x6F,0x6C,0xDC,0xAF,0xBF,0xBF,0xB2,0x09, +0x6D,0x52,0x36,0x8D,0x1E,0x48,0x3A,0x70,0xE5,0x9B,0x80,0x6F,0xDA,0x9B,0xED,0x9A,0x77,0xB5,0x70, +0x5A,0x2A,0x0E,0xC2,0x41,0xE5,0xC1,0x27,0xDF,0xA6,0x7C,0x7B,0xE3,0x50,0xE8,0xA1,0xCE,0xC3,0xDC, +0xC3,0xCD,0xDF,0x99,0x7F,0xB7,0xF5,0x08,0xEB,0x48,0x79,0x2B,0xD2,0x3A,0xBF,0x75,0xAC,0x2D,0xA3, +0x6D,0xA0,0x3D,0xA1,0xBD,0xEF,0xE8,0x8C,0xA3,0x9D,0x1D,0x5E,0x1D,0x47,0xBE,0xB7,0xFF,0x7E,0xEF, +0x31,0xE3,0x63,0x75,0xC7,0x35,0x8F,0x57,0x9E,0xA0,0x9D,0x28,0x3D,0xF1,0xF9,0xE4,0x82,0x93,0xE3, +0xA7,0x64,0xA7,0x9E,0x9D,0x4E,0x3F,0x3D,0xD4,0x99,0xDC,0x79,0xF7,0x4C,0xFC,0x99,0x6B,0x5D,0x51, +0x5D,0xBD,0x67,0x43,0xCF,0x9E,0x3F,0x17,0x74,0xEE,0x4C,0xB7,0x5F,0xF7,0xC9,0xF3,0xDE,0xE7,0x8F, +0x5D,0xF0,0xBC,0x70,0xF4,0x22,0xF7,0x62,0xDB,0x25,0xB7,0x4B,0xAD,0x3D,0xAE,0x3D,0x47,0x7E,0x70, +0xFD,0xE1,0x48,0xAF,0x5B,0x6F,0xEB,0x65,0xF7,0xCB,0xED,0x57,0x3C,0xAE,0x74,0xF4,0x4D,0xEB,0x3B, +0xD1,0xEF,0xD3,0x7F,0xFA,0x6A,0xC0,0xD5,0x73,0xD7,0xF8,0xD7,0x2E,0x5D,0x9F,0x79,0xBD,0xEF,0xC6, +0xEC,0x1B,0xB7,0x6E,0x26,0xDD,0x1C,0xB8,0x25,0xBA,0xF5,0xF8,0x76,0xF6,0xED,0x17,0x77,0x0A,0xEE, +0x4C,0xDC,0x5D,0x7A,0x8F,0x78,0xAF,0xFC,0xBE,0xDA,0xFD,0xEA,0x07,0xFA,0x0F,0xEA,0x7F,0xB4,0xFE, +0xB1,0x65,0xC0,0x6D,0xE0,0xF8,0x60,0xC0,0x60,0xCF,0xC3,0x59,0x0F,0xEF,0x0E,0x09,0x87,0x9E,0xFE, +0x94,0xFF,0xD3,0x87,0xE1,0xD2,0x47,0xCC,0x47,0xD5,0x23,0x46,0x23,0x8D,0x8F,0x9D,0x1F,0x1F,0x1B, +0x0D,0x1A,0xBD,0xF2,0x64,0xCE,0x93,0xE1,0xA7,0xB2,0xA7,0x13,0xCF,0xCA,0x7E,0x56,0xFF,0x79,0xEB, +0x73,0xAB,0xE7,0xDF,0xFD,0xE2,0xFB,0x4B,0xCF,0x58,0xFC,0xD8,0xF0,0x0B,0xF9,0x8B,0xCF,0xBF,0xAE, +0x79,0xA9,0xF3,0x72,0xEF,0xAB,0xA9,0xAF,0x3A,0xC7,0x23,0xC7,0x1F,0xBC,0xCE,0x79,0x3D,0xF1,0xA6, +0xFC,0xAD,0xCE,0xDB,0x7D,0xEF,0xB8,0xEF,0xBA,0xDF,0xC7,0xBD,0x1F,0x99,0x28,0xFC,0x40,0xFE,0x50, +0xF3,0xD1,0xFA,0x63,0xC7,0xA7,0xD0,0x4F,0xF7,0x3E,0xE7,0x7C,0xFE,0xFC,0x2F,0xF7,0x84,0xF3,0xFB, +0x25,0xD2,0x9F,0x33,0x00,0x00,0x00,0x20,0x63,0x48,0x52,0x4D,0x00,0x00,0x7A,0x25,0x00,0x00,0x80, +0x83,0x00,0x00,0xF9,0xFF,0x00,0x00,0x80,0xE9,0x00,0x00,0x75,0x30,0x00,0x00,0xEA,0x60,0x00,0x00, +0x3A,0x98,0x00,0x00,0x17,0x6F,0x92,0x5F,0xC5,0x46,0x00,0x00,0x03,0x6A,0x49,0x44,0x41,0x54,0x78, +0xDA,0xD4,0x99,0xDB,0x8B,0x4D,0x51,0x1C,0xC7,0x3F,0x73,0x30,0x33,0xB9,0x1B,0x91,0x26,0xE4,0x96, +0x41,0x23,0x64,0xBC,0x10,0x21,0x22,0x49,0xE4,0xC1,0x03,0x25,0xA6,0x49,0xE3,0x6F,0xF0,0xE4,0x4D, +0xA3,0x88,0x72,0x8B,0x79,0x91,0x86,0x22,0x21,0x91,0x68,0x94,0x6B,0x6E,0x33,0xEE,0x23,0x14,0x66, +0x18,0x53,0x43,0x72,0x3B,0xE3,0xFA,0xF5,0x60,0x4D,0x9D,0x8E,0x73,0xF6,0x59,0x6B,0xED,0x7D,0xCE, +0x71,0xBE,0xB5,0xDA,0x9D,0xCE,0xDA,0xBF,0xB5,0xBE,0xEB,0xB7,0x7E,0xD7,0x5D,0x24,0x89,0x42,0x46, +0xCF,0x88,0xE4,0x14,0x03,0x53,0x81,0xF1,0x40,0x15,0x30,0x0E,0x18,0x06,0xF4,0x06,0x3E,0x03,0xED, +0xC0,0x33,0xE0,0x16,0xF0,0x04,0x68,0x02,0xF4,0x3F,0x10,0x98,0x02,0xD4,0x00,0xCB,0x80,0x11,0x0E, +0xEF,0x3D,0x07,0x4E,0x00,0x07,0x80,0x47,0xA1,0x76,0x20,0xC9,0x67,0xCC,0x94,0x74,0x51,0xD1,0xE0, +0xB4,0xA4,0xE9,0x9E,0xFB,0x70,0x26,0x50,0x26,0xE9,0xB0,0xB2,0x83,0x7A,0x49,0xFD,0x5D,0x09,0x14, +0x39,0x18,0xF1,0x2C,0xA3,0xF6,0xC1,0x59,0xB4,0xC9,0x37,0xC0,0x12,0xE0,0xAE,0xED,0x0B,0x31,0xCB, +0x79,0x6B,0x81,0xCB,0x59,0xDE,0x3C,0x40,0x39,0x70,0x07,0x58,0x1E,0xA5,0x0D,0x54,0x2B,0x3F,0x58, +0x15,0xC5,0x15,0x5A,0x09,0x1C,0xCD,0xA3,0x9B,0x5F,0x08,0x9C,0x0F,0x9A,0x10,0x44,0x60,0x0C,0x70, +0x0D,0x18,0x9A,0x47,0x02,0x6D,0xC6,0xF6,0x5E,0xF9,0xD8,0x40,0x7D,0x9E,0x37,0x0F,0x30,0x1C,0xD8, +0xE3,0xA3,0x81,0x1A,0x60,0x9F,0xC7,0x82,0x5D,0xE6,0x50,0x9A,0x4C,0x90,0xEA,0x6D,0x22,0xEE,0x67, +0xA0,0x1A,0x98,0x06,0xFC,0x06,0xFA,0x38,0xCA,0x5D,0x03,0x1C,0xB2,0x35,0xE2,0x52,0x49,0x4F,0x3D, +0x8C,0xEE,0x8A,0xA4,0x05,0x92,0x7A,0x49,0x2A,0x49,0x21,0xB7,0xD8,0x3C,0xE7,0x48,0x3A,0x22,0xE9, +0xAB,0x83,0xEC,0xBB,0x2E,0x81,0x6C,0xBD,0xE3,0xC6,0x5B,0x25,0xCD,0xF7,0x88,0xA2,0xF3,0x24,0x7D, +0x72,0x58,0x67,0xB5,0x2D,0x81,0x46,0x07,0xA1,0xED,0x92,0x26,0xF9,0xA6,0x01,0x46,0x1B,0x3F,0x2D, +0xD7,0x6A,0xB4,0x21,0x30,0x5A,0x52,0xDC,0x52,0x60,0xA7,0xA4,0x09,0x21,0x36,0xEF,0xAA,0xF1,0xB8, +0xA4,0x8A,0xE4,0xF7,0x63,0x49,0x6E,0x73,0x05,0x50,0x6A,0x61,0x54,0x1F,0x81,0xB9,0x40,0x4B,0x04, +0x9E,0xA6,0x1E,0x38,0x65,0x31,0xAF,0x14,0x58,0x14,0xE4,0x46,0x87,0x03,0x63,0x2D,0x17,0xDD,0x05, +0x3C,0x88,0xD0,0x5D,0xD6,0x59,0xCE,0x9B,0x1C,0x44,0x60,0x06,0x50,0x69,0x21,0xE4,0x3D,0xB0,0x3D, +0x62,0x7F,0x7F,0x09,0xB8,0x62,0x59,0x7F,0xA4,0x25,0x30,0xD1,0x5C,0xA3,0x4C,0xD8,0x0B,0x74,0x64, +0x21,0x68,0xD9,0x68,0xB4,0xC2,0x54,0x7A,0x29,0x09,0x94,0x03,0x43,0x32,0x08,0x88,0x03,0xFB,0xB3, +0x14,0x75,0x6D,0x34,0x50,0x02,0xF4,0x4D,0x47,0xA0,0x9F,0x99,0x10,0x84,0x5F,0xC0,0x97,0x2C,0x11, +0x68,0xB5,0x98,0xD3,0x03,0xE8,0x95,0x8E,0xC0,0x77,0x13,0xE6,0x03,0xB3,0x6F,0x43,0x22,0x1B,0xB0, +0xAD,0xAC,0x62,0xE9,0x7E,0xBC,0x05,0xDE,0x65,0x78,0xF9,0x37,0xF0,0xC3,0x63,0x73,0x03,0xCD,0x08, +0xC2,0x08,0x1F,0xA2,0x89,0x04,0x9E,0x05,0xA5,0xAD,0x21,0xD1,0x60,0x2A,0xAD,0xB2,0x0C,0x25,0x2B, +0x16,0x57,0xF8,0x5B,0x3A,0x02,0xD7,0x81,0x7B,0x19,0x04,0xF4,0x75,0x6C,0x9F,0x74,0x63,0x14,0x30, +0x1A,0x38,0x17,0x40,0x62,0xB2,0x25,0x81,0xAE,0x74,0x04,0xDE,0x98,0x91,0xC9,0x88,0x56,0x78,0x10, +0xF8,0x69,0x9E,0xD3,0x81,0x0B,0xC6,0x61,0x24,0x62,0xB6,0xA5,0x06,0xF4,0x8F,0xAD,0x24,0xE5,0x16, +0x55,0x16,0x39,0x49,0x9B,0xA4,0x41,0x8E,0xF9,0xCE,0xBD,0x24,0x19,0xF7,0x93,0x5A,0x28,0x27,0x2D, +0xF3,0xA1,0x17,0x92,0x06,0x04,0x25,0x73,0x3D,0x25,0x3D,0xB4,0x10,0xB4,0xC7,0x91,0x40,0x2A,0x99, +0xCD,0xE6,0xBF,0xE5,0x0E,0xD9,0xEF,0xA6,0xA0,0x64,0xAE,0x5B,0xD5,0x0D,0x16,0xAA,0xDC,0x00,0x6C, +0x74,0xB8,0x42,0xB1,0x34,0x69,0xC1,0x7D,0xC7,0xB4,0xE4,0xB6,0x4D,0x45,0x36,0x52,0xD2,0x07,0x8B, +0xD3,0x78,0x6B,0x3A,0x75,0x36,0x1A,0x78,0x1C,0x41,0x9B,0xE5,0x71,0x2A,0xD9,0xA9,0x4E,0xE6,0x15, +0xB0,0xDB,0xE2,0x34,0x0E,0x9A,0xC4,0x2E,0x57,0x68,0x70,0xE9,0x4A,0x6C,0x01,0x5E,0x67,0x10,0x78, +0x35,0x87,0x9B,0xEF,0x30,0x29,0xBC,0x35,0x81,0x0F,0x40,0x6D,0x80,0xC0,0x9D,0xC0,0xF1,0x1C,0x12, +0xD8,0x01,0x74,0xFA,0xB4,0x16,0x37,0xA7,0xB8,0x8B,0x5B,0x3D,0xCA,0xC6,0x96,0x10,0x77,0xBF,0x2E, +0x6C,0x7B,0xFD,0x40,0x42,0xE1,0xBD,0xCD,0xB3,0xEE,0xF5,0x25,0xD0,0x6C,0x5C,0x7B,0x5A,0xD9,0x36, +0xDD,0xE9,0x5A,0xD3,0xA1,0x9B,0x0D,0x6C,0xCA,0x71,0x67,0xEE,0x58,0x42,0x14,0x77,0xEE,0x8D,0x46, +0x89,0x16,0x53,0x4D,0xB9,0xE2,0x97,0x69,0xF0,0x36,0x86,0xFD,0x3E,0x90,0x2F,0xF4,0x00,0xCE,0x02, +0x8B,0x0B,0x95,0x00,0xFC,0xFD,0x02,0x7A,0x06,0x58,0x5A,0xA8,0x04,0xBA,0x71,0x0A,0x58,0x97,0x2F, +0x02,0x37,0x12,0x2A,0xBA,0x30,0xA8,0x74,0x8D,0x03,0x51,0x8D,0x98,0xE9,0x4E,0xD7,0x48,0x7A,0xE9, +0xE9,0x52,0x8F,0x85,0xFD,0x4A,0x19,0x15,0xCA,0x4D,0xF5,0x15,0xB7,0x98,0x5B,0x64,0x6E,0x49,0x31, +0x70,0x33,0x55,0xEE,0x95,0x0F,0x02,0x91,0x22,0x46,0x81,0xE3,0xCF,0x00,0xD2,0xF0,0xF4,0x75,0x05, +0xC1,0xEC,0xA0,0x00,0x00,0x00,0x00,0x49,0x45,0x4E,0x44,0xAE,0x42,0x60,0x82}; diff --git a/archive/blr2/src/main.cpp b/archive/blr2/src/main.cpp new file mode 100644 index 0000000..3c1bec1 --- /dev/null +++ b/archive/blr2/src/main.cpp @@ -0,0 +1,1349 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Main Code +// Copyright Chrisoft 2014 +//Now that we use BSD license, so let's paste it here. +//(although it may be awful) +/* + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of the nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ +//#define Debug +#include <hge.h> +#include <hgefont.h> +#include <hgegui.h> +#include <hgedistort.h> +#include <hgerect.h> +#include <cassert> +#include <cmath> +#include <ctime> +#include <cstdlib> +#include <cstring> +#include <cstdio> +#include <csignal> +#ifdef WIN32 +#include <io.h> +#include <direct.h> +#include <shlwapi.h> +#include <shellapi.h> +#include <windows.h> +#include <mmsystem.h> +#endif +#if defined(__GNUC__) && !defined(MINGW_BUILD) +#include <execinfo.h> +#endif +#include "libcgh.h" +#include "hgeft.h" +#include "global.h" +#include "music.h" +#include "scoresystem.h" +#include "towernbullet.h" +#include "background.h" +#include "levels.h" +#include "scorec.h" +#include "menus.h" +static const char* MAIN_SRC_FN="main.cpp"; +#ifdef WIN32 +void Expand(const char *source,const char *dist) +{ + char cmd[255]; + sprintf(cmd,"%s -F:* %s",source,dist); + int res=(int)ShellExecuteA(NULL,"open","expand.exe",cmd,NULL,SW_HIDE); + if (res<32) Error("Error while decompressing resources!\nCheck if expand.exe works correctly."); +} +void firststartup() +{ + if (MessageBoxA(NULL,"It seems that you are running BLR for the First time!\nLet's do some \ +basic settings first!\n\nUse vsync?","First Start Up",0x00000024)==6) + fpslvl=2; + else + fpslvl=0; + if (MessageBoxA(NULL,"Enable Fullscreen?","First Start Up",0x00000024)==6) + tfs=1; + else + tfs=0; + diffkey=false;VidMode=0; + plrspd=3;plrslospd=3;clrbns=clrmode=0;bgmvol=15;sfxvol=10; + hge->System_Log("%s: Finishing first start up configuraion...",MAIN_SRC_FN); + Options_Writeback(); + Score_Initailize(); +} +#else +void firststartup() +{ + fpslvl=2;tfs=0;VidMode=0;diffkey=false; + plrspd=3;plrslospd=3;clrbns=clrmode=0;bgmvol=15;sfxvol=10; + hge->System_Log("%s: Finishing (stubbed) first start up configuraion...",MAIN_SRC_FN); + Options_Writeback(); + Score_Initailize(); +} +#endif +void Player_Clear_Expand() +{ + if (LOWFPS) + clrrange+=13.6; + else + clrrange+=0.8; + int ds; + for (int i=1;i<=bulcnt;++i) + { + if(bullet[i].bullettype>=253)continue; + double dis=GetDist(bullet[i].bulletpos,playerpos);ds=0; + if(PlayerSplit) + for(int j=1;j<4;++j) + { + if(dis>GetDist(bullet[i].bulletpos,playerpos+splitData[j])) + dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]),ds=j; + } + if(dis<=clrrange&&bullet[i].exist&&!bullet[i].inv) + { + CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10,ds); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + } +} +void Player_Clear_Rotate() +{ + if (LOWFPS) + clrrad+=pi/450*17; + else + clrrad+=pi/450; + for (int i=1;i<=bulcnt;++i) + { + if(bullet[i].bullettype>=253)continue; + double dis=GetDist(bullet[i].bulletpos,playerpos); + double rad=atan2l(bullet[i].bulletpos.y-playerpos.y,bullet[i].bulletpos.x-playerpos.x); + hge->Gfx_RenderLine(playerpos.x+8,playerpos.y+8,playerpos.x+cos(clrrad)*clrmaxrange,playerpos.y+sin(clrrad)*clrmaxrange); + rad=normalizerad(rad); + if(dis<=clrmaxrange&&bullet[i].exist&&!bullet[i].inv&&rad>normalizerad(clrrad)-pi/12&&rad<normalizerad(clrrad)+pi/12) + { + CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + if(PlayerSplit) + for(int j=1;j<4;++j) + { + vector2d plsp=playerpos+splitData[j]; + double dis=GetDist(bullet[i].bulletpos,plsp); + double rad=atan2l(bullet[i].bulletpos.y-plsp.y,bullet[i].bulletpos.x-plsp.x); + hge->Gfx_RenderLine(plsp.x+8,plsp.y+8,plsp.x+cos(clrrad)*clrmaxrange,plsp.y+sin(clrrad)*clrmaxrange); + while (rad<0)rad+=2*pi; + if (bullet[i].bullettype!=255&&dis<=clrmaxrange&&bullet[i].exist&&!bullet[i].inv&&rad>normalizerad(clrrad)-pi/12&&rad<normalizerad(clrrad)+pi/12) + { + CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10,j); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + } + } +} +void ProcessPlayer() +{ + if (!clrcircle) + { + clrcircle=new hgeSprite(SprSheet,63,71,193,193); + clrcircle->SetHotSpot(96.5f,96.5f); + clrcircle->SetBlendMode(BLEND_ALPHAADD); + } + if(clrmode)clrcircle->SetColor(0x30008080);else clrcircle->SetColor(0x30800000); + if (playerLockX) + { + Lock.Setdata(0,vector2d(playerpos.x-1,0),vector2d(playerpos.x-1,600),0xC0FFFFFF); + for (int i=1;i<80;++i) + Lock.Setdata(i,vector2d(playerpos.x+1,0),vector2d(playerpos.x+1,600),0xC0FFFFFF); + Lock.Render(); + } + if (playerLockY) + { + Lock.Setdata(0,vector2d(0,playerpos.y+5),vector2d(800,playerpos.y+5),0xC0FFFFFF); + for (int i=1;i<80;++i) + Lock.Setdata(i,vector2d(0,playerpos.y+7),vector2d(800,playerpos.y+7),0xC0FFFFFF); + Lock.Render(); + } + if(!PlayerSplit) + playerspr->RenderEx(playerpos.x+8.4,playerpos.y+8.4,playerrot,0.7,0); + else + { + for(int i=0;i<4;++i) + playerspr->RenderEx(playerpos.x+splitData[i].x+8.4,playerpos.y+splitData[i].y+8.4,playerrot,0.7,0); + } + if (DisablePlayer)return; + playerrot+=0.00174533*17; + double realspd; + if (hge->Input_GetKeyState(HGEK_SHIFT)) + realspd=playerslospeed*(1000.0f/hge->Timer_GetFPS()); + else + realspd=playerspeed*(1000.0f/hge->Timer_GetFPS()); + if (hge->Input_GetKeyState(HGEK_LEFT)&&!playerLockX) + if (playerpos.x>10)playerpos.x-=realspd; + if (hge->Input_GetKeyState(HGEK_RIGHT)&&!playerLockX) + if ((playerpos.x<770&&!PlayerSplit)||(playerpos.x<370&&PlayerSplit))playerpos.x+=realspd; + if (hge->Input_GetKeyState(HGEK_UP)&&!playerLockY) + if (playerpos.y>10)playerpos.y-=realspd; + if (hge->Input_GetKeyState(HGEK_DOWN)&&!playerLockY) + if ((playerpos.y<570&&!PlayerSplit)||(playerpos.y<270&&PlayerSplit))playerpos.y+=realspd; + if(mode==2)return; + if (!clrmode) + { + if (hge->Input_GetKeyStateEx(diffkey?HGEK_X:HGEK_Z)==HGEKST_HIT&&clrmaxrange==0) + {clrind=0;charge=1;} + if (hge->Input_GetKeyStateEx(diffkey?HGEK_X:HGEK_Z)==HGEKST_KEEP&&charge) + { + if (clrmaxrange<=400) + {if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1;} + if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); + } + if (hge->Input_GetKeyStateEx(diffkey?HGEK_X:HGEK_Z)==HGEKST_RELEASE&&charge) + { + charge=0; + if (clrmaxrange<=50) + { + if (clrtime+clrbns>0) + {--clrtime;clrmaxrange=350;Player_Clear_Expand();++clrusg;} + else clrmaxrange=0; + } + else{Player_Clear_Expand();++clrusg;} + } + if (clrrange!=0) + { + Player_Clear_Expand(); + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*(clrmaxrange-clrrange)/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*(clrmaxrange-clrrange)/193.0f); + clrind+=(LOWFPS?0.016*pi:0.001*pi); + } + if (clrrange>=clrmaxrange)clrrange=clrmaxrange=0; + } + else + { + if (hge->Input_GetKeyStateEx(diffkey?HGEK_X:HGEK_Z)==HGEKST_HIT&&clrmaxrange==0) + {clrind=0;charge=1;} + if (hge->Input_GetKeyStateEx(diffkey?HGEK_X:HGEK_Z)==HGEKST_KEEP&&charge) + { + if (clrmaxrange<=400) + {if (LOWFPS)clrmaxrange+=1.6;else clrmaxrange+=0.1;} + if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi; + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f); + } + if (hge->Input_GetKeyStateEx(diffkey?HGEK_X:HGEK_Z)==HGEKST_RELEASE&&charge) + { + charge=0; + if (clrmaxrange<=50) + { + if(clrtime+clrbns>0) + {--clrtime;clrmaxrange=350;Player_Clear_Rotate();++clrusg;} + else clrmaxrange=0; + }else{Player_Clear_Rotate();++clrusg;} + } + if (clrrad-pi/2>1e-7) + { + Player_Clear_Rotate(); + clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f*(5*pi/2.0f-clrrad)/(2*pi)); + if(PlayerSplit)for(int i=1;i<4;++i) + clrcircle->RenderEx(playerpos.x+splitData[i].x+7.2,playerpos.y+splitData[i].y+7.2,clrind,2*clrmaxrange/193.0f*(5*pi/2.0f-clrrad)/(2*pi)); + clrind+=(LOWFPS?0.016*pi:0.001*pi); + } + if (5*pi/2-clrrad<1e-7)clrrad=pi/2,clrmaxrange=0; + } +} +void RefreshScore() +{ + Mult_FrameFunc(); + if(DisablePlayer)return; + mult+=0.01f*dsmc; + score+=16*mult; + if(scminus){if(mult/2>0.1)mult/=2;else mult=0.1;} + score+=100*shots*mult; + score-=scminus*mult; + score+=2000*dsmc*mult; + ++frms; + averfps=(averfps*(frms-1)+hge->Timer_GetFPSf())/(double)frms; +} +void CallLevels() +{ + //Use this to call level procedures. + if((mode==1)&&coll!=0){deathMenu.Init(-200);return;} + if((mode==2)&&coll!=0){asts+=assetime;assetime=0;++part;coll=0;IfCallLevel=IfShowTip=true;return;} + if(!IfCallLevel) return; + if(mode==2)assetime+=hge->Timer_GetDelta(); + //Check Complete here + if(level==1&&part==0)Level1Part0(); + if(level==1&&part==1)Level1Part1(); + if(level==1&&part==2)Level1Part2(); + if(level==1&&part==3)Level1Part3(); + if(level==1&&part==4)Level1Part4(); + if(level==2&&part==0)Level2Part0(); + if(level==2&&part==1)Level2Part1(); + if(level==2&&part==2)Level2Part2(); + if(level==2&&part==3)Level2Part3(); + if(level==2&&part==4)Level2Part4(); + if(level==2&&part==5)Level2Part5(); + if(level==2&&part==6)Level2Part6(); + if(level==2&&part==7)Level2Part7(); + if(level==2&&part==8)Level2Part8(); + if(level==2&&part==9)Level2Part9(); + if(level==3&&part==0)Level3Part0(); + if(level==3&&part==1)Level3Part1(); + if(level==3&&part==2)Level3Part2(); + if(level==3&&part==3)Level3Part3(); + if(level==3&&part==4)Level3Part4(); + if(level==3&&part==5)Level3Part5(); + if(level==3&&part==6)Level3Part6(); + if(level==4&&part==0)Level4Part0(); + if(level==4&&part==1)Level4Part1(); + if(level==4&&part==2)Level4Part2(); + if(level==4&&part==3)Level4Part3(); + if(level==4&&part==4)Level4Part4(); + if(level==4&&part==5)Level4Part5(); + if(level==4&&part==6)Level4Part6(); + if(level==4&&part==7)Level4Part7(); + if(level==4&&part==8)Level4Part8(); + if(level==4&&part==9)Level4Part9(); + if(level==4&&part==10)Level4Part10(); + if(level==4&&part==11)Level4Part11(); + if(level==4&&part==12)Level4Part12(); + if(level==4&&part==13)Level4Part13(); + if(level==4&&part==14)Level4Part14(); + if(level==4&&part==15)Level4Part15(); + if(level==4&&part==16)Level4Part16(); + if(level==4&&part==17)Level4Part17(); + if(level==4&&part==18)Level4Part18(); + if(level==4&&part==19)Level4Part19(); + if(level==4&&part==20)Level4Part20(); + if(level==4&&part==21)Level4Part21(); + if(level==4&&part==22)Level4Part22(); + if(level==4&&part==23)Level4Part23(); + if(level==4&&part==24)Level4Part24(); + if(level==4&&part==25)Level4Part25(); + if(level==5&&part==0)Level5Part0(); + if(level==5&&part==1)Level5Part1(); + if(level==5&&part==2)Level5Part2(); + if(level==5&&part==3)Level5Part3(); + if(level==5&&part==4)Level5Part4(); + if(level==5&&part==5)Level5Part5(); + if(level==5&&part==6)Level5Part6(); + if(level==5&&part==7)Level5Part7(); + if(level==5&&part==8)Level5Part8(); + if(level==5&&part==9)Level5Part9(); + if(level==5&&part==10)Level5Part10(); + if(level==5&&part==11)Level5Part11(); + if(level==5&&part==12)Level5Part12(); + if(level==5&&part==13)Level5Part13(); + if(level==5&&part==14)Level5Part14(); + if(level==5&&part==15)Level5Part15(); + if(level==5&&part==16)Level5Part16(); + if(level==5&&part==17)Level5Part17(); + if(level==5&&part==18)Level5Part18(); + if(level==5&&part==19)Level5Part19(); + if(level==5&&part==20)Level5Part20(); + if(level==5&&part==21)Level5Part21(); + if(level==5&&part==22)Level5Part22(); + if(level==6&&part==0)Level6Part0(); + if(level==6&&part==1)Level6Part1(); + if(level==6&&part==2)Level6Part2(); + if(level==6&&part==3)Level6Part3(); + if(level==6&&part==4)Level6Part4(); + if(level==6&&part==5)Level6Part5(); + if(level==6&&part==6)Level6Part6(); + if(level==6&&part==7)Level6Part7(); + if(level==6&&part==8)Level6Part8(); + if(level==6&&part==9)Level6Part9(); + if(level==6&&part==10)Level6Part10(); + if(level==6&&part==11)Level6Part11(); + if(level==6&&part==12)Level6Part12(); + if(level==6&&part==13)Level6Part13(); + if(level==6&&part==14)Level6Part14(); + if(level==6&&part==15)Level6Part15(); + if(level==6&&part==16)Level6Part16(); + if(level==6&&part==17)Level6Part17(); + if(level==6&&part==18)Level6Part18(); + if(level==6&&part==19)Level6Part19(); + if(level==6&&part==20)Level6Part20(); + if(level==6&&part==21)Level6Part21(); + if(level==6&&part==22)Level6Part22(); + if(level==6&&part==23)Level6Part23(); + if(level==6&&part==24)Level6Part24(); + if(level==6&&part==25)Level6Part25(); + if(level==6&&part==26)Level6Part26(); + if(level==6&&part==27)Level6Part27(); + if(level==6&&part==28)Level6Part28(); + if(level==6&&part==29)Level6Part29(); + if(level==6&&part==30)Level6Part30(); + if(level==6&&part==31)Level6Part999999999(); + if(level==7&&part==0)Level7Part0(); + if(level==7&&part==1)Level7Part1(); + if(level==7&&part==2)Level7Part2(); + if(level==7&&part==3)Level7Part3(); + if(level==7&&part==4)Level7Part4(); + if(level==7&&part==5)Level7Part5(); + if(level==7&&part==6)Level7Part6(); + if(level==7&&part==7)Level7Part7(); + if(level==7&&part==8)Level7Part8(); + if(level==7&&part==9)Level7Part9(); + if(level==7&&part==10)Level7Part10(); + if(level==7&&part==11)Level7Part11(); + if(level==7&&part==12)Level7Part12(); + if(level==7&&part==13)Level7Part13(); + if(level==7&&part==14)Level7Part14(); + if(level==7&&part==15)Level7Part15(); + if(level==7&&part==16)Level7Part16(); + if(level==7&&part==17)Level7Part17(); + if(level==7&&part==18)Level7Part18(); + if(level==7&&part==19)Level7Part19(); + if(level==7&&part==20)Level7Part20(); + if(level==7&&part==21)Level7Part21(); + if(level==7&&part==22)Level7Part22(); + if(level==7&&part==23)Level7Part23(); + if(level==7&&part==24)Level7Part24(); + if(level==7&&part==25)Level7Part25(); + if(level==7&&part==26)Level7Part26(); + if(level==-1&&part==0)Levelm1Part0(); + if(level==-1&&part==1)Levelm1Part1(); + if(level==-1&&part==2)Levelm1Part2(); + if(level==-1&&part==3)Levelm1Part3(); + if(level==-1&&part==4)Levelm1Part4(); + if(level==-1&&part==5)Levelm1Part5(); + if(level==-1&&part==6)Levelm1Part6(); + if(level==-1&&part==7)Levelm1Part7(); + if(level==-1&&part==8)Levelm1Part8(); + if(level==-1&&part==9)Levelm1Part9(); + if(level==-1&&part==10)Levelm1Part10(); + if(level==-1&&part==11)Levelm1Part11(); + if(level==-1&&part==12)Levelm1Part12(); + if(level==-1&&part==13)Levelm1Part13(); + if(level==-1&&part==14)Levelm1Part14(); + if(level==-1&&part==15)Levelm1Part15(); + if(level==-1&&part==16)Levelm1Part16(); + if(level==-1&&part==17)Levelm1Part17(); + if(level==-1&&part==18)Levelm1Part18(); + if(level==-1&&part==19)Levelm1Part19(); + if(level==-1&&part==20)Levelm1Part20(); + if(level==-1&&part==21)Levelm1Part21(); + if(level==-2&&part==0)Levelm2Part0(); + if(level==-2&&part==1)Levelm2Part1(); + if(level==-2&&part==2)Levelm2Part2(); + if(level==-2&&part==3)Levelm2Part3(); + if(level==-2&&part==4)Levelm2Part4(); + if(level==-2&&part==5)Levelm2Part5(); + if(level==-2&&part==6)Levelm2Part6(); + if(level==-2&&part==7)Levelm2Part7(); + if(level==-2&&part==8)Levelm2Part8(); + if(level==-2&&part==9)Levelm2Part9(); + if(level==-2&&part==10)Levelm2Part10(); + if(level==-2&&part==11)Levelm2Part11(); + if(level==-2&&part==12)Levelm2Part12(); + if(level==-2&&part==13)Levelm2Part13(); + if(level==-2&&part==14)Levelm2Part14(); + if(level==-2&&part==15)Levelm2Part15(); + if(level==-2&&part==16)Levelm2Part16(); + if(level==-2&&part==17)Levelm2Part17(); + if(level==-2&&part==18)Levelm2Part18(); + if(level==-2&&part==19)Levelm2Part19(); + if(level==-2&&part==20)Levelm2Part20(); + if(level==-2&&part==21)Levelm2Part21(); + if(level==-2&&part==22)Levelm2Part22(); + if(level==-2&&part==23)Levelm2Part23(); + if(level==-2&&part==24)Levelm2Part24(); + if(level==-2&&part==25)Levelm2Part25(); + if(level==-2&&part==26)Levelm2Part26(); + + if(level==1&&part==5)level=2,part=0; + if(level==2&&part==10) + { + if(mode==3&&coll>10){completeMenu.Init(-200);return;} + if(mode==1&&restarts>1){completeMenu.Init(-200);return;} + level=3,part=0; + } + if(level==3&&part==7) + { + if(mode==3&&coll>40){completeMenu.Init(-200);return;} + if(mode==1&&restarts>2){completeMenu.Init(-200);return;} + level=4,part=0; + } + if(level==4&&part==26) + { + if(mode==3&&coll>75){completeMenu.Init(-200);return;} + if(mode==1&&restarts>3){completeMenu.Init(-200);return;} + level=5,part=0; + } + if(level==5&&part==23) + { + if(mode==3&&coll>125){completeMenu.Init(-200);return;} + if(mode==1&&restarts>5){completeMenu.Init(-200);return;} + level=6,part=0; + } + if(level==6&&part==32) + { + if(mode==3&&coll>200){completeMenu.Init(-200);return;} + if(mode==1&&restarts>8){completeMenu.Init(-200);return;} + level=7,part=0; + } + if(level==7&&part==27) + { + if(mode==3&&coll>50){completeMenu.Init(-200);return;} + if(mode==1&&restarts>2){completeMenu.Init(-200);return;} + level=-1,part=0; + } + if(level==-1&&part==22){completeMenu.Init(-200);return;} + if(level==-2&&part>26){completeMenu.Init(-200);return;} +} +bool ProcessCurCred() +{ + CreditsRail->RenderEx(400,300,0,4,1); + if(creditsp!=1) + Credits->Render(creditfly,300); + else + { + Credits->SetTextureRect(4,209,230,76); + Credits->Render(creditfly-30,330); + Credits->SetTextureRect(9,290,140,47); + Credits->Render(creditfly-30,400); + vdig->printf(creditfly-50,240,HGETEXT_LEFT,"%s",BLRVERSION); + bdig->printf(creditfly-50,310,HGETEXT_LEFT,"%s",BuiltDate); + } + if (credstop)credbrk+=hge->Timer_GetDelta(); + if (credbrk>=4.5&&!creddone)creddone=true,credstop=false,creditacc=0,credbrk=0; + if (!credstop)for (int i=1;i<=17;++i)creditfly-=creditacc; + if (creditfly<-300)return true; + for (int i=1;i<=17;++i)if (creditacc<2)creditacc+=0.015; + if (abs(creditfly-400)<5&&!creddone&&!credstop)credstop=true; + return false; +} +void AboutScene() +{ + if (ProcessCurCred()) + creditfly=1200,creditacc=0,credstop=creddone=false,++creditsp, + Credits->SetTextureRect(0,creditsp*200,600,200), + Credits->SetHotSpot(300,100); + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT||creditsp>11) + { + Current_Position=0; + mainMenu.Init(850); + Music_Stop(); + } +} +void HelpScene(bool fake=false) +{ + if(!fake)if(Hlpyofst>0)Hlpyofst-=40;else Hlpyofst=0; + else if(Hlpyofst<400)Hlpyofst+=40;else Hlpyofst=400,hshl=0; + if(Helpslide>1)MenuFont->Render(30,80+Hlpyofst,HGETEXT_LEFT,"Last"), + HlpL->Render(0,85+Hlpyofst); + if(Helpslide<6)MenuFont->Render(770,80+Hlpyofst,HGETEXT_RIGHT,"Next"), + HlpR->Render(775,85+Hlpyofst); + if(Helpscroll==0)Helpspr->Render(0,100+Hlpyofst); + else + { + Helpspr->Render(Helpscroll,100+Hlpyofst); + if(Helpscroll>0)NHelpspr->Render(Helpscroll-800,100+Hlpyofst); + else NHelpspr->Render(Helpscroll+800,100+Hlpyofst); + if(Helpscroll>0)Helpscroll+=30;else Helpscroll-=30; + if(fabs(Helpscroll)>=800) + { + Helpscroll=0;Helpspr->SetTextureRect(0,400*(Helpslide-1),800,400); + } + } + if(fake)return; + if(Helpscroll==0) + { + if(hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT&&Helpslide>1) + { + --Helpslide;NHelpspr->SetTextureRect(0,400*(Helpslide-1),800,400); + Helpscroll=1; + } + if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT&&Helpslide<6) + { + ++Helpslide;NHelpspr->SetTextureRect(0,400*(Helpslide-1),800,400); + Helpscroll=-1; + } + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT) + { + Current_Position=0;mainMenu.Init(1000);hshl=1; + } + } +} +bool Foclost() +{ + if(Current_Position==1)pauseMenu.Init(-200); + return false; +} +bool FrameFunc() +{ + float dt=hge->Timer_GetDelta(); + static float t=0.0f; + float tx,ty; + if (Current_Position==1&&hge->Input_GetKeyState(HGEK_ESCAPE))pauseMenu.Init(-200); + int MMR=-1,SMR=-1,OMR=-1,PPMR=-1,PMR=-1,RTTMR=-1,DMR=-1,CMR=-1,HSMR=-1,HSVMR=-1,HSDMR=-1; + if (mainMenu.isActive())MMR=mainMenu.Update(); + if (startMenu.isActive())SMR=startMenu.Update(); + if (optionMenu.isActive())OMR=optionMenu.Update(); + if (playerPreferenceMenu.isActive())PPMR=playerPreferenceMenu.Update(); + if (pauseMenu.isActive())PMR=pauseMenu.Update(); + if (returnToTitleMenu.isActive())RTTMR=returnToTitleMenu.Update(); + if (deathMenu.isActive())DMR=deathMenu.Update(); + if (completeMenu.isActive())CMR=completeMenu.Update(); + if (newHighScoreGUI.isActive())newHighScoreGUI.Update(); + if (highScoreMenu.isActive())HSMR=highScoreMenu.Update(); + if (highScoreViewMenu.isActive())HSVMR=highScoreViewMenu.Update(); + if (highScoreDetailsMenu.isActive())HSDMR=highScoreDetailsMenu.Update(); + if (Current_Position==0) + { + if(!mainMenu.isActive())return true; + if(~MMR) + { + switch(MMR) + { + case 0:Current_Position=3;startMenu.Init();mainMenu.Leave();break; + case 1:Current_Position=8;highScoreMenu.Init(-200);mainMenu.Leave();break; + case 2: + Current_Position=13; + optionMenu.Init(-200); + break; + case 3: + Current_Position=15; + Helpspr->SetTextureRect(0,0,800,400); + NHelpspr->SetTextureRect(0,400,800,400); + Helpslide=1;Hlpyofst=400;Helpscroll=0; + break; + case 4: + Credits->SetHotSpot(300,100); + CreditsRail->SetHotSpot(300,100); + creditsp=0; + Music_Init("./Resources/Music/BLR2_TR09.ogg"); + lpst=lped=0;Music_Play(); + creditfly=1200;creditacc=0;credstop=creddone=false; + Credits->SetTextureRect(0,0,600,200); + Current_Position=4; + mainMenu.Leave(); + break; + case 5:break; + } + mainMenu.Leave(); + return false; + } + } + if (Current_Position==3) + { + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT) + { + startMenu.Leave();mainMenu.Init(800);Current_Position=0; + } + if(~SMR) + { + startMenu.Leave(); + switch(SMR) + { + case 0: + playerpos.x=400,playerpos.y=400,playerrot=0; + frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false; + level=1,part=1;frms=0,averfps=0.0;bsscale=1; + if(bullet){free(bullet);bullet=NULL;} + towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false; + score=0;Mult_Init();//Music_Init("./Resources/Music/CanonTechno.ogg"); + lpst=4607901;lped=9215893;//Music_Play(); + coll=semicoll=clrusg=0;playerLockX=playerLockY=false; + Lock.Init(2);IfShowTip=true;lsc=0; + clrrad=pi/2;clrrange=0;re.SetSeed(time(NULL)); + FadeTip=false;memset(lasttip,0,sizeof(lasttip)); + memset(tower,0,sizeof(tower)); + Complete=false; + Current_Position=1; + Level1Part1(); + IfCallLevel=true; + mode=1; + break; + case 1: + playerpos.x=400,playerpos.y=400,playerrot=0; + frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false; + level=-2,part=0;frms=0,averfps=0.0;bsscale=1;assetime=asts=0; + if(bullet){free(bullet);bullet=NULL;} + towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false; + score=0;Mult_Init();Music_Init("./Resources/Music/CanonTechno.ogg"); + lpst=4607901;lped=9215893;Music_Play(); + coll=semicoll=clrusg=0;playerLockX=playerLockY=false; + Lock.Init(2);IfShowTip=true;lsc=0; + clrrad=pi/2;clrrange=0;re.SetSeed(time(NULL)); + FadeTip=false;memset(lasttip,0,sizeof(lasttip)); + memset(tower,0,sizeof(tower)); + Complete=false; + Current_Position=1; + IfCallLevel=true; + mode=2; + break; + case 2: + playerpos.x=400,playerpos.y=400,playerrot=0; + frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false; + level=1,part=1;frms=0,averfps=0.0;bsscale=1; + if(bullet){free(bullet);bullet=NULL;} + towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false; + score=0;Mult_Init();//Music_Init("./Resources/Music/CanonTechno.ogg"); + lpst=4607901;lped=9215893;//Music_Play(); + coll=semicoll=clrusg=0;playerLockX=playerLockY=false; + Lock.Init(2);IfShowTip=true;lsc=0; + clrrad=pi/2;clrrange=0;re.SetSeed(time(NULL)); + FadeTip=false;memset(lasttip,0,sizeof(lasttip)); + memset(tower,0,sizeof(tower)); + Complete=false; + Current_Position=1; + Level1Part1(); + IfCallLevel=true; + mode=3; + break; + } + return false; + } + } + if (Current_Position==5) + { + if(~DMR) + { + if(DMR==1) + { + IfCallLevel=true; + IfShowTip=true; + Current_Position=1; + score=-abs(score); + mult=1;multbat=1;multbrk=TenSeconds; + ++restarts;part=0; + clockrot=deltarot=0; + coll=towcnt=bulcnt=0; + DisableAllTower=DisablePlayer=false; + } + if(DMR==2) + {Current_Position=0;mainMenu.Init(-200);} + deathMenu.Leave(); + return false; + } + } + if (Current_Position==6) + { + if(~CMR) + { + if(CMR==1) + {Current_Position=7;newHighScoreGUI.Init();} + if(CMR==2) + {Current_Position=0;mainMenu.Init(-200);} + completeMenu.Leave(); + return false; + } + } + if (Current_Position==8) + { + if(~HSMR) + { + if(HSMR<=2) + {Current_Position=9;highScoreViewMenu.Init(-200,HSMR);} + if(HSMR==3) + {Current_Position=0;mainMenu.Init(-200);} + highScoreMenu.Leave(); + return false; + } + } + if (Current_Position==9) + { + if(~HSVMR) + { + if(HSVMR<=highScoreViewMenu.GetViewCount()&&HSVMR) + {Current_Position=10;highScoreDetailsMenu.Init(-200,highScoreViewMenu.View(),HSVMR);} + if(HSVMR==6) + {Current_Position=8;highScoreMenu.Init(-200);} + if(HSVMR&&(HSVMR<=highScoreViewMenu.GetViewCount()||HSVMR==6)) + highScoreViewMenu.Leave(); + return false; + } + } + if (Current_Position==10) + { + if(~HSDMR) + { + highScoreViewMenu.Init(-200,highScoreDetailsMenu.View()); + highScoreDetailsMenu.Leave();Current_Position=9; + return false; + } + } + if (Current_Position==11) + { + //I am cornered!! + if(!pauseMenu.isActive())Current_Position=1,DisableAllTower=DisablePlayer=0; + if(~PMR) + { + pauseMenu.Leave(); + if(PMR==2)returnToTitleMenu.Init(-200),Current_Position=12; + else Music_Resume(); + return false; + } + } + if (Current_Position==12) + { + if(~RTTMR) + { + returnToTitleMenu.Leave(); + if(RTTMR==1)pauseMenu.Init(-200); + if(RTTMR==2)mainMenu.Init(-200),Current_Position=0; + } + } + if (Current_Position==13) + { + if(~OMR) + { + if(OMR==6||OMR==7)optionMenu.Leave(); + if(OMR==6) + { + playerPreferenceMenu.Init(-200); + Current_Position=14; + } + if(OMR==7) + { + Options_Writeback(); + mainMenu.Init(-200); + Current_Position=0; + } + return false; + } + } + if (Current_Position==14) + { + if(~PPMR) + { + if(PPMR==5) + { + if(AP_Update(plrspd,plrslospd,clrbns)<=10000) + optionMenu.Init(850), + Current_Position=13, + playerPreferenceMenu.Leave(); + else playerPreferenceMenu.Shake(); + } + return false; + } + } + t+=dt; + tx=50*cosf(t/60); + ty=50*sinf(t/60); + quad.v[0].tx=tx; quad.v[0].ty=ty; + quad.v[1].tx=tx+800/64; quad.v[1].ty=ty; + quad.v[2].tx=tx+800/64; quad.v[2].ty=ty+600/64; + quad.v[3].tx=tx; quad.v[3].ty=ty+600/64; + //Rendering*********************************************************************************** + //Super Spliter!*****Super Spliter!*****Super Spliter!*****Super Spliter!*****Super Spliter!** + //******Super Spliter!*****Super Spliter!*****Super Spliter!*****Super Spliter!*************** + hge->Gfx_BeginScene(); +#ifndef WIN32 + hge->Gfx_SetTransform(0,0,0,yos,0,scale,scale); +#else + hge->Gfx_SetTransform(0,0,0,0,0,scale,scale); +#endif + for(int i=0;i<4;i++)quad.v[i].col=DBGColor; + hge->Gfx_Clear(SETA(DBGColor,0xFF)); + if (skyactive)sky.Update(),sky.Render(); + hge->Gfx_RenderQuad(&quad); + int bulinuse=0; + if (Current_Position==1||Current_Position==2||Current_Position==5||Current_Position==11||Current_Position==12) + { + //If we are at the main scene or tip scene(which towers and bullets should still appear..) + //Render towers, bullets and player. + if (Leaves.IsActive())Leaves.Update(); + if (binter.active())binter.Update(); + if (bdiff.active())bdiff.Update(); + if (LE_Active)Leaf.Update(); + shots=0; + dsmc=scminus=0; + Music_Update(); + ProcessTower1(); + ProcessTower2(); + ProcessTower3(); + ProcessTower4(); + ProcessTower5(); + ProcessTower6(); + ProcessTower7(); + ProcessTower8(); + ProcessTower9(); + ProcessLaser(); + for (int i=1;i<=bulcnt;++i) + { + if(bullet[i].exist)++bulinuse; + switch (bullet[i].bullettype) + { + case 1:ProcessBullet1(i);break; + case 2:ProcessBullet2(i);break; + case 4:ProcessBullet4(i);break; + case 5:ProcessBullet5(i);break; + case 6:ProcessBullet6(i);break; + case 7:ProcessBullet7(i);break; + case 8:ProcessBullet8(i);break; + case 9:ProcessBullet9(i);break; + case 253:BulletDeath_Process(i);break; + case 254:SCEffect_Process(i);break; + case 255:ProcessBullet255(i);break; + } + } + if (Current_Position==1)CallLevels(); + ProcessPlayer(); + RefreshScore(); + { + if (ATarg.visible)ATarg.TargFollowPlayer(),ATarg.TargRender(); + } + { + if (BTarg.visible)BTarg.TargRender(); + } + if (!DisablePlayer)--frameleft; + if (!LOWFPS) + { + if (playerspeed<playerfulspd)playerspeed+=playerfulspd/400; + if (playerslospeed<playerfulslospd)playerslospeed+=playerfulslospd/400; + } + else + { + if (playerspeed<playerfulspd)playerspeed+=playerfulspd/25; + if (playerslospeed<playerfulslospd)playerslospeed+=playerfulslospd/25; + } + } + if (frameleft==0&&Current_Position==1) + { + IfCallLevel=true; + ++part; + IfShowTip=true; + } + if(Current_Position==1&&shots)hge->Effect_PlayEx(snd,sfxvol/15.0,0,1,false); + if(mainMenu.isActive())mainMenu.Render(); + if(startMenu.isActive())startMenu.Render(); + if(optionMenu.isActive())optionMenu.Render(); + if(playerPreferenceMenu.isActive())playerPreferenceMenu.Render(); + if(pauseMenu.isActive())pauseMenu.Render(); + if(returnToTitleMenu.isActive())returnToTitleMenu.Render(); + if(deathMenu.isActive())deathMenu.Render(); + if(completeMenu.isActive())completeMenu.Render(); + if(newHighScoreGUI.isActive())newHighScoreGUI.Render(); + if(highScoreMenu.isActive())highScoreMenu.Render(); + if(highScoreViewMenu.isActive())highScoreViewMenu.Render(); + if(highScoreDetailsMenu.isActive())highScoreDetailsMenu.Render(); + if(Current_Position==15)HelpScene();if(hshl)HelpScene(1); + if(Current_Position==0||Current_Position==3||Current_Position==8|| + Current_Position==9||Current_Position==10||Current_Position==13||Current_Position==14) + { + titlespr->Render(160,0); + } + if (Current_Position==2)ShowTip(lasttip); + if (Current_Position==4)AboutScene(); + fnt->SetColor(0xFFFFFFFF); + rbPanelFont.UpdateString(L" FPS: %.2f",hge->Timer_GetFPSf()); + rbPanelFont.Render(785,595,0xFFFFFFFF,1); + if (Current_Position==1||Current_Position==2) + { + rbPanelFont.UpdateString(L"AF: %.2f",averfps); + rbPanelFont.Render(785,575,0xFFFFFFFF,1); + if (playerpos.x<220&&playerpos.y<200) + { + if (!LOWFPS&&infofade>=0x33)--infofade; + if (LOWFPS&&infofade>0x33)infofade-=16; + } + else + { + if (!LOWFPS&&infofade<0xFF)++infofade; + if (LOWFPS&&infofade<=0xEF)infofade+=16; + } + if(hge->Input_GetKeyStateEx(HGEK_A)==HGEKST_HIT)showdebug^=1; + if(showdebug) + { + fnt->SetColor(0xFFFFFFFF); + fnt->printf(795, 0, HGETEXT_RIGHT, "Allocated bullets %d",bulcnt); + fnt->printf(795, 25, HGETEXT_RIGHT, bulcnt?"%d in use (%.2f%%)":"%d in use (?%)",bulinuse,(double)bulinuse/bulcnt); + fnt->printf(795, 50, HGETEXT_RIGHT, "Player pos (%.2f,%.2f)",playerpos.x,playerpos.y); + } + fnt->SetColor(SETA(0xFFFFFF,infofade)); + fnt->printf(5, 0, HGETEXT_LEFT, "Frames to go: %d",frameleft); + fnt->printf(5, 25, HGETEXT_LEFT, "Score: %lld",score); + fnt->printf(5, 50, HGETEXT_LEFT, "Level %d",level); + if (mode==3) + fnt->printf(5, 75, HGETEXT_LEFT, "Collisions: %d",coll); + else if (mode==2) + fnt->printf(5, 75, HGETEXT_LEFT, "Elapsed Time: %.2lf",assetime); + else + fnt->printf(5, 75, HGETEXT_LEFT, "Restarts: %d",restarts); + fnt->printf(5, 100, HGETEXT_LEFT, "Semi-Collisions: %d",semicoll); + if(mode==2) + fnt->printf(5, 125, HGETEXT_LEFT, "Multiplier: %.2lf",mult); + else + { + fnt->printf(5, 125, HGETEXT_LEFT, "Clear Range Left: %d",clrtime+clrbns); + fnt->printf(5, 150, HGETEXT_LEFT, "Multiplier: %.2lf",mult); + } + } + hge->Gfx_EndScene(); + if(hge->Input_GetKeyStateEx(HGEK_S)==HGEKST_HIT&&Current_Position!=7)hge->System_Snapshot(); + return false; +} +void printHelp(char *exec,const char* str="") +{ + printf("Usage: %s [options]...\n",exec); + puts("To run the game normally, just start without arguments."); + puts("Options:"); + puts("--help Print this help and exit."); + puts("--version Print version and exit."); + puts("--start=x,y Start free play mode directly from level x part y. The part must be valid."); + puts("--nosound Forcibly use no sound."); + puts("--fullscreen=1/0 Forcibly use fullscreen/windowed. This will override your configuration."); + puts("--vidmode=0~4 Forcibly use specific video mode instead the one in the configuration."); + puts(" 0 800x600 (native resolution)"); + puts(" 1 640x480"); + puts(" 2 960x720"); + puts(" 3 1024x768"); + puts(" 4 1280x960"); + puts("--firststartup Forcibly run first start up. The score file will be preserved if exist."); + puts("--fast Fast mode. All levels are two times shorter."); + puts("--logfile=... Use an alternate log file name instead of the default \"BLRLOG.txt\"."); +#ifdef WIN32 + puts("--nohideconsole Do not hide console.\n"); +#endif + if(strcmp(str,""))printf("%s\n",str); + exit(0); +} +void parseArgs(int argc,char *argv[]) +{ + for(int i=1;i<argc;++i) + { + if(!strcmp(argv[i],"--help"))printHelp(argv[0]); + if(!strcmp(argv[i],"--version")) + { + printf("Bullet Lab Remix II %s\n",BLRVERSION); + printf("Built Date: %s\n",BuiltDate); + exit(0); + } + bool valid=false; + if(!strcmp(argv[i],"--nosound"))fNoSound=true,valid=true; + if(!strcmp(argv[i],"--fast"))fFast=true,valid=true; + if(!strcmp(argv[i],"--firststartup"))fFristStartUp=true,valid=true; + if(!strncmp(argv[i],"--fullscreen",12)) + { + char *ptr=argv[i];while(*ptr!='='&&*ptr)++ptr; + if(!*ptr)printHelp(argv[0],"--fullscreen need a parameter!\n"); + ++ptr; + int para=strtol(ptr,&ptr,10); + if(*ptr||(para!=1&¶!=0))printHelp(argv[0],"Invalid parameter for --fullscreen!\n"); + if(para)fFullScreen=2;else fFullScreen=1; + valid=true; + } + if(!strncmp(argv[i],"--vidmode",9)) + { + char *ptr=argv[i];while(*ptr!='='&&*ptr)++ptr; + if(!*ptr)printHelp(argv[0],"--vidmode need a parameter!\n"); + ++ptr; + int para=strtol(ptr,&ptr,10); + if(*ptr||(para<0||para>4))printHelp(argv[0],"Invalid parameter for --vidmode!\n"); + if(para)VidMode=para; + valid=true; + } + if(!strncmp(argv[i],"--start",7)) + { + char *ptr=argv[i];while(*ptr!='='&&*ptr)++ptr; + if(!*ptr)printHelp(argv[0],"--start need two parameters!"); + ++ptr;startLvl=strtol(ptr,&ptr,10); + if(*ptr!=',')printHelp(argv[0],"Invalid parameter for --start!\n"); + ++ptr;startPrt=strtol(ptr,&ptr,10); + if(*ptr)printHelp(argv[0],"Invalid parameter for --start!\n"); + valid=true; + } + if(!strncmp(argv[i],"--logfile",9)) + { + char *ptr=argv[i];while(*ptr!='='&&*ptr)++ptr; + if(!*ptr)printHelp(argv[0],"--logfile need a parameter!"); + ++ptr;strcpy(alterLog,ptr); + valid=true; + } +#ifdef WIN32 + if(!strncmp(argv[i],"--nohideconsole",15))noHideConsole=true,valid=true; +#endif + if(!valid) + { + char err[256];sprintf(err,"Unknown option: %s\n",argv[i]); + printHelp(argv[0],err); + } + } +} +int main(int argc,char *argv[]) +{ + signal(SIGSEGV,SigHandler); + parseArgs(argc,argv); +#ifdef WIN32 + if(!noHideConsole)FreeConsole(); +#endif + srand(time(NULL)); + hge=hgeCreate(HGE_VERSION); + if(alterLog[0]) + hge->System_SetState(HGE_LOGFILE, alterLog); + else + hge->System_SetState(HGE_LOGFILE, "BLRLOG.txt"); + hge->System_Log("%s: Bullet Lab Remix Log File",MAIN_SRC_FN); +#ifdef WIN32 +#ifdef MINGW_BUILD + hge->System_Log("%s: Build: MinGW_w64 cross build",MAIN_SRC_FN); +#else + hge->System_Log("%s: Build: Win32 build",MAIN_SRC_FN); +#endif +#else + hge->System_Log("%s: Build: Unix build",MAIN_SRC_FN); +#endif + hge->System_Log("%s: Version: %s",MAIN_SRC_FN,BLRVERSION); + hge->System_Log("%s: Built Date: %s",MAIN_SRC_FN,BuiltDate); +#ifdef WIN32 + if (_mkdir("./Resources")!=0||_mkdir("./Resources/Music")!=0) + Error("Cannot decompress resources!\nDetailed Information: An error occured while creating folder.\n\nTry restarting the game."); + hge->System_Log("%s: Folders created successfully.",MAIN_SRC_FN); + Expand("BLRData.dtp","Resources"); + Expand("BLRMusic.dtp","Resources/Music"); + hge->System_Log("%s: Resources decompressed successfully.",MAIN_SRC_FN); +#endif + hge->System_SetState(HGE_FRAMEFUNC, FrameFunc); + hge->System_SetState(HGE_FOCUSLOSTFUNC, Foclost); + hge->System_SetState(HGE_DONTSUSPEND, true); + hge->System_SetState(HGE_TITLE, "Bullet Lab Remix"); + hge->System_SetState(HGE_WINDOWED, true); + hge->System_SetState(HGE_SCREENWIDTH, 800); + hge->System_SetState(HGE_SCREENHEIGHT, 600); + hge->System_SetState(HGE_SCREENBPP, 32); + if(fNoSound)hge->System_SetState(HGE_USESOUND,false); +#ifdef WIN32 + hge->System_SetState(HGE_ICON, MAKEINTRESOURCE(1)); +#endif + if((access(".blrrc",R_OK))==-1) + { + hge->System_Log("%s: Config file not found. Calling first startup.",MAIN_SRC_FN); + firststartup(); + } + if(fFristStartUp)firststartup(); + hge->System_Log("%s: Loading config file",MAIN_SRC_FN); + freopen(".blrrc","r",stdin); + char tch=getchar(); + if (tch!=';'){} + tch=getchar(); + if (tch!='C'){} + tch=getchar(); + if (tch!='B'){} + tch=getchar(); + if (tch!='L'){} + fpslvl=0; + LOWFPS=true;//always LowFPS, deprecate 1000 FPS mode... + hge->System_SetState(HGE_FPS,61); + tch=getchar();//VSync + if (tch==1) + { + hge->System_SetState(HGE_FPS,HGEFPS_VSYNC); + fpslvl=2; + } + if(fFast)TenSeconds/=2,TwentySeconds/=2,ThirtySeconds/=2,AMinute/=2; + tch=getchar();//FULLSCRREEN + tfs=false; + if (tch==1) + hge->System_SetState(HGE_WINDOWED, false),tfs=true; + if(fFullScreen==2)hge->System_SetState(HGE_WINDOWED, false),tfs=true; + if(fFullScreen==1)hge->System_SetState(HGE_WINDOWED, true),tfs=false; + tch=getchar();//resolution + if(VidMode==-1)VidMode=tch; + switch(VidMode) + { + case 0:break; + case 1: + hge->System_SetState(HGE_SCREENWIDTH, 640); + hge->System_SetState(HGE_SCREENHEIGHT, 480); + break; + case 2: + hge->System_SetState(HGE_SCREENWIDTH, 960); + hge->System_SetState(HGE_SCREENHEIGHT, 720); + break; + case 3: + hge->System_SetState(HGE_SCREENWIDTH, 1024); + hge->System_SetState(HGE_SCREENHEIGHT, 768); + break; + case 4: + hge->System_SetState(HGE_SCREENWIDTH, 1280); + hge->System_SetState(HGE_SCREENHEIGHT, 960); + break; + } + scale=VidMode?VidMode==1?0.8:VidMode==2?1.2:VidMode==3?1.28:VidMode==4?1.6:0:1; +#ifndef WIN32 + yos=VidMode?VidMode==1?120:VidMode==2?-120:VidMode==3?-168:VidMode==4?-360:0:0; +#endif + tch=getchar();//Key binding + if (tch==1)diffkey=true; + bgmvol=getchar();sfxvol=getchar(); + plrspd=tch=getchar(); + playerfulspd=(tch)*0.08f; + playerspeed=playerfulspd; + plrslospd=tch=getchar(); + playerfulslospd=(tch)*0.02f; + playerslospeed=playerfulslospd; + tch=getchar(); + clrbns=tch; + tch=getchar(); + clrmode=tch; + fclose(stdin); + if (AP_Update(plrspd,plrslospd,clrbns)>10000)Error("Invalid configuration!\nTry removing .blrrc and run the game again."); + hge->System_Log("%s: Loading Score file",MAIN_SRC_FN); + Score_Init(); +#ifdef Debug + playerspeed=playerfulspd=0.2; + playerslospeed=playerfulslospd=0.05; +#endif + Current_Position=0; + LE_Active=false; + if(hge->System_Initiate()) + { + hge->System_Log("%s: Loading Resources...",MAIN_SRC_FN); + quad.tex=hge->Texture_Load("./Resources/b_null.png"); + SprSheet=hge->Texture_Load("./Resources/ss.png"); + TLeaf=hge->Texture_Load("./Resources/e_leaf.png"); + TSflake=hge->Texture_Load("./Resources/e_sflake.png"); + TexTitle=hge->Texture_Load("./Resources/title.png"); + TexCredits=hge->Texture_Load("./Resources/credits.png"); + MenuTex=hge->Texture_Load("./Resources/menus.png"); + HelpTex=hge->Texture_Load("./Resources/help.png"); + sky.Init(); + snd=hge->Effect_Load("./Resources/tap.ogg"); + menumov=hge->Effect_Load("./Resources/tap.ogg"); + menuin=hge->Effect_Load("./Resources/tap.ogg"); + menuout=hge->Effect_Load("./Resources/tap.ogg"); + if(!quad.tex||!SprSheet||!TexTitle||!TexCredits) + Error("Error Loading Resources!",true); + titlespr=new hgeSprite(TexTitle,0,0,640,320); + playerspr=new hgeSprite(SprSheet,0,24,24,24); + playerspr->SetHotSpot(12,12); + playerspr->SetColor(0xC0FFFFFF); + ATarg.Init(-0.001,vector2d(400,300)); + BTarg.Init(-0.001,vector2d(400,300)); + BTarg.targspr->SetColor(0xFFC00000); + quad.blend=BLEND_ALPHABLEND | BLEND_COLORMUL | BLEND_NOZWRITE; + DBGColor=0xFFFFFFFF; + for(int i=0;i<4;i++) + { + quad.v[i].z=0.5f; + quad.v[i].col=DBGColor; + } + quad.v[0].x=0; quad.v[0].y=0; + quad.v[1].x=800; quad.v[1].y=0; + quad.v[2].x=800; quad.v[2].y=600; + quad.v[3].x=0; quad.v[3].y=600; + hge->System_Log("%s: Loading Fonts...",MAIN_SRC_FN); +#ifdef WIN32 + if(!rbPanelFont.Init("C:/Windows/Fonts/cour.ttf",18))return 1; +#else + if(!rbPanelFont.Init("/usr/share/fonts/truetype/freefont/FreeMono.ttf",18)) + if(!rbPanelFont.Init("/usr/share/fonts/TTF/FreeMono.ttf",18))return 1; +#endif + fnt=new hgeFont("./Resources/charmap.fnt"); + MenuFont=new hgeFont("./Resources/charmap.fnt"); + TipFont=new hgeFont("./Resources/charmap.fnt"); + MultFnt=new hgeFont("./Resources/charmap.fnt"); + vdig=new hgeFont("./Resources/vdig.fnt"); + bdig=new hgeFont("./Resources/bdig.fnt"); + fnt->SetScale(0.8); + MenuFont->SetScale(0.8); + TipFont->SetScale(0.8); + MultFnt->SetScale(0.8); + spr=new hgeSprite(SprSheet,216,0,24,24); + Credits=new hgeSprite(TexCredits,0,0,600,200); + CreditsRail=new hgeSprite(TexCredits,0,2400,600,200); + Helpspr=new hgeSprite(HelpTex,0,0,800,400); + NHelpspr=new hgeSprite(HelpTex,0,0,800,400); + HlpL=new hgeSprite(MenuTex,256,320,26,15); + HlpR=new hgeSprite(MenuTex,256,335,26,15); + for (int ii=0;ii<COLOR_COUNT;++ii) + { + TColors i=(TColors)ii; + TextureRect a=GetTextureRect(0,i); + bulletspr[i]=new hgeSprite(SprSheet,a.x,a.y,a.w,a.h); + bulletspr[i]->SetHotSpot(12,12);bulletspr[i]->SetColor(0x80FFFFFF); + } + for (int ii=0;ii<grey;++ii) + { + TColors i=(TColors)ii; + TextureRect a=GetTextureRect(1,i); + towerspr[i]=new hgeSprite(SprSheet,a.x,a.y,a.w,a.h); + towerspr[i]->SetHotSpot(22,22);bulletspr[i]->SetColor(0x80FFFFFF); + } + mainMenu.Init_Once();if(!startLvl)mainMenu.Init(-200); + startMenu.Init_Once();optionMenu.Init_Once(); + pauseMenu.Init_Once();returnToTitleMenu.Init_Once(); + deathMenu.Init_Once();completeMenu.Init_Once(); + playerPreferenceMenu.Init_Once();highScoreMenu.Init_Once(); + highScoreViewMenu.Init_Once();highScoreDetailsMenu.Init_Once(); + if(fNoSound)hge->System_Log("%s: Sound is disabled.",MAIN_SRC_FN); + if(startLvl) + { + hge->System_Log("%s: Starting from Level%dPart%d",MAIN_SRC_FN,startLvl,startPrt); + playerpos.x=400,playerpos.y=400,playerrot=0; + frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false; + level=startLvl,part=startPrt;frms=0,averfps=0.0;bsscale=1;DBGColor=0xFF000000; + if(bullet){free(bullet);bullet=NULL;} + towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false; + score=0;Mult_Init();Music_Init("./Resources/Music/BLR2_TR07.ogg"); + lpst=0;lped=0;Music_Play(); + coll=semicoll=clrusg=0;playerLockX=playerLockY=false; + Lock.Init(2);IfShowTip=true;lsc=0; + clrrad=pi/2;clrrange=0;re.SetSeed(time(NULL)); + memset(tower,0,sizeof(tower)); + Complete=false;Current_Position=1; + IfCallLevel=true; + mode=3; + } + hge->System_Start(); + delete titlespr;delete fnt; + delete playerspr;delete spr; + for (int ii=0;ii<COLOR_COUNT;++ii) + { + TColors i=(TColors)ii; + delete bulletspr[i]; + if(i<grey)delete towerspr[i]; + } + hge->Effect_Free(snd);hge->Effect_Free(menuin); + hge->Effect_Free(menuout);hge->Effect_Free(menumov); + hge->Texture_Free(SprSheet);hge->Texture_Free(TLeaf); + hge->Texture_Free(quad.tex);hge->Texture_Free(TSflake); + hge->Texture_Free(TexTitle);hge->Texture_Free(TexCredits); + if(bullet){free(bullet);bullet=NULL;} + } + hge->System_Shutdown(); + hge->Release(); +#ifdef WIN32 + for(int i=0;i<arFilecount;++i)remove(archive[i]); + _rmdir("./Resources/Music"); + _rmdir("./Resources"); +#endif + return 0; +} diff --git a/archive/blr2/src/menus.h b/archive/blr2/src/menus.h new file mode 100644 index 0000000..30d8b0a --- /dev/null +++ b/archive/blr2/src/menus.h @@ -0,0 +1,1536 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Menu Implementations +// Copyright Chrisoft 2014 +// The menu rewrite is almost complete... +//static const char* MENUS_H_FN="menus.h"; +void TriggerSound(int type) +{ + switch(type) + { + case 0:hge->Effect_PlayEx(menumov,sfxvol/15.0,0,1,false);break; + case 1:hge->Effect_Play(menuin);break; + case 2:hge->Effect_Play(menuout);break; + } +} +void ConfigureQuad(hgeQuad *quad,double x,double y,double w,double h) +{ + quad->tex=0;quad->blend=BLEND_ALPHABLEND; + quad->v[0].tx=0;quad->v[0].ty=0; + quad->v[1].tx=1;quad->v[1].ty=0; + quad->v[2].tx=1;quad->v[2].ty=1; + quad->v[3].tx=0;quad->v[3].ty=1; + quad->v[0].x=x;quad->v[0].y=y; + quad->v[1].x=x+w;quad->v[1].y=y; + quad->v[2].x=x+w;quad->v[2].y=y+h; + quad->v[3].x=x;quad->v[3].y=y+h; +} +int AP_Update(int plrspd,int plrslospd,int clrbns) +{ + int res=0; + if (plrspd<=4)res+=plrspd*1200;else res+=5000; + switch (plrslospd) + { + case 1:res+=4000;break; + case 2:res+=3200;break; + case 3:res+=2000;break; + case 4:res+=1500;break; + case 5:res+=700;break; + } + switch (clrbns) + { + case 0:break; + case 1:res+=1500;break; + case 2:res+=2700;break; + case 3:res+=4000;break; + case 4:res+=5500;break; + } + return res; +} +void Options_Writeback() +{ + freopen(".blrrc","w",stdout); + printf(";CBL"); + printf("%c",fpslvl==2?1:0); + printf("%c",tfs?1:0); + printf("%c",VidMode); + printf("%c",diffkey?1:0); + printf("%c%c",bgmvol,sfxvol); + printf("%c%c%c%c",plrspd,plrslospd,clrbns,clrmode); + fclose(stdout); +} +char *getRank() +{ + static char retval[256]; + //sprintf something to retval + if(mode!=2) + { + if(level<=6)sprintf(retval,"Still need more effort!"); + if(level<=3)sprintf(retval,"Try more..."); + if(level==7)sprintf(retval,"You've done it!"); + if(level==-1)sprintf(retval,"Why do you come to Earth?"); + } + else + { + if(asts>900)sprintf(retval,"Contact me immediately!!"); + if(asts<=900)sprintf(retval,"Perfect player."); + if(asts<=600)sprintf(retval,"That's awesome."); + if(asts<=450)sprintf(retval,"Not so bad..."); + if(asts<=120)sprintf(retval,"Are you kidding?"); + } + return retval; +} +static const char* MMStr[]={ + "Start", + "Highscore", + "Options", + "Help", + "About", + "Exit" +}; +static const char* OMStr[]={ + "Fullscreen", + "VSync", + "Clear Range Key", + "Resolution", + "Music Volume", + "SFX Volume", + "Player Preference", + "Save and Exit", + "On", + "Off", + "X", + "Z", + "800x600", + "640x480", + "960x720", + "1024x768", + "1280x960", + "?" +}; +static const char *PPMStr[]={ + "Moving Speed", + "Precise Moving Speed", + "Clear Range Bonus", + "Clear Range Mode", + "Ability Point", + "Back", + "Expand", + "Rotate" +}; +static const char *PMStr[]={ + "Paused...", + "Return to Game", + "Return to Title" +}; +static const char *RTTMStr[]={ + "Really?", + "I've pressed the wrong key...", + "Do return to title!" +}; +static const char *DMStr[]={ + "Continue? You score will be set to minus!", + "Continue!", + "No thanks..." +}; +static const char *CMStr[]={ + "Keep this in your highscore record?", + "Yes", + "No thanks..." +}; +static const char *HSMStr[]={ + "Classic Mode", + "Assessment Mode", + "Free Play Mode", + "Back" +}; +class MainMenu +{ +private: + bool active,onIn,onOut; + int selected; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + xoffset=start;onIn=true;active=true; + selected=0;dyoffset=yoffset=-selected*30; + ConfigureQuad(&UpperGradient,xoffset-140,250,320,100); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,420,320,110); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + if(DBGColor!=0xFF0A0A0A) + { + for(int i=0;i<6;++i)DBGColor=ColorTransfer(DBGColor,0xFF0A0A0A); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + if(onIn) + { + if(fabs(xoffset-650)<hge->Timer_GetDelta()*1600)return xoffset=650,onIn=false,-1; + if(xoffset<650) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,250,320,100); + ConfigureQuad(&LowerGradient,xoffset-140,420,320,110); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<6-1)++selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=5,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(selected==4?2:1),selected; + return -1; + } + void Render() + { + for(int i=0;i<6;++i) + { + double calcy=i*30+dyoffset+360; + if(calcy>249.9&&calcy<500.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,MMStr[i]); + } + Ribb->RenderEx(xoffset-50,355,0,3,1); + Ribb->RenderEx(xoffset-50,382,0,3,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + } +}mainMenu; +class StartMenu +{ +private: + bool active,onIn,onOut; + double xoffset,yoffset,moffset; + int selected; + hgeQuad LeftGradient,RightGradient,LowerGradient; + hgeSprite *clzk,*azmt,*fpmd,*msel; +public: + bool isActive(){return active;} + void Init_Once() + { + clzk=new hgeSprite(MenuTex,0,0,256,128); + azmt=new hgeSprite(MenuTex,256,0,256,128); + fpmd=new hgeSprite(MenuTex,0,128,256,128); + msel=new hgeSprite(MenuTex,256,128,256,64); + clzk->SetHotSpot(128,64); + azmt->SetHotSpot(128,64); + fpmd->SetHotSpot(128,64); + } + void Init() + { + active=true;onIn=true;yoffset=275; + selected=0;xoffset=-selected*300;moffset=450; + ConfigureQuad(&LowerGradient,0,400+yoffset,800,120); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + ConfigureQuad(&LeftGradient,0,320+yoffset,100,200); + LeftGradient.v[0].col=LeftGradient.v[3].col=SETA(DBGColor,0xFF); + LeftGradient.v[1].col=LeftGradient.v[2].col=SETA(DBGColor,0x00); + ConfigureQuad(&RightGradient,700,320+yoffset,100,200); + RightGradient.v[0].col=RightGradient.v[3].col=SETA(DBGColor,0x00); + RightGradient.v[1].col=RightGradient.v[2].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + LeftGradient.v[0].col=LeftGradient.v[3].col=SETA(DBGColor,0xFF); + LeftGradient.v[1].col=LeftGradient.v[2].col=SETA(DBGColor,0x00); + RightGradient.v[0].col=RightGradient.v[3].col=SETA(DBGColor,0x00); + RightGradient.v[1].col=RightGradient.v[2].col=SETA(DBGColor,0xFF); + if(onIn) + { + bool alldone=true; + if(fabs(yoffset-0)<hge->Timer_GetDelta()*800) + yoffset=0; + else + alldone=false,yoffset-=hge->Timer_GetDelta()*800; + if(fabs(moffset-0)<hge->Timer_GetDelta()*1200) + moffset=0; + else alldone=false,moffset-=hge->Timer_GetDelta()*1200; + if(alldone)onIn=false; + } + if(onOut) + { + bool alldone=true; + if(fabs(yoffset-275)<hge->Timer_GetDelta()*800) + yoffset=275; + else + alldone=false,yoffset+=hge->Timer_GetDelta()*800; + if(fabs(moffset-450)<hge->Timer_GetDelta()*1200) + moffset=450; + else alldone=false,moffset+=hge->Timer_GetDelta()*800; + if(alldone)onOut=active=false; + } + if(hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT&&selected>0)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT&&selected<3-1)++selected,TriggerSound(0); + if(fabs(xoffset-(-selected*300))<hge->Timer_GetDelta()*1000) + xoffset=-selected*300; + else + { + if(xoffset<-selected*300)xoffset+=hge->Timer_GetDelta()*1000; + if(xoffset>-selected*300)xoffset-=hge->Timer_GetDelta()*1000; + } + ConfigureQuad(&LowerGradient,0,400+yoffset,800,120); + ConfigureQuad(&LeftGradient,0,320+yoffset,100,200); + ConfigureQuad(&RightGradient,700,320+yoffset,100,200); + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)TriggerSound(2); + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(1),selected; + return -1; + } + void Render() + { + clzk->Render(400+xoffset,fabs((xoffset+0))*0.075+400+yoffset); + azmt->Render(700+xoffset,fabs((xoffset+300))*0.075+400+yoffset); + fpmd->Render(1000+xoffset,fabs((xoffset+600))*0.075+400+yoffset); + hge->Gfx_RenderQuad(&LowerGradient); + hge->Gfx_RenderQuad(&LeftGradient); + hge->Gfx_RenderQuad(&RightGradient); + msel->Render(0,moffset+200); + } +}startMenu; +class OptionsMenu +{ +private: + bool active,onIn,onOut,onSwitch,onSwitchi; + int selected; + double xoffset,yoffset,dyoffset,swoffset,moffset; + hgeSprite *Ribb,*optt; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + optt=new hgeSprite(MenuTex,256,192,256,64); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + xoffset=start;onIn=active=true;onSwitch=onSwitchi=false; + selected=0;dyoffset=yoffset=-selected*30;moffset=350; + ConfigureQuad(&UpperGradient,xoffset-140,250,500,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,430,500,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + if(onIn) + { + bool alldone=true; + if(fabs(xoffset-450)<hge->Timer_GetDelta()*1600)xoffset=450;else + { + alldone=false; + if(xoffset<450) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(fabs(moffset-0)<hge->Timer_GetDelta()*1200) + moffset=0; + else alldone=false,moffset-=hge->Timer_GetDelta()*1200; + if(alldone)return onIn=false,-1; + } + if(onOut) + { + bool alldone=true; + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset<850)alldone=false; + if(fabs(moffset-450)<hge->Timer_GetDelta()*1200) + moffset=450; + else alldone=false,moffset+=hge->Timer_GetDelta()*800; + if(alldone)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,250,500,100); + ConfigureQuad(&LowerGradient,xoffset-140,430,500,100); + if(!onSwitch) + { + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<8-1)++selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=7,TriggerSound(0); + } + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT&&hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT)return -1; + if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + { + if(selected==7&&!(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT)) + return -1; + TriggerSound(selected==7?2:0); + if(onSwitch||onSwitchi)return -1; + if(selected<=5) + { + onSwitch=true; + swoffset=100; + } + if(selected==0)tfs=!tfs; + if(selected==1) + { + fpslvl=fpslvl==2?0:2; + if(fpslvl==2)hge->System_SetState(HGE_FPS,HGEFPS_VSYNC); + if(fpslvl==0)hge->System_SetState(HGE_FPS,61); + } + if(selected==2)diffkey=!diffkey; + if(selected==3) + { + ++VidMode; + if(VidMode>4)VidMode=0; + } + if(selected==4) + { + ++bgmvol; + if(bgmvol>15)bgmvol=0; + } + if(selected==5) + { + ++sfxvol; + if(sfxvol>15)sfxvol=0; + } + return selected; + } + if(hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT) + { + if(onSwitch||onSwitchi)return -1; + TriggerSound(0); + if(selected<=5){onSwitchi=true;swoffset=0;} + if(selected==0)tfs=!tfs; + if(selected==1) + { + fpslvl=fpslvl==2?0:2; + if(fpslvl==2)hge->System_SetState(HGE_FPS,HGEFPS_VSYNC); + if(fpslvl==0)hge->System_SetState(HGE_FPS,61); + } + if(selected==2)diffkey=!diffkey; + if(selected==3) + { + --VidMode; + if(VidMode<0)VidMode=4; + } + if(selected==4) + { + --bgmvol; + if(bgmvol<0)bgmvol=15; + } + if(selected==5) + { + --sfxvol; + if(sfxvol<0)sfxvol=15; + } + return selected; + } + return -1; + } + void Render() + { + for(int i=0;i<8;++i) + { + double calcy=i*30+dyoffset+360; + if(calcy>249.9&&calcy<500.1) + { + MenuFont->SetColor(0xFFFFFFFF); + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,OMStr[i]); + if(i==0) + { + if(!(onSwitch||onSwitchi)||selected!=0) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,OMStr[tfs?8:9]); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,OMStr[tfs?9:8]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,OMStr[tfs?8:9]); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,OMStr[tfs?8:9]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,OMStr[tfs?9:8]); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==1) + { + if(!(onSwitch||onSwitchi)||selected!=1) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,OMStr[fpslvl==2?8:9]); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,OMStr[fpslvl==2?9:8]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,OMStr[fpslvl==2?8:9]); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,OMStr[fpslvl==2?8:9]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,OMStr[fpslvl==2?9:8]); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==2) + { + if(!(onSwitch||onSwitchi)||selected!=2) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,OMStr[diffkey?10:11]); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,OMStr[diffkey?11:10]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,OMStr[diffkey?10:11]); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,OMStr[diffkey?10:11]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,OMStr[diffkey?11:10]); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==3) + { + if(!(onSwitch||onSwitchi)||selected!=3) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,VidMode>=0&&VidMode<=4?OMStr[VidMode+12]:OMStr[17]); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,VidMode>=0&&VidMode<=4?OMStr[VidMode==0?16:VidMode+11]:OMStr[17]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,VidMode>=0&&VidMode<=4?OMStr[VidMode+12]:OMStr[17]); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,VidMode>=0&&VidMode<=4?OMStr[VidMode+12]:OMStr[17]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,VidMode>=0&&VidMode<=4?OMStr[VidMode==4?12:VidMode+13]:OMStr[17]); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==4) + { + if(!(onSwitch||onSwitchi)||selected!=4) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,"%d",bgmvol); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",bgmvol==0?15:bgmvol-1); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",bgmvol); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",bgmvol); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",bgmvol==15?0:bgmvol+1); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==5) + { + if(!(onSwitch||onSwitchi)||selected!=5) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,"%d",sfxvol); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",sfxvol==0?15:sfxvol-1); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",sfxvol); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",sfxvol); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",sfxvol==15?0:sfxvol+1); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + } + } + Ribb->RenderEx(xoffset-50,353,0,6,1); + Ribb->RenderEx(xoffset-50,380,0,6,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + optt->Render(300,moffset+300); + } +}optionMenu; +class PlayerPreferenceMenu +{ +private: + bool active,onIn,onOut,onSwitch,onSwitchi; + int selected; + double xoffset,yoffset,dyoffset,swoffset,moffset; + double shaketime,shakeoffset,shakedelay; + hgeSprite *Ribb,*optt; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + optt=new hgeSprite(MenuTex,0,256,256,64); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + xoffset=start;onIn=active=true;onSwitch=onSwitchi=false; + selected=0;dyoffset=yoffset=-selected*30;moffset=350;shaketime=0; + ConfigureQuad(&UpperGradient,xoffset-140,250,520,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,430,520,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + void Shake(){shaketime=0.2;shakeoffset=10;shakedelay=0.033;} + int Update() + { + if(onIn) + { + bool alldone=true; + if(fabs(xoffset-430)<hge->Timer_GetDelta()*1600)xoffset=430;else + { + alldone=false; + if(xoffset<430) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(fabs(moffset-0)<hge->Timer_GetDelta()*1200) + moffset=0; + else alldone=false,moffset-=hge->Timer_GetDelta()*1200; + if(alldone)return onIn=false,-1; + } + if(onOut) + { + bool alldone=true; + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset<850)alldone=false; + if(fabs(moffset-450)<hge->Timer_GetDelta()*1200) + moffset=450; + else alldone=false,moffset+=hge->Timer_GetDelta()*800; + if(alldone)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,250,520,100); + ConfigureQuad(&LowerGradient,xoffset-140,430,520,100); + if(!onSwitch) + { + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0) + TriggerSound(0),--selected==4?--selected:0; + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<6-1) + TriggerSound(0),++selected==4?++selected:0; + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)TriggerSound(0),selected=5; + } + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT&&hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT)return -1; + if(hge->Input_GetKeyStateEx(HGEK_RIGHT)==HGEKST_HIT) + { + TriggerSound(1); + if(onSwitch||onSwitchi)return -1; + if(selected<=3) + { + onSwitch=true; + swoffset=100; + } + if(selected==0)++plrspd>5?plrspd=1:0; + if(selected==1)++plrslospd>5?plrslospd=1:0; + if(selected==2)++clrbns>4?clrbns=0:0; + if(selected==3)clrmode=!clrmode; + if(selected<=3)return selected; + } + if(hge->Input_GetKeyStateEx(HGEK_LEFT)==HGEKST_HIT) + { + TriggerSound(1); + if(onSwitch||onSwitchi)return -1; + if(selected<=3){onSwitchi=true;swoffset=0;} + if(selected==0)--plrspd<1?plrspd=5:0; + if(selected==1)--plrslospd<1?plrslospd=5:0; + if(selected==2)--clrbns<0?clrbns=4:0; + if(selected==3)clrmode=!clrmode; + if(selected<=3)return selected; + } + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(selected==5?2:1),selected; + return -1; + } + void Render() + { + for(int i=0;i<6;++i) + { + double calcy=i*30+dyoffset+360; + if(calcy>249.9&&calcy<500.1) + { + MenuFont->SetColor(0xFFFFFFFF); + MenuFont->printf(xoffset-50,calcy,HGETEXT_LEFT,PPMStr[i]); + if(i==0) + { + if(!(onSwitch||onSwitchi)||selected!=0) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,"%d",plrspd); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",plrspd==1?5:plrspd-1); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",plrspd); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",plrspd); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",plrspd==5?1:plrspd+1); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==1) + { + if(!(onSwitch||onSwitchi)||selected!=1) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,"%d",plrslospd); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",plrslospd==1?5:plrslospd-1); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",plrslospd); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",plrslospd); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",plrslospd==5?1:plrslospd+1); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==2) + { + if(!(onSwitch||onSwitchi)||selected!=2) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,"%d",clrbns); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",clrbns==0?4:clrbns-1); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",clrbns); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,"%d",clrbns); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,"%d",clrbns==4?0:clrbns+1); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==3) + { + if(!(onSwitch||onSwitchi)||selected!=3) + MenuFont->printf(xoffset+200,calcy,HGETEXT_LEFT,PPMStr[clrmode?7:6]); + else + { + if(onSwitch) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,PPMStr[clrmode?6:7]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,PPMStr[clrmode?7:6]); + swoffset-=hge->Timer_GetDelta()*400; + if(swoffset<0)swoffset=0,onSwitch=false; + } + if(onSwitchi) + { + MenuFont->SetColor(SETA(0xFFFFFF,255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+100+swoffset,calcy,HGETEXT_LEFT,PPMStr[clrmode?7:6]); + MenuFont->SetColor(SETA(0xFFFFFF,255.0f-255.0f*(swoffset/100.0f))); + MenuFont->printf(xoffset+200+swoffset,calcy,HGETEXT_LEFT,PPMStr[clrmode?6:7]); + swoffset+=hge->Timer_GetDelta()*400; + if(swoffset>100)swoffset=0,onSwitchi=false; + } + } + } + if(i==4) + { + if(shaketime>0) + { + shaketime-=hge->Timer_GetDelta(); + shakedelay-=hge->Timer_GetDelta(); + if(shakedelay<0) + {shakeoffset=-shakeoffset;shakedelay=0.033;} + if(shaketime<=0)shaketime=shakeoffset=0; + } + MenuFont->printf(xoffset+200+shakeoffset,calcy,HGETEXT_LEFT,"%d/10000",AP_Update(plrspd,plrslospd,clrbns)); + } + } + } + Ribb->RenderEx(xoffset-80,355,0,7,1); + Ribb->RenderEx(xoffset-80,382,0,7,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + optt->Render(125,moffset+300); + } +}playerPreferenceMenu; +class PauseMenu +{ +private: + bool active,onIn,onOut; + int selected; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + //special things to do.. + Music_Pause(); + Current_Position=11; + DisableAllTower=DisablePlayer=true; + xoffset=start;onIn=true;active=true; + selected=1;dyoffset=yoffset=-selected*30; + ConfigureQuad(&UpperGradient,xoffset-140,190,320,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,340,320,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){if(!onIn)onOut=true;} + int Update() + { + if(onIn) + { + if(fabs(xoffset-350)<hge->Timer_GetDelta()*1600)return xoffset=350,onIn=false,-1; + if(xoffset<350) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850) + { + active=onOut=false; + if(selected==1)Current_Position=1,DisableAllTower=DisablePlayer=false; + return -1; + } + } + ConfigureQuad(&UpperGradient,xoffset-140,190,320,100); + ConfigureQuad(&LowerGradient,xoffset-140,340,320,110); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>1)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<3-1)++selected,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(1),selected; + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT&&!onIn)return TriggerSound(1),1; + return -1; + } + void Render() + { + for(int i=0;i<3;++i) + { + double calcy=i*30+dyoffset+300; + if(calcy>189.9&&calcy<440.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,PMStr[i]); + } + Ribb->RenderEx(xoffset-50,295,0,4,1); + Ribb->RenderEx(xoffset-50,322,0,4,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + } +}pauseMenu; +class ReturnToTitleMenu +{ +private: + bool active,onIn,onOut; + int selected; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + xoffset=start;onIn=true;active=true; + selected=1;dyoffset=yoffset=-selected*30; + ConfigureQuad(&UpperGradient,xoffset-140,190,320,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,340,320,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + //The background color is likely on a change here... + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + if(onIn) + { + if(fabs(xoffset-350)<hge->Timer_GetDelta()*1600)return xoffset=350,onIn=false,-1; + if(xoffset<350) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,190,320,100); + ConfigureQuad(&LowerGradient,xoffset-140,340,320,110); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>1)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<3-1)++selected,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(1),selected; + return -1; + } + void Render() + { + for(int i=0;i<3;++i) + { + double calcy=i*30+dyoffset+300; + if(calcy>189.9&&calcy<440.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,RTTMStr[i]); + } + Ribb->RenderEx(xoffset-50,295,0,6.5,1); + Ribb->RenderEx(xoffset-50,322,0,6.5,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + } +}returnToTitleMenu; +class DeathMenu +{ +private: + bool active,onIn,onOut; + int selected; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb,*DeathTitle; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + DeathTitle=new hgeSprite(MenuTex,256,256,256,64); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + //Magical things, again... + Current_Position=5;Music_Stop(); + DisableAllTower=true;DisablePlayer=true; + xoffset=start;onIn=true;active=true; + selected=1;dyoffset=yoffset=-selected*30; + ConfigureQuad(&UpperGradient,xoffset-140,290,600,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + //The background color is likely on a change here... + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + if(onIn) + { + if(fabs(xoffset-300)<hge->Timer_GetDelta()*1600)return xoffset=300,onIn=false,-1; + if(xoffset<300) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,290,600,100); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,110); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>1)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<3-1)++selected,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(1),selected; + return -1; + } + void Render() + { + for(int i=0;i<3;++i) + { + double calcy=i*30+dyoffset+400; + if(calcy>289.9&&calcy<540.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,DMStr[i]); + } + Ribb->RenderEx(xoffset-50,395,0,3.75,1); + Ribb->RenderEx(xoffset-50,422,0,3.75,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + MenuFont->printf(xoffset-100,250,HGETEXT_LEFT,"You scored %lld at level %d",score,level); + MenuFont->printf(xoffset-100,280,HGETEXT_LEFT,"Average FPS: %lf\n",averfps); + DeathTitle->Render(xoffset-200,200); + } +}deathMenu; +class CompleteMenu +{ +private: + bool active,onIn,onOut; + int selected; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb,*CompleteTitle; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + CompleteTitle=new hgeSprite(MenuTex,0,320,256,64); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + //Magical things, again... + Current_Position=6;Music_Stop(); + DisableAllTower=true;DisablePlayer=true; + xoffset=start;onIn=true;active=true; + selected=1;dyoffset=yoffset=-selected*30; + ConfigureQuad(&UpperGradient,xoffset-140,390,600,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,540,600,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + //The background color is likely on a change here... + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + if(onIn) + { + if(fabs(xoffset-300)<hge->Timer_GetDelta()*1600)return xoffset=300,onIn=false,-1; + if(xoffset<300) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,390,600,100); + ConfigureQuad(&LowerGradient,xoffset-140,540,600,110); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>1)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<3-1)++selected,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(1),selected; + return -1; + } + void Render() + { + for(int i=0;i<3;++i) + { + double calcy=i*30+dyoffset+500; + if(calcy>389.9&&calcy<640.1) + MenuFont->printf(xoffset-100,calcy,HGETEXT_LEFT,CMStr[i]); + } + Ribb->RenderEx(xoffset-150,495,0,3.75,1); + Ribb->RenderEx(xoffset-150,522,0,3.75,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + if(~CheckHighScore()) + MenuFont->printf(xoffset-100,250,HGETEXT_LEFT,"New Highscore %lld!",score); + else + MenuFont->printf(xoffset-100,250,HGETEXT_LEFT,"Score %lld",score); + MenuFont->printf(xoffset-100,280,HGETEXT_LEFT,"Your Ranking: %s",getRank()); + if(mode==2) + { + MenuFont->printf(xoffset-100,310,HGETEXT_LEFT,"Time elapsed: %.2fs",((int)(asts*100))/100.0); + MenuFont->printf(xoffset-100,340,HGETEXT_LEFT,"Semi-collisions %d",semicoll); + MenuFont->printf(xoffset-100,370,HGETEXT_LEFT,"Average FPS: %.2f",averfps); + } + else + { + if(mode==1) + MenuFont->printf(xoffset-100,310,HGETEXT_LEFT,"Restarts %d",restarts); + else + MenuFont->printf(xoffset-100,310,HGETEXT_LEFT,"Collisions %d",coll); + MenuFont->printf(xoffset-100,340,HGETEXT_LEFT,"Semi-collisions %d",semicoll); + MenuFont->printf(xoffset-100,370,HGETEXT_LEFT,"CLR Usage %d",clrusg); + MenuFont->printf(xoffset-100,400,HGETEXT_LEFT,"Average FPS: %.2f",averfps); + } + CompleteTitle->Render(xoffset-200,200); + } +}completeMenu; +class NewHighScoreGUI +{ +private: + bool active,onIn,onOut,toogleundl; + double xoffset; + void nameins(char a) + { + if (newlen<=14) + newname[newlen++]=a; + } + void namedel() + { + if (newlen>0)newname[--newlen]=0; + } +public: + bool isActive(){return active;} + void Init() + { + Current_Position=7;active=true; + memset(newname,0,sizeof(newname));newlen=0;tbframebrk=0;toogleundl=false; + TipFont->SetColor(0xFFFFFFFF);xoffset=-500;onIn=true;onOut=false; + } + void Leave(){onOut=true;} + void Update() + { + if(onIn) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>0)xoffset=0,onIn=false; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>650)onOut=active=false; + } + int key=hge->Input_GetKey(); + if (key>=0x30&&key<=0x39)nameins('0'+key-0x30); + #ifdef WIN32 + if (key>=0x41&&key<=0x5A) + if (GetKeyState(VK_CAPITAL)&1)nameins('A'+key-0x41);else nameins('a'+key-0x41); + #else + if (key>=0x41&&key<=0x5A) + nameins('A'+key-0x41); + #endif + if (key==HGEK_SPACE)nameins('_'); + if (key==HGEK_BACKSPACE)namedel(); + if (key==HGEK_ENTER) + { + TriggerSound(1); + InsertHighScore();Leave(); + Current_Position=0;mainMenu.Init(-200); + /*switch (mode) + { + case 4:view=1;HSViewGUI_Init();break; + case 1:view=2;HSViewGUI_Init();break; + case 2:view=3;HSViewGUI_Init();break; + case 3:view=4;HSViewGUI_Init();break; + }*/ + } + } + void Render() + { + if (LOWFPS)tbframebrk+=17;else ++tbframebrk; + if (tbframebrk>=500)toogleundl=!toogleundl,tbframebrk=0; + TipFont->printf(200+xoffset,200,HGETEXT_LEFT,"Please Enter Your Honorable Name..."); + if (!toogleundl) + TipFont->printf(200+xoffset,240,HGETEXT_LEFT,"%s",newname); + else + TipFont->printf(200+xoffset,240,HGETEXT_LEFT,"%s_",newname); + } +}newHighScoreGUI; +class HighScoreMenu +{ +private: + bool active,onIn,onOut; + int selected; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb,*HSTitle; + hgeQuad UpperGradient,LowerGradient; +public: + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + HSTitle=new hgeSprite(MenuTex,0,376,256,64); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start) + { + xoffset=start;onIn=true;active=true; + selected=0;dyoffset=yoffset=-selected*30; + ConfigureQuad(&UpperGradient,xoffset-140,290,600,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,100); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + if(onIn) + { + if(fabs(xoffset-500)<hge->Timer_GetDelta()*1600)return xoffset=500,onIn=false,-1; + if(xoffset<500) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,290,600,100); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,110); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<4-1)++selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=4-1,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(selected==4-1?2:1),selected; + return -1; + } + void Render() + { + for(int i=0;i<4;++i) + { + double calcy=i*30+dyoffset+400; + if(calcy>289.9&&calcy<540.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,HSMStr[i]); + } + Ribb->RenderEx(xoffset-50,395,0,4.5,1); + Ribb->RenderEx(xoffset-50,422,0,4.5,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + HSTitle->Render(xoffset-250,300); + } +}highScoreMenu; +class HighScoreViewMenu +{ +private: + bool active,onIn,onOut; + int selected,view; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb; + hgeQuad UpperGradient,LowerGradient; +public: + int View(){return view;} + int GetViewCount(){return view==0?Ncnt:view==1?Excnt:view==2?FPMcnt:0;} + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start,int _v) + { + xoffset=start;onIn=true;active=true; + selected=1;dyoffset=yoffset=-selected*30;view=_v; + ConfigureQuad(&UpperGradient,xoffset-140,290,600,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,120); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + if(onIn) + { + if(fabs(xoffset-400)<hge->Timer_GetDelta()*1600)return xoffset=400,onIn=false,-1; + if(xoffset<400) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,290,600,100); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,120); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>1)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<7-1)++selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)selected=7-1,TriggerSound(0); + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(selected==7-1?2:1),selected; + return -1; + } + void Render() + { + if(dyoffset+400>289.9) + MenuFont->printf(xoffset,dyoffset+400,HGETEXT_LEFT,"Highscore - %s",HSMStr[view]); +#define WrapCnt \ + (view==0?Ncnt:view==1?Excnt:view==2?FPMcnt:0) +#define WrapRec\ + (view==0?NRec:view==1?ExRec:view==2?FPMRec:FPMRec) + for(unsigned i=1;i<=5;++i) + { + double calcy=i*30+dyoffset+400; + if(calcy>289.9&&calcy<540.1) + { + if(i<=WrapCnt) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"%u. %s - %lld",i,WrapRec[i].name,WrapRec[i].score); + else MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"%u. ----------",i); + } + } + double calcy=6*30+dyoffset+400; + if(calcy>289.9&&calcy<540.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"back"); + Ribb->RenderEx(xoffset-50,395,0,7,1); + Ribb->RenderEx(xoffset-50,422,0,7,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + } +}highScoreViewMenu; +class HighScoreDetailsMenu +{ +private: + bool active,onIn,onOut; + int selected,view,no; + double xoffset,yoffset,dyoffset; + hgeSprite *Ribb,*HSTitle; + hgeQuad UpperGradient,LowerGradient; +public: + int View(){return view;} + bool isActive(){return active;} + void Init_Once() + { + Ribb=new hgeSprite(MenuTex,256,350,64,16); + HSTitle=new hgeSprite(MenuTex,0,448,256,64); + Ribb->SetColor(0xCCFFFFFF); + } + void Init(double start,int _v,int _n) + { + xoffset=start;onIn=true;active=true;no=_n; + selected=0;dyoffset=yoffset=-selected*30;view=_v; + ConfigureQuad(&UpperGradient,xoffset-140,290,600,50); + UpperGradient.v[0].col=UpperGradient.v[1].col=SETA(DBGColor,0xFF); + UpperGradient.v[2].col=UpperGradient.v[3].col=SETA(DBGColor,0x00); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,130); + LowerGradient.v[0].col=LowerGradient.v[1].col=SETA(DBGColor,0x00); + LowerGradient.v[2].col=LowerGradient.v[3].col=SETA(DBGColor,0xFF); + } + void Leave(){onOut=true;} + int Update() + { + if(onIn) + { + if(fabs(xoffset-400)<hge->Timer_GetDelta()*1600)return xoffset=400,onIn=false,-1; + if(xoffset<400) + xoffset+=hge->Timer_GetDelta()*1600; + else + xoffset-=hge->Timer_GetDelta()*1600; + } + if(onOut) + { + xoffset+=hge->Timer_GetDelta()*1600; + if(xoffset>=850)active=onOut=false; + } + ConfigureQuad(&UpperGradient,xoffset-140,290,600,100); + ConfigureQuad(&LowerGradient,xoffset-140,440,600,130); + if(hge->Input_GetKeyStateEx(HGEK_UP)==HGEKST_HIT&&selected>0)--selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_DOWN)==HGEKST_HIT&&selected<(view==1?6:7)-1)++selected,TriggerSound(0); + if(hge->Input_GetKeyStateEx(HGEK_ESCAPE)==HGEKST_HIT)TriggerSound(0),selected=(view==1?6:7)-1; + yoffset=-selected*30; + if(fabs(dyoffset-yoffset)<7)dyoffset=yoffset; + if(dyoffset<yoffset)dyoffset+=hge->Timer_GetDelta()*400; + if(dyoffset>yoffset)dyoffset-=hge->Timer_GetDelta()*400; + if(onIn||onOut)return -1; + if(hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT||hge->Input_GetKeyStateEx(HGEK_ENTER)==HGEKST_HIT) + return TriggerSound(selected==(view==1?5:7)-1?2:1),selected; + return -1; + } + void Render() + { +#define WrapCnt \ + (view==0?Ncnt:view==1?Excnt:view==2?FPMcnt:0) +#define WrapRec\ + (view==0?NRec:view==1?ExRec:view==2?FPMRec:FPMRec) + if(dyoffset+400>289.9) + MenuFont->printf(xoffset,dyoffset+400,HGETEXT_LEFT,"No. %d of %s",no,HSMStr[view]); + if(view==1) + { + if(dyoffset+430>289.9&&dyoffset+430<540.1) + MenuFont->printf(xoffset,dyoffset+430,HGETEXT_LEFT,"Scored %lld by %s",WrapRec[no].score,WrapRec[no].name); + if(dyoffset+460>289.9&&dyoffset+460<540.1) + MenuFont->printf(xoffset,dyoffset+460,HGETEXT_LEFT,"Time elapsed %.2fs",WrapRec[no].rescol/100.0); + if(dyoffset+490>289.9&&dyoffset+490<540.1) + MenuFont->printf(xoffset,dyoffset+490,HGETEXT_LEFT,"Semi-Collisions %d",WrapRec[no].scoll); + if(dyoffset+520>289.9&&dyoffset+520<540.1) + MenuFont->printf(xoffset,dyoffset+520,HGETEXT_LEFT,"Average FPS %d.%d",WrapRec[no].af_int,WrapRec[no].af_fric); + } + else + { + if(dyoffset+430>289.9&&dyoffset+430<540.1) + MenuFont->printf(xoffset,dyoffset+430,HGETEXT_LEFT,"Scored %lld by %s",WrapRec[no].score,WrapRec[no].name); + if(dyoffset+460>289.9&&dyoffset+460<540.1) + { + if(view==0) + MenuFont->printf(xoffset,dyoffset+460,HGETEXT_LEFT,"Restarts %d",WrapRec[no].rescol); + else + MenuFont->printf(xoffset,dyoffset+460,HGETEXT_LEFT,"Collisions %d",WrapRec[no].rescol); + } + if(dyoffset+490>289.9&&dyoffset+490<540.1) + MenuFont->printf(xoffset,dyoffset+490,HGETEXT_LEFT,"Semi-Collisions %d",WrapRec[no].scoll); + if(dyoffset+520>289.9&&dyoffset+520<540.1) + MenuFont->printf(xoffset,dyoffset+520,HGETEXT_LEFT,"CLR Usage %d",WrapRec[no].clrusg); + if(dyoffset+550>289.9&&dyoffset+550<540.1) + MenuFont->printf(xoffset,dyoffset+550,HGETEXT_LEFT,"Average FPS %d.%d",WrapRec[no].af_int,WrapRec[no].af_fric); + } + double calcy=(view==1?5:6)*30+dyoffset+400; + if(calcy>289.9&&calcy<540.1) + MenuFont->printf(xoffset,calcy,HGETEXT_LEFT,"back"); + Ribb->RenderEx(xoffset-50,395,0,6,1); + Ribb->RenderEx(xoffset-50,422,0,6,1); + hge->Gfx_RenderQuad(&UpperGradient); + hge->Gfx_RenderQuad(&LowerGradient); + HSTitle->Render(xoffset-250,300); + } +}highScoreDetailsMenu; diff --git a/archive/blr2/src/music.h b/archive/blr2/src/music.h new file mode 100644 index 0000000..ef09c41 --- /dev/null +++ b/archive/blr2/src/music.h @@ -0,0 +1,34 @@ +//Chrisoft Bullet Lab Remix HGE -*- C++ -*- +//In Game Music Implementations +//Copyright Chrisoft 2014 +HEFFECT Mus; +HCHANNEL Muc; +int lpst,lped; +//static const char* MUSIC_H_FN="music.h"; + +void Music_Init(const char* file) +{ + Mus=hge->Effect_Load(file); +} +void Music_Play() +{ + Muc=hge->Effect_PlayEx(Mus,bgmvol/15.0,0,1.0,true); +} +void Music_Update() +{ + if (!lpst||!lped)return; + int Mucpos=hge->Channel_GetPos_BySample(Muc); + if (Mucpos>=lped)hge->Channel_SetPos_BySample(Muc,lpst); +} +void Music_Stop() +{ + hge->Channel_Stop(Muc); +} +void Music_Pause() +{ + hge->Channel_Pause(Muc); +} +void Music_Resume() +{ + hge->Channel_Resume(Muc); +} diff --git a/archive/blr2/src/scorec.h b/archive/blr2/src/scorec.h new file mode 100644 index 0000000..abca9c6 --- /dev/null +++ b/archive/blr2/src/scorec.h @@ -0,0 +1,258 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Score Recording Implementations +// Copyright Chrisoft 2014 +//static const char* SCOREC_H_FN="scorec.h"; + +struct TRecord +{ + long long score; + int len,rescol,scoll,clrusg; + int af_int,af_fric; + char name[16]; +}ERec[10],NRec[10],ExRec[10],FPMRec[10]; +unsigned int Ecnt,Ncnt,Excnt,FPMcnt; +unsigned int header,seprt; +char newname[16]; +int newlen,tbframebrk; +unsigned int Getuint() +{ + unsigned int c1,c2,c3,c4,res; + c1=c2=c3=c4=0; + c1=getchar();c2=getchar();c3=getchar();c4=getchar(); + res=(c1<<24)+(c2<<16)+(c3<<8)+c4; + return res; +} +int Getint() +{ + return (int)Getuint(); +} +long long Getll() +{ + long long c1,c2,c3,c4,c5,c6,c7,c8,res; + c1=c2=c3=c4=c5=c6=c7=c8=0; + c1=getchar();c2=getchar();c3=getchar();c4=getchar(); + c5=getchar();c6=getchar();c7=getchar();c8=getchar(); + res=(c1<<56)+(c2<<48)+(c3<<40)+(c4<<32)+(c5<<24)+(c6<<16)+(c7<<8)+c8; + return res; +} +void Putuint(unsigned int a) +{ + unsigned int c1,c2,c3,c4; + c1=a&0xFF000000;c1>>=24;c2=a&0x00FF0000;c2>>=16; + c3=a&0x0000FF00;c3>>=8;c4=a&0x000000FF; + printf("%c%c%c%c",c1,c2,c3,c4); +} +void Putint(int a) +{ + Putuint((unsigned int)a); +} +void Putll(unsigned long long a) +{ + unsigned long long c1,c2,c3,c4,c5,c6,c7,c8; + c1=a&0xFF00000000000000LL;c1>>=56LL; + c2=a&0x00FF000000000000LL;c2>>=48LL; + c3=a&0x0000FF0000000000LL;c3>>=40LL; + c4=a&0x000000FF00000000LL;c4>>=32LL; + c5=a&0x00000000FF000000LL;c5>>=24LL; + c6=a&0x0000000000FF0000LL;c6>>=16LL; + c7=a&0x000000000000FF00LL;c7>>=8LL; + c8=a&0x00000000000000FFLL; + printf("%c%c%c%c%c%c%c%c",(int)c1,(int)c2,(int)c3,(int)c4,(int)c5,(int)c6,(int)c7,(int)c8); +} +TRecord GetTRecord() +{ + TRecord res; + res.len=Getint(); + memset(res.name,0,sizeof(res.name)); + for (int i=0;i<res.len;++i)scanf("%c",&res.name[i]); + res.score=Getll(); + res.rescol=Getint(); + res.scoll=Getint(); + res.clrusg=Getint(); + res.af_int=Getint();res.af_fric=Getint(); + return res; +} +void PutTRecord(TRecord a) +{ + Putint(a.len); + for (int i=0;i<a.len;++i)printf("%c",a.name[i]); + Putll(a.score); + Putint(a.rescol); + Putint(a.scoll); + Putint(a.clrusg); + Putint(a.af_int);Putint(a.af_fric); +} +void Score_Init() +{ + freopen(".blrscore","r",stdin); + header=Getuint(); + if (header!=0x3b424c53)//0x3b424c53=";BLS" + { + fclose(stdin); + Error("Error when loading score file!"); + } + seprt=Getuint(); + if (seprt!=0xd1ffa0c0) + { + fclose(stdin); + Error("Error when loading score file!"); + } + Ecnt=Getuint(); + for (unsigned int i=1;i<=Ecnt;++i)ERec[i]=GetTRecord(); + seprt=Getuint(); + if (seprt!=0xd1ffa0c1) + { + fclose(stdin); + Error("Error when loading score file!"); + } + Ncnt=Getuint(); + for (unsigned int i=1;i<=Ncnt;++i)NRec[i]=GetTRecord(); + seprt=Getuint(); + if (seprt!=0xd1ffa0c2) + { + fclose(stdin); + Error("Error when loading score file!"); + } + Excnt=Getuint(); + for (unsigned int i=1;i<=Excnt;++i)ExRec[i]=GetTRecord(); + seprt=Getuint(); + if (seprt!=0xd1ffa0c3) + { + fclose(stdin); + Error("Error when loading score file!"); + } + FPMcnt=Getuint(); + for (unsigned int i=1;i<=FPMcnt;++i)FPMRec[i]=GetTRecord(); + fclose(stdin); +} +int CheckHighScore() +{ + unsigned i; + switch (mode) + { + case 4: + for (i=1;i<=Ecnt;++i) + if (ERec[i].score<score)break; + if (i==5&&ERec[i].score>score)return -1; + if (Ecnt<5&&ERec[Ecnt].score>score)return Ecnt+1; + return i; + break; + case 1: + for (i=1;i<=Ncnt;++i) + if (NRec[i].score<score)break; + if (i==5&&NRec[i].score>score)return -1; + if (Ncnt<5&&NRec[Ncnt].score>score)return Ncnt+1; + return i; + break; + case 2: + for (i=1;i<=Excnt;++i) + if (ExRec[i].score<score)break; + if (i==5&&ExRec[i].score>score)return -1; + if (Excnt<5&&ExRec[Ncnt].score>score)return Excnt+1; + return i; + break; + case 3: + for (i=1;i<=FPMcnt;++i) + if (FPMRec[i].score<score)break; + if (i==5&&FPMRec[i].score>score)return -1; + if (FPMcnt<5&&FPMRec[Ncnt].score>score)return FPMcnt+1; + return i; + break; + } + return 100; +} +void Score_Write() +{ + freopen(".blrscore","w",stdout); + Putuint(0x3b424c53); + Putuint(0xd1ffa0c0); + Putint(Ecnt); + for (unsigned i=1;i<=Ecnt;++i) + PutTRecord(ERec[i]); + Putuint(0xd1ffa0c1); + Putint(Ncnt); + for (unsigned i=1;i<=Ncnt;++i) + PutTRecord(NRec[i]); + Putuint(0xd1ffa0c2); + Putint(Excnt); + for (unsigned i=1;i<=Excnt;++i) + PutTRecord(ExRec[i]); + Putuint(0xd1ffa0c3); + Putint(FPMcnt); + for (unsigned i=1;i<=FPMcnt;++i) + PutTRecord(FPMRec[i]); + fclose(stdout); +} +void Score_Initailize() +{ + if(access(".blrscore",R_OK)==0)return; + freopen(".blrscore","w",stdout); + Putuint(0x3b424c53); + Putuint(0xd1ffa0c0);Putuint(0); + Putuint(0xd1ffa0c1);Putuint(0); + Putuint(0xd1ffa0c2);Putuint(0); + Putuint(0xd1ffa0c3);Putuint(0); + fclose(stdout); +} +void InsertHighScore() +{ + unsigned pos=CheckHighScore(); + switch (mode) + { + case 4: + //deprecated... + if (pos<=Ecnt) + for (unsigned i=5;i>pos;--i) + ERec[i]=ERec[i-1]; + else ++Ecnt; + if (Ecnt<5)++Ecnt; + ERec[pos].score=score; + ERec[pos].len=newlen; + memcpy(ERec[pos].name,newname,sizeof(newname)); + ERec[pos].clrusg=clrusg; + ERec[pos].rescol=restarts;ERec[pos].scoll=semicoll; + ERec[pos].af_int=(int)averfps; + ERec[pos].af_fric=(int)(averfps*10)%10*10+(int)(averfps*100)%10; + break; + case 1: + if (pos<=Ncnt) + for (unsigned i=5;i>pos;--i) + NRec[i]=NRec[i-1]; + if (Ncnt<5)++Ncnt; + NRec[pos].score=score; + NRec[pos].len=newlen; + memcpy(NRec[pos].name,newname,sizeof(newname)); + NRec[pos].clrusg=clrusg; + NRec[pos].rescol=restarts;NRec[pos].scoll=semicoll; + NRec[pos].af_int=(int)averfps; + NRec[pos].af_fric=(int)(averfps*10)%10*10+(int)(averfps*100)%10; + break; + case 2: + if (pos<=Excnt) + for (unsigned i=5;i>pos;--i) + ExRec[i]=ExRec[i-1]; + if (Excnt<5)++Excnt; + ExRec[pos].score=score; + ExRec[pos].len=newlen; + memcpy(ExRec[pos].name,newname,sizeof(newname)); + ExRec[pos].clrusg=clrusg; + ExRec[pos].rescol=asts*100;ExRec[pos].scoll=semicoll; + ExRec[pos].af_int=(int)averfps; + ExRec[pos].af_fric=(int)(averfps*10)%10*10+(int)(averfps*100)%10; + break; + case 3: + if (pos<=FPMcnt) + for (unsigned i=5;i>pos;--i) + FPMRec[i]=FPMRec[i-1]; + if (FPMcnt<5)++FPMcnt; + FPMRec[pos].score=score; + FPMRec[pos].len=newlen; + memcpy(FPMRec[pos].name,newname,sizeof(newname)); + FPMRec[pos].clrusg=clrusg; + FPMRec[pos].rescol=coll;FPMRec[pos].scoll=semicoll; + FPMRec[pos].af_int=(int)averfps; + FPMRec[pos].af_fric=(int)(averfps*10)%10*10+(int)(averfps*100)%10; + break; + } + Score_Write(); +} diff --git a/archive/blr2/src/scoresystem.h b/archive/blr2/src/scoresystem.h new file mode 100644 index 0000000..c8efc79 --- /dev/null +++ b/archive/blr2/src/scoresystem.h @@ -0,0 +1,158 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Multiplier implementations +// Copyright Chrisoft 2014 +CircleIndicator MultTimer; +hgeFont *MultFnt; +hgeSprite *MB; +int valbrk; +//static const char* SCORESYSTEM_H_FN="scoresystem.h"; + +//Multiplier Indicator + +HangUpText MT[255]; +void NewMT() +{ + int i=0;while (MT[i].Active())++i; + char ttext[10];sprintf(ttext,"x%.2lf",mult); + MT[i].Init("./Resources/charmap.fnt",ttext,1.0f,200,-50); + MT[i].Launch(vector2d(playerpos.x,playerpos.y-25)); +} +void ProcessMT() +{ + for (int i=0;i<=255;++i)if (MT[i].Active())MT[i].Process(hge->Timer_GetDelta()); +} + +//Multiplier +1 +class MultPo +{ +private: + hgeSprite *Mult,*SpwnEfx; + double Lifetime,LifeLim,speed; + vector2d position,direction; + int blinkbrk; + bool Active,blnkshow,followplyr; +public: + bool IsActive(){return Active;} + void Init(double _lt,double _speed,vector2d _pos,vector2d _dir) + { + Lifetime=0;LifeLim=_lt;speed=_speed;position=_pos;direction=_dir; + Mult=new hgeSprite(SprSheet,0,272,48,48);Active=true;blinkbrk=0;blnkshow=true; + Mult->SetHotSpot(24,24);followplyr=false;SpwnEfx=new hgeSprite(SprSheet,48,272,48,48); + SpwnEfx->SetHotSpot(24,24); + } + void Process() + { + if(GetDist(playerpos,position)<=64)followplyr=true; + if(!clrmode) + { + if(clrrange!=0&&GetDist(playerpos,position)<=clrmaxrange)followplyr=true; + } + else + { + if(clrrad-pi/2>1e-7&&GetDist(playerpos,position)<=clrmaxrange)followplyr=true; + } + if(followplyr) + { + direction=ToUnitCircle(playerpos-position); + speed=0.4; + }else Lifetime+=hge->Timer_GetDelta(); + if(GetDist(playerpos,position)<=9) + { + ++mult,NewMT(),Active=false; + delete Mult;delete SpwnEfx;return; + } + if(Lifetime>LifeLim) + { + delete Mult;delete SpwnEfx; + return (void)(Active=false); + } + if(Lifetime<LifeLim*0.03) + { + double siz=(LifeLim*0.03-Lifetime)/(LifeLim*0.03)*3; + SpwnEfx->SetColor(SETA(SpwnEfx->GetColor(),Lifetime/(LifeLim*0.03)*255)); + SpwnEfx->RenderEx(position.x,position.y,0,siz); + } + if(Lifetime>LifeLim*0.8) + { + if (!LOWFPS)++blinkbrk;else blinkbrk+=17; + if (blinkbrk>200)blinkbrk=0,blnkshow=!blnkshow; + if (blnkshow) + Mult->RenderEx(position.x,position.y,0,0.8); + } + else + Mult->RenderEx(position.x,position.y,0,0.8); + if(!followplyr) + { + if (position.x>780||position.x<20)direction.x=-direction.x; + if (position.y>780||position.y<20)direction.y=-direction.y; + } + int times=1;if (LOWFPS)times=17; + for (int i=1;i<=times;++i) + position.x+=direction.x*speed,position.y+=direction.y*speed; + } +}; +MultPo Multpo[255]; +void NewMultpo(vector2d pos=vector2d(-99,-99)) +{ + int i=0;while (Multpo[i].IsActive())++i; + if (pos.x+99<=1e-6&&pos.y+99<=1e-6) + pos.x=re.NextInt(20,770),pos.y=re.NextInt(20,570); + vector2d dir=ToUnitCircle(vector2d(rand()%1000-500,rand()%1000-500)); + Multpo[i].Init(7.5,0.02,pos,dir); +} +void ProcessMultpo() +{ + for (int i=0;i<=255;++i)if(Multpo[i].IsActive())Multpo[i].Process(); +} +//Auto Multipliers + +void Mult_Init() +{ + MultTimer.Init(50,0.95,0xC0,false,SprSheet,TextureRect(151,264,2,8),0x00FF0000); + multbrk=TenSeconds;multbat=mult=1;valbrk=0; + MB=new hgeSprite(MultFnt->GetTexture(),0,235,163,21); + MB->SetHotSpot(81.5,10.5); + memset(Multpo,0,sizeof(Multpo)); +} +double GetHscle() +{ + if (multbrk<=TenSeconds/10.0f*0.2f)return (TenSeconds/10.0f*0.3f-multbrk)/(TenSeconds/10.0f)*10; + if (multbrk<=TenSeconds/10.0f*4.5f)return 1.0f; + return (multbrk-TenSeconds/10.0f*4.15f)/(multbrk-TenSeconds/10.0f)*10; +} +int GetAlpha() +{ + if (multbrk<=TenSeconds/10.0f*0.2f)return (int)(255-255*(TenSeconds/10.0f*0.2f-multbrk)/(TenSeconds/50.0f)); + if (multbrk<=TenSeconds/10.0f*4.5f)return 0xFF; + return (int)(255*(TenSeconds/2-multbrk)/(TenSeconds/10)); +} +void Mult_FrameFunc() +{ + if (Current_Position!=1)return; + ProcessMT();ProcessMultpo(); + --multbrk; + if(!dsmc)lsc+=hge->Timer_GetDelta();else lsc=0; + if(lsc>1&&mult>1.0f)mult-=hge->Timer_GetDelta()/20.0f; + if (multbrk<0) + { + multbrk=ThirtySeconds; + mult+=multbat;lsc=0; + NewMT(); + if (multbat<5)++multbat; + } + if (multbrk<TenSeconds/2) + { + ++valbrk; + if (LOWFPS||valbrk>30) + MultTimer.SetValue((double)multbrk/((double)TenSeconds/2.0f)); + if (valbrk>30)valbrk=0; + MultTimer.Render(playerpos.x+8.4,playerpos.y+8.4); + MB->SetColor(SETA(0x00FFFFFF,0.8*GetAlpha())); + MB->RenderEx(playerpos.x+8.4,playerpos.y-26.4,0,GetHscle(),1.0f); + } +} +void Mult_BatClear() +{ + multbrk=ThirtySeconds; + multbat=1; +} diff --git a/archive/blr2/src/towernbullet.h b/archive/blr2/src/towernbullet.h new file mode 100644 index 0000000..8acf516 --- /dev/null +++ b/archive/blr2/src/towernbullet.h @@ -0,0 +1,2892 @@ +// Chrisoft Bullet Lab Remix HGE -*- C++ -*- +// Towers and Bullets Implementations +// Copyright Chrisoft 2014 +#include "effects.h" +//static const char* TOWERNBULLET_H_FN="towernbullet.h"; + +void RenderAlter(vector2d p,TColors ca,TColors cb,double rot=0,double scl=1) +{ + float x,y,w,h; + bulletspr[ca]->GetTextureRect(&x,&y,&w,&h); + bulletspr[ca]->SetTextureRect(x,y,12,h); + bulletspr[ca]->SetHotSpot(12,12); + bulletspr[ca]->RenderEx(p.x,p.y,rot,scl); + bulletspr[ca]->SetTextureRect(x,y,w,h); + bulletspr[ca]->SetHotSpot(12,12); + + bulletspr[cb]->GetTextureRect(&x,&y,&w,&h); + bulletspr[cb]->SetTextureRect(x,y,12,h); + bulletspr[cb]->SetHotSpot(12,12); + bulletspr[cb]->RenderEx(p.x,p.y,rot+pi,scl); + bulletspr[cb]->SetTextureRect(x,y,w,h); + bulletspr[cb]->SetHotSpot(12,12); +} +int CreateBullet1(double x,double y,double bs,bool eff=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=1; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=x-playerpos.x; + bullet[i].bulletdir.y=y-playerpos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].alterColor=green;bullet[i].alterColor2=COLOR_COUNT; + bullet[i].scollable=true; + bullet[i].scale=1; + if (eff)BulletEffect_Attatch(i); + return i; +} +int CreateBullet2(double x,double y,double bs,double rad,bool eff=false,bool invi=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].addblend=false; + bullet[i].extborder=false; + bullet[i].inv=invi; + bullet[i].bullettype=2; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir=vector2d(cos(rad),sin(rad)); + bullet[i].limpos=vector2d(-999,-999); + bullet[i].bulletspeed=bs; + bullet[i].alterColor=blue; + bullet[i].alterColor2=COLOR_COUNT; + bullet[i].lifetime=0; + bullet[i].whirem=0; + bullet[i].scollable=true; + bullet[i].collable=true; + bullet[i].bulletaccel=bullet[i].limv=0; + bullet[i].scale=1;bullet[i].rot=0; + if (eff)BulletEffect_Attatch(i); + return i; +} +void CreateBullet3(double x,double y,double bs,int dir,bool eff=false) +{ + CreateBullet2(x,y,bs,dir*0.5235987756,eff,false); +} +void CreateBullet4(double x,double y,double bs,int yelbrk=0,bool eff=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=4; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=x-playerpos.x; + bullet[i].bulletdir.y=y-playerpos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].yelbrk=yelbrk; + bullet[i].scollable=true; + bullet[i].scale=1;bullet[i].lifetime=0; + bullet[i].alterColor=yellow;bullet[i].alterColor2=COLOR_COUNT; + if (eff)BulletEffect_Attatch(i); +} +void CreateBullet5(double x,double y,double bs,bool eff=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=5; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=x-playerpos.x; + bullet[i].bulletdir.y=y-playerpos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].alterColor=purple;bullet[i].alterColor2=COLOR_COUNT; + bullet[i].scollable=true; + bullet[i].scale=1; + if (eff)BulletEffect_Attatch(i); +} +int CreateBullet6(double x,double y,double bs,int explo,int exp1=8,int exp2=12,bool eff=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=6; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=re.NextDouble(-1,1); + bullet[i].bulletdir.y=re.NextDouble(-1,1); + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].alterColor=red;bullet[i].alterColor2=COLOR_COUNT; + bullet[i].redattrib=0; + bullet[i].exp1=exp1; + bullet[i].exp2=exp2; + bullet[i].oriexplo=bullet[i].redexplo=explo; + bullet[i].scollable=true; + bullet[i].scale=1; + if (eff)BulletEffect_Attatch(i); + return i; +} +int CreateBullet7(double x,double y,double bs,int explo,bool eff=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=7; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=re.NextDouble(-1,1); + bullet[i].bulletdir.y=re.NextDouble(-1,1); + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].alterColor=white;bullet[i].alterColor2=COLOR_COUNT; + bullet[i].oriexplo=bullet[i].redexplo=explo; + bullet[i].redattrib=0; + bullet[i].whirem=whicnt; + bullet[i].whiskp=0; + bullet[i].scollable=true; + bullet[i].scale=1; + if (eff)BulletEffect_Attatch(i); + return i; +} +int CreateBullet8(double x,double y,double bs,bool eff=false) +{ + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=8; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=x-playerpos.x; + bullet[i].bulletdir.y=y-playerpos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].alterColor=dblue;bullet[i].alterColor2=COLOR_COUNT; + bullet[i].scollable=true; + bullet[i].scale=1; + if (eff)BulletEffect_Attatch(i); + return i; +} +int CreateBullet9(double x,double y,double bs,int explo,int cnt,int brk,bool eff=false) +{ + //This creates bullet9 in random direction and as attrib 0 + //change them if necessary. + ++shots; + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].inv=false; + bullet[i].bullettype=9; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].bulletdir.x=re.NextDouble(-1,1); + bullet[i].bulletdir.y=re.NextDouble(-1,1); + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].oriexplo=bullet[i].redexplo=explo; + bullet[i].redattrib=0; + bullet[i].whicnt=cnt; + bullet[i].yelbrk=brk; + bullet[i].alterColor=orange;bullet[i].alterColor2=COLOR_COUNT; + bullet[i].scollable=true; + bullet[i].scale=1; + if (eff)BulletEffect_Attatch(i); + return i; +} +void CreateBullet255(double x,double y,double bs,int spno=0) +{ + int i=AllocBullet(); + bullet[i].exist=true; + bullet[i].bullettype=255; + bullet[i].bulletpos.x=x; + bullet[i].bulletpos.y=y; + bullet[i].redattrib=spno; + vector2d spos=playerpos+splitData[spno]; + bullet[i].bulletdir.x=x-spos.x; + bullet[i].bulletdir.y=y-spos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + bullet[i].bulletspeed=bs; + bullet[i].exp1=re.NextInt(0,9)?0:1; +} +void All2pnt() +{ + for (int i=1;i<=bulcnt;++i) + { + if(bullet[i].bullettype<200&&bullet[i].exist) + { + CreateBullet255(bullet[i].bulletpos.x,bullet[i].bulletpos.y,10); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + } +} +void ProcessBullet1(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=1)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + BulletEffect_Process(i); + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear(); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } +} +void ProcessBullet2(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=2)return; + if (Current_Position==1)bullet[i].lifetime+=hge->Timer_GetDelta(); + if (!DisablePlayer) + { + //experimental new coor processing code, FPS independent + if (bullet[i].whirem<=0) + { + if (bullet[i].bulletaccel>0&&bullet[i].bulletspeed<bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel*(1000.0f/hge->Timer_GetFPS()); + if (bullet[i].bulletaccel<0&&bullet[i].bulletspeed>bullet[i].limv)bullet[i].bulletspeed+=bullet[i].bulletaccel*(1000.0f/hge->Timer_GetFPS()); + } + else + bullet[i].whirem-=1000.0f/hge->Timer_GetFPS(); + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x)/20*(1000.0f/hge->Timer_GetFPS()); + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20*(1000.0f/hge->Timer_GetFPS()); + if(GetDist(bullet[i].bulletpos,bullet[i].limpos)<1) + { + BulletEffect_Death(bullet[i],ColorToDWORD(bullet[i].alterColor)); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0;return; + } + } + BulletEffect_Process(i); + if(PlayerSplit) + { + bool rndr=true; + for(int j=0;j<4;++j) + { + double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]); + if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625) + { + bullet[i].exist=false;rndr=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + return; + } + if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable) + { + ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;rndr=false; + if(!bullet[i].inv) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + return; + } + else + { + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(playerpos+splitData[j]); + } + } + if(rndr) + { + if(bullet[i].alterColor2==COLOR_COUNT) + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + else + RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale), + Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0; + } + } + else + { + double dis=GetDist(bullet[i].bulletpos,playerpos); + if ((!bullet[i].extborder&&(bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625))|| + (bullet[i].extborder&&(bullet[i].bulletpos.x<=-225||bullet[i].bulletpos.x>=1025||bullet[i].bulletpos.y<=-225||bullet[i].bulletpos.y>=825))) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + return; + } + if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable) + { + ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false; + if(!bullet[i].inv) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + return; + } + else + { + if(bullet[i].alterColor2==COLOR_COUNT) + { + if(bullet[i].addblend)bulletspr[bullet[i].alterColor]->SetBlendMode(0); + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + if(bullet[i].addblend)bulletspr[bullet[i].alterColor]->SetBlendMode(2); + } + else + RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale), + Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0; + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } + } +} +//There is no need for ProcessBullet3() because they are in fact bullet2 +void ProcessBullet4(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=4)return; + if (Current_Position==1)bullet[i].lifetime+=hge->Timer_GetDelta(); + if (!DisablePlayer) + { + if (LOWFPS) + bullet[i].whirem+=17; + else + ++bullet[i].whirem; + if ((yelattrib&&bullet[i].whirem>=bullet[i].yelbrk)||!yelattrib) + { + bullet[i].whirem=0; + bullet[i].bulletdir.x=bullet[i].bulletpos.x-playerpos.x; + bullet[i].bulletdir.y=bullet[i].bulletpos.y-playerpos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + } + if (LOWFPS) + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + BulletEffect_Process(i); + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear(); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } +} +void ProcessBullet5(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=5)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + BulletEffect_Process(i); + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)playerspeed*=0.9,playerslospeed*=0.9; + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + } +} +void ProcessBullet6(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=6)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + if (!LOWFPS) + { + if (bullet[i].redattrib==0) + --bullet[i].redexplo; + else + bullet[i].redexplo-=2; + } + else + { + if (bullet[i].redattrib==0) + bullet[i].redexplo-=17; + else + bullet[i].redexplo-=34; + } + if (bullet[i].redexplo<=0&&!DisableAllTower) + { + if (bullet[i].redattrib==0) + { + for (int j=1;j<=bullet[i].exp1;++j) + { + int pnt=CreateBullet6(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,bullet[i].oriexplo,bullet[i].exp1,bullet[i].exp2,bullet[i].scale>1.5?true:false); + bullet[pnt].setdir(2*pi/(double)bullet[i].exp1*j); + bullet[pnt].redattrib=1; + } + } + else + { + for (int j=1;j<=bullet[i].exp2;++j) + CreateBullet2(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,2*pi/(double)bullet[i].exp2*j+clockrot,bullet[i].scale>1.5?true:false); + clockrot+=deltarot; + deltarot+=0.004363322313; + } + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + BulletEffect_Process(i); + if(PlayerSplit) + { + bool rndr=true; + for(int j=0;j<4;++j) + { + double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]); + if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625) + { + bullet[i].exist=false;rndr=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + return; + } + if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable) + { + ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;rndr=false; + if(!bullet[i].inv) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + return; + } + else + { + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(playerpos+splitData[j]); + } + } + if(rndr) + { + if(bullet[i].alterColor2==COLOR_COUNT) + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + else + RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale), + Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0; + } + } + else + { + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + return; + } + if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable) + { + ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false; + if(!bullet[i].inv) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + return; + } + else + { + if(bullet[i].alterColor2==COLOR_COUNT) + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + else + RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale), + Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0; + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } + } +} +void ProcessBullet7(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=7)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + if (!LOWFPS) + { + if (bullet[i].redattrib==0) + --bullet[i].redexplo; + else + bullet[i].redexplo-=2; + } + else + { + if (bullet[i].redattrib==0) + bullet[i].redexplo-=17; + else + bullet[i].redexplo-=34; + } + if (bullet[i].redexplo<=0&&!DisableAllTower) + { + if (bullet[i].redattrib==0) + { + int pnt=CreateBullet7(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,bullet[i].oriexplo,bullet[i].scale>1.5?true:false); + + bullet[pnt].bulletdir.x=0; + bullet[pnt].bulletdir.y=0; + bullet[pnt].dist=1; + bullet[pnt].redattrib=1; + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + if (!LOWFPS) + ++bullet[i].whiskp; + else + bullet[i].whiskp+=17; + if (bullet[i].whiskp>50) + { + for (int j=1;j<=whrcnt;++j) + { + int pnt=CreateBullet2(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,j*2.0f*pi/(double)whrcnt+whirot,bullet[i].scale>1.5?true:false); + if(level==6&&part==1) + { + bullet[pnt].limv=8; + bullet[pnt].bulletaccel=0.005; + bullet[pnt].bulletspeed=0; + } + if (level==6&&part>=2&&part<=11&&(j&1)) + { + bullet[pnt].limv=5; + bullet[pnt].bulletaccel=0.005; + bullet[pnt].bulletspeed=0; + bullet[pnt].redir(playerpos); + bullet[pnt].bulletdir.Rotate((j>>1&1?1:-1)*pi/72); + } + } + whirot+=dwhirot; + dwhirot+=0.004363322313; + bullet[i].whiskp=0; + --bullet[i].whirem; + } + if (bullet[i].whirem<=0) + { + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + } + } + BulletEffect_Process(i); + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear(); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } +} +void ProcessBullet8(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=8)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + BulletEffect_Process(i); + if(bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + int cnt=re.NextInt(2,5);if (Dis8ref)cnt=0; + if(PlayerSplit)cnt=re.NextInt(0,2); + if(bullet[i].redattrib) + { + if(re.NextInt(0,3))//more possibility to reflect + { + if(bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800)bullet[i].bulletdir.x=-bullet[i].bulletdir.x; + if(bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)bullet[i].bulletdir.y=-bullet[i].bulletdir.y; + } + else//vanish or reflect?... + { + cnt=4-4*(frameleft/(double)(AMinute*1.5)); + for (int ii=1;ii<=cnt;++ii) + CreateBullet2(bullet[i].bulletpos.x,bullet[i].bulletpos.y,2,re.NextDouble(-pi,pi)); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + return; + } + } + else + { + for (int ii=1;ii<=cnt;++ii) + { + int pnt=CreateBullet2(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,re.NextDouble(-pi,pi)); + if (t8special) + { + bullet[pnt].alterColor=(TColors)(re.NextInt(0,7)); + bullet[pnt].alterColor2=(TColors)(re.NextInt(0,7)); + if(re.NextInt(0,3)==3)bullet[pnt].redir(vector2d(400,300)); + if(re.NextInt(0,1))++ii; + } + } + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + return; + } + } + if(PlayerSplit) + { + for(int j=0;j<4;++j) + { + double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]); + if (dis<=6) + { + if (dis<=6){if(clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();} + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(playerpos+splitData[j]); + } + } + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + } + else + { + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (dis<=6) + { + if (dis<=6){if(clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();} + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0;return; + } + else + { + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } + } +} +void ProcessBullet9(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=9)return; + if (!DisablePlayer) + { + if (LOWFPS) + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + if (bullet[i].redattrib==0) + { + bullet[i].redexplo-=17; + if (bullet[i].redexplo<=0) + { + for (int ii=0;ii<bullet[i].whicnt;++ii) + { + int pnt=CreateBullet9(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,0,0,bullet[i].yelbrk); + bullet[pnt].setdir(2*pi/(double)bullet[i].whicnt*ii); + bullet[pnt].redattrib=1; + } + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + } + if (bullet[i].redattrib==1) + { + bullet[i].yelbrk-=17; + if (bullet[i].yelbrk<=0) + { + bullet[i].redir(playerpos); + bullet[i].redattrib=2; + } + } + } + else + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + if (bullet[i].redattrib==0) + { + --bullet[i].redexplo; + if (bullet[i].redexplo<=0) + { + for (int ii=0;ii<bullet[i].whicnt;++ii) + { + int pnt=CreateBullet9(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,0,0,bullet[i].yelbrk); + bullet[pnt].setdir(2*pi/(double)bullet[i].whicnt*ii); + bullet[pnt].redattrib=1; + } + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + } + if (bullet[i].redattrib==1) + { + --bullet[i].yelbrk; + if (bullet[i].yelbrk<=0) + { + bullet[i].redir(playerpos); + bullet[i].redattrib=2; + } + } + } + } + BulletEffect_Process(i); + double dis=GetDist(bullet[i].bulletpos,playerpos); + if (dis<=6||bullet[i].bulletpos.x<=-100||bullet[i].bulletpos.x>=900||bullet[i].bulletpos.y<=-100||bullet[i].bulletpos.y>=700) + { + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear(); + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0); + if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(); + } +} +void ProcessBullet255(int i) +{ + if (!bullet[i].exist||bullet[i].bullettype!=255)return; + if (!DisablePlayer) + { + bullet[i].bulletspeed=10; + vector2d spos=playerpos+splitData[bullet[i].redattrib]; + bullet[i].bulletdir.x=bullet[i].bulletpos.x-spos.x; + bullet[i].bulletdir.y=bullet[i].bulletpos.y-spos.y; + bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y; + bullet[i].dist=sqrt(bullet[i].dist); + if (LOWFPS) + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20*17; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20*17; + } + else + { + bullet[i].bulletpos.x-=bullet[i].bulletspeed*(bullet[i].bulletdir.x/bullet[i].dist)/20; + bullet[i].bulletpos.y-=bullet[i].bulletspeed*(bullet[i].bulletdir.y/bullet[i].dist)/20; + } + } + double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[bullet[i].redattrib]); + if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600) + { + if(bullet[i].exp1)score+=mult*100;else mult+=0.01; + bullet[i].exist=false; + bullet[i].bulletpos.x=bullet[i].bulletpos.y=0; + bullet[i].bulletdir.x=bullet[i].bulletdir.y=0; + bullet[i].dist=0; + bullet[i].bullettype=0; + } + else + { + if(bullet[i].exp1) + { + bulletspr[green]->SetColor(0x40FFFFFF); + bulletspr[green]->SetBlendMode(BLEND_ALPHAADD); + bulletspr[green]->RenderEx(bullet[i].bulletpos.x+6,bullet[i].bulletpos.y+6,0,0.5,0); + bulletspr[green]->SetBlendMode(BLEND_ALPHABLEND); + bulletspr[green]->SetColor(0x80FFFFFF); + } + else + { + bulletspr[grey]->SetColor(0x20FFFFFF); + bulletspr[grey]->SetBlendMode(BLEND_ALPHAADD); + bulletspr[grey]->RenderEx(bullet[i].bulletpos.x+6,bullet[i].bulletpos.y+6,0,0.5,0); + bulletspr[grey]->SetBlendMode(BLEND_ALPHABLEND); + } + } +} +int CreateTower1(double x,double y,int timer,double bs,double offset=0,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=1; + tower[i].bulletspeed=bs; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + tower[i].offset=offset; + return i; +} +int CreateTower2(double x,double y,int timer,double bs,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero)return i; + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=2; + tower[i].bulletspeed=bs; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +int CreateTower3(double x,double y,int timer,double bs,int t3t,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero)return i; + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=3; + tower[i].bulletspeed=bs; + tower[i].t3t=t3t; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +int CreateTower3_fixeddir(double x,double y,int timer,double bs,double rad,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero)return i; + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=3; + tower[i].bulletspeed=bs; + tower[i].offset=rad;tower[i].t3t=999; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +int CreateTower4(double x,double y,int timer,double bs,int yelbrk=0,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=4; + tower[i].bulletspeed=bs; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].yelbrk=yelbrk; + tower[i].effect=eff; + return i; +} +int CreateTower5(double x,double y,int timer,double bs,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=5; + tower[i].bulletspeed=bs; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +int CreateTower6(double x,double y,int timer,double bs,int redexplo,int exp1=8,int exp2=12,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=6; + tower[i].bulletspeed=bs; + tower[i].redexplo=redexplo; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].exp1=exp1;tower[i].exp2=exp2; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +int CreateTower7(double x,double y,int timer,double bs,int redexplo,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=7; + tower[i].bulletspeed=bs; + tower[i].redexplo=redexplo; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].whicnt=whicnt; + tower[i].effect=eff; + return i; +} +int CreateTower8(double x,double y,int timer,double bs,int timer2,int scnt,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=8; + tower[i].bulletspeed=bs; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towertimer2=tower[i].curtimer2=timer2; + tower[i].shotcount=tower[i].curshotcount=scnt; + tower[i].dblstate=false; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +int CreateTower9(double x,double y,int timer,double bs,int explo,int cnt,int brk,bool eff=false) +{ + int i; + if (towcnt==0) + towcnt=i=1; + else + { + for (i=1;i<=towcnt;++i) + { + if (!tower[i].exist)break; + if (abs(tower[i].towerpos.x-x)<=zero&&abs(tower[i].towerpos.y-y)<=zero) + { + return i; + } + } + if (i>towcnt) + towcnt=i; + } + tower[i].exist=true; + tower[i].towertype=9; + tower[i].bulletspeed=bs; + tower[i].redexplo=explo; + tower[i].whicnt=cnt; + tower[i].yelbrk=brk; + tower[i].towertimer=tower[i].curtimer=timer; + tower[i].towerpos.x=x,tower[i].towerpos.y=y; + tower[i].RendColor=0x80FFFFFF; + tower[i].effect=eff; + return i; +} +void ProcessTower1() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=1)continue; + towerspr[green]->SetColor(tower[i].RendColor); + towerspr[green]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + if (fabs(tower[i].offset)>1e-7) + { + double trad=atan2l(tower[i].towerpos.y-playerpos.y,tower[i].towerpos.x-playerpos.x)+tower[i].offset; + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,trad,tower[i].effect); + } + else + CreateBullet1(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].effect); + } + } +} +void ProcessTower2() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=2)continue; + towerspr[blue]->SetColor(tower[i].RendColor); + towerspr[blue]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + for (int j=1;j<=12;++j) + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,j*0.5236+clockrot,tower[i].effect); + clockrot+=deltarot; + deltarot+=deltadelta; + } + } +} +void ProcessTower3() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=3)continue; + towerspr[blue]->SetColor(tower[i].RendColor); + towerspr[blue]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + if (tower[i].t3t==999) + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].offset,tower[i].effect); + if (tower[i].t3t==0) + for (int j=1;j<=12;++j) + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,j,tower[i].effect); + if (tower[i].t3t==1) + { + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,12,tower[i].effect); + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,3,tower[i].effect); + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,6,tower[i].effect); + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,9,tower[i].effect); + } + if (tower[i].t3t==4) + { + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*3/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*5/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*7/4.0f,tower[i].effect); + } + if (tower[i].t3t==5) + { + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*3/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*5/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*7/4.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,0,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi/2.0f,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi,tower[i].effect); + CreateBullet2(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,pi*3/2.0f,tower[i].effect); + } + if (tower[i].t3t==2) + { + if (re.NextInt(0,1)) + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,12,tower[i].effect); + else + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,6,tower[i].effect); + } + if (tower[i].t3t==3) + { + if (re.NextInt(0,1)) + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,3,tower[i].effect); + else + CreateBullet3(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,9,tower[i].effect); + } + } + } +} +void ProcessTower4() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=4)continue; + towerspr[yellow]->SetColor(tower[i].RendColor); + towerspr[yellow]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + CreateBullet4(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].yelbrk,tower[i].effect); + } + } +} +void ProcessTower5() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=5)continue; + towerspr[purple]->SetColor(tower[i].RendColor); + towerspr[purple]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + CreateBullet5(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].effect); + } + } +} +void ProcessTower6() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=6)continue; + towerspr[red]->SetColor(tower[i].RendColor); + towerspr[red]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + CreateBullet6(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].redexplo,tower[i].exp1,tower[i].exp2,tower[i].effect); + } + } +} +void ProcessTower7() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=7)continue; + towerspr[white]->SetColor(tower[i].RendColor); + towerspr[white]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + CreateBullet7(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].redexplo,tower[i].effect); + } + } +} +void ProcessTower8() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=8)continue; + towerspr[dblue]->SetColor(tower[i].RendColor); + towerspr[dblue]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (!tower[i].dblstate) + { + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + tower[i].dblstate=true; + tower[i].curtimer2=tower[i].towertimer2; + tower[i].curshotcount=tower[i].shotcount; + if (!Dis8ref&&!t8special)BTarg.TargShow(); + if (!Dis8ref)BTarg.targpos=playerpos; + if (PlayerSplit) + { + int r=0; + for(int i=1;i<4;++i) + if(GetDist(playerpos+splitData[r],vector2d(400,300))> + GetDist(playerpos+splitData[i],vector2d(400,300)))r=i; + BTarg.targpos=playerpos+splitData[r]; + } + } + } + else + { + if (LOWFPS) + tower[i].curtimer2-=17; + else + --tower[i].curtimer2; + if (tower[i].curtimer2<=0) + { + if (tower[i].curshotcount<=0) + { + tower[i].curtimer=tower[i].towertimer; + tower[i].dblstate=false; + tower[i].curtimer2=tower[i].towertimer2; + tower[i].curshotcount=tower[i].shotcount; + if (!Dis8ref)BTarg.TargHide(); + continue; + } + if (!t8special) + { + int pnt=CreateBullet8(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].effect); + if(level==-1&&part==21)bullet[pnt].redattrib=1;else bullet[pnt].redattrib=0; + if (Dis8ref) + { + if (tower[i].towerpos.y<300) + bullet[pnt].setdir(-pi/2);else bullet[pnt].setdir(pi/2); + } + else bullet[pnt].redir(BTarg.targpos); + } + else + { + for(int j=0;j<5;++j) + { + int pnt=CreateBullet8(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].effect); + bullet[pnt].alterColor=white; + bullet[pnt].redir(BTarg.targpos); + bullet[pnt].bulletdir.Rotate(j*2*pi/5); + } + } + tower[i].curtimer2=tower[i].towertimer2; + --tower[i].curshotcount; + } + } + } +} +void ProcessTower9() +{ + for (int i=1;i<=towcnt;++i) + { + if (!tower[i].exist||tower[i].towertype!=9)continue; + towerspr[orange]->SetColor(tower[i].RendColor); + towerspr[orange]->RenderEx(tower[i].towerpos.x+7.2,tower[i].towerpos.y+7.2,0,0.545); + if (DisableAllTower)continue; + if (LOWFPS) + tower[i].curtimer-=17; + else + --tower[i].curtimer; + if (tower[i].curtimer<=0) + { + tower[i].curtimer=tower[i].towertimer; + CreateBullet9(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].redexplo,tower[i].whicnt,tower[i].yelbrk,tower[i].effect); + } + } +} +//Laser Implementation +int Lasercnt; +class Laser +{ +private: + hgeDistortionMesh *graphic; + int Res; + vector2d data1[MaxRes],data2[MaxRes]; + double GetDist() + { + double res=99999.9999f,tres; + static vector2d correction=vector2d(8.4,8.4); + for (int i=0;i<Res-1;++i) + { + vector2d sa,sb; + sa=data1[i]+RenCtr;sb=data1[i+1]+RenCtr; + tres=GetDistSeg(sa,sb,playerpos+correction); + sa=data2[i]+RenCtr;sb=data2[i+1]+RenCtr; + if(GetDistSeg(sa,sb,playerpos+correction)<tres) + tres=GetDistSeg(sa,sb,playerpos+correction); + if (tres<res)res=tres; + } + return res; + } +public: + bool EnableColl; + vector2d RenCtr; + int collbrk,scollbrk; + void SetRes(int _Res){Res=_Res;} + void Render() + { + graphic->Render(RenCtr.x,RenCtr.y); + } + void Init(int _Res=0) + { + graphic=new hgeDistortionMesh(MaxRes,2); + graphic->Clear(0x00000000); + collbrk=scollbrk=0; + Res=_Res; + EnableColl=false; + } + void SetTexture(HTEXTURE Texture,double x=0.0f,double y=0.0f,double w=0.0f,double h=0.0f) + { + graphic->SetTexture(Texture); + if (x||y||w||h)graphic->SetTextureRect(x,y,w,h); + } + void Setdata(int x,vector2d pa,vector2d pb,DWORD color) + { + data1[x]=pa;data2[x]=pb; + graphic->SetDisplacement(x,0,data1[x].x,data1[x].y,HGEDISP_TOPLEFT); + graphic->SetDisplacement(x,1,data2[x].x,data2[x].y,HGEDISP_TOPLEFT); + graphic->SetColor(x,0,color);graphic->SetColor(x,1,color); + } + bool InsPoint(vector2d pa,vector2d pb,DWORD color) + { + if (Res==MaxRes)return false; + data1[++Res-1]=pa;data2[Res-1]=pb; + graphic->SetDisplacement(Res-1,0,data1[Res].x,data1[Res].y,HGEDISP_TOPLEFT); + graphic->SetDisplacement(Res-1,1,data2[Res].x,data2[Res].y,HGEDISP_TOPLEFT); + graphic->SetColor(Res-1,0,color);graphic->SetColor(Res-1,1,color); + return true; + } + void RemoveLastPoint(DWORD color) + { + for (int i=2;i<=Res;++i) + { + data1[i-1]=data1[i]; + data2[i-1]=data2[i]; + graphic->SetDisplacement(i-1,0,data1[i-1].x,data1[i-1].y,HGEDISP_TOPLEFT); + graphic->SetDisplacement(i-1,1,data2[i-1].x,data2[i-1].y,HGEDISP_TOPLEFT); + graphic->SetColor(i-1,0,color);graphic->SetColor(i-1,1,color); + } + graphic->SetDisplacement(Res-1,0,data1[Res].x,data1[Res].y,HGEDISP_TOPLEFT); + graphic->SetDisplacement(Res-1,1,data2[Res].x,data2[Res].y,HGEDISP_TOPLEFT); + graphic->SetColor(Res-1,0,color);graphic->SetColor(Res-1,1,color); + --Res; + } + void Process() + { + Render(); + if (EnableColl) + { + if (GetDist()<3.0f&&clrrange<1e-5&&clrrad-pi/2<1e-7) + { + if (!LOWFPS)++collbrk;else collbrk+=17; + if (collbrk>200) + ++coll,scminus+=10000,collbrk=0,Mult_BatClear(); + } + } + if (GetDist()<9.0f) + { + if (!LOWFPS)++scollbrk;else scollbrk+=17; + if (scollbrk>200) + ++semicoll,scollbrk=0,++dsmc,SCEffect_Attatch(); + } + + } +}laser[200]; +void ProcessLaser() +{ + //Well, I only cares rendering and collision checking.. + //Change laser data in the level code. + for (int i=1;i<=Lasercnt;++i)laser[i].Process(); +} +//Special bullet creation and processing code for some level... +void CreateBullet2(Bullet &Tar,double x,double y,double bs,double rad,bool eff=false) +{ + Tar.exist=true; + Tar.bullettype=2; + Tar.bulletpos.x=x; + Tar.bulletpos.y=y; + Tar.bulletdir.x=cos(rad); + Tar.bulletdir.y=sin(rad); + Tar.bulletspeed=bs; + Tar.alterColor=blue; + Tar.scale=1; + Tar.scollable=true; + Tar.bulletaccel=0; +} +void ProcessBullet2(Bullet &xbul,bool colchk=true) +{ + if (!xbul.exist||xbul.bullettype!=2)return; + if (!xbul.dist)xbul.dist=1; + if (xbul.bulletaccel>0&&xbul.bulletspeed<xbul.limv)xbul.bulletspeed+=xbul.bulletaccel*(1000.0f/hge->Timer_GetFPS()); + if (xbul.bulletaccel<0&&xbul.bulletspeed>xbul.limv)xbul.bulletspeed+=xbul.bulletaccel*(1000.0f/hge->Timer_GetFPS()); + xbul.bulletpos.x-=xbul.bulletspeed*(xbul.bulletdir.x/xbul.dist)/20*(1000.0f/hge->Timer_GetFPS()); + xbul.bulletpos.y-=xbul.bulletspeed*(xbul.bulletdir.y/xbul.dist)/20*(1000.0f/hge->Timer_GetFPS()); + double dis=GetDist(xbul.bulletpos,playerpos); + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&colchk&&xbul.collable) + { + ++coll,scminus+=10000,Mult_BatClear();xbul.collable=false; + return; + } + if (dis<=16&&xbul.scollable)++semicoll,++dsmc,xbul.scollable=false,SCEffect_Attatch(); + if (colchk)bulletspr[xbul.alterColor]->RenderEx(xbul.bulletpos.x+7.2,xbul.bulletpos.y+7.2,0,0.6*xbul.scale); +} +//"Noname" +class Noname01dotpas +{ +private: + Laser untitledlas; + Bullet untitledbul; + double x,y,range1,range2; + double r1lim,r2lim; + bool las,reverse,done; + int PMod,pos,boomlim; + DWORD color; +public: + bool Exist() + { + return (fabs(y)>1e-6); + } + void Init(int x,int pmd,double _r1lim,double _r2lim,int _boomlim,DWORD _color) + { + untitledlas.Init(); + this->x=x,this->y=2;color=_color; + CreateBullet2(untitledbul,x,2,0,3*pi/2); + untitledbul.bulletaccel=0.0005; + untitledbul.limv=2;untitledbul.collable=true; + las=false; + reverse=false; + done=false; + PMod=pmd; + r1lim=_r1lim;r2lim=_r2lim;boomlim=_boomlim; + if (re.NextInt(0,100)>boomlim) + pos=re.NextInt(0,600); + else + pos=999; + untitledlas.SetTexture(SprSheet,0,264,248,8); + } + void noname2pnt() + { + if(!las) + CreateBullet255(untitledbul.bulletpos.x,untitledbul.bulletpos.y,10); + else + { + for (int i=0;i<60;++i) + { + double trad=(i/60.0f)*pi*2; + vector2d a; + if (!(i%PMod)) + { + a.x=cos(trad)*range2;a.y=sin(trad)*range2; + } + else + { + a.x=cos(trad)*range1;a.y=sin(trad)*range1; + } + a=a+untitledbul.bulletpos; + CreateBullet255(a.x,a.y,10); + } + } + } + void Process() + { + if (!las) + ProcessBullet2(untitledbul),x=untitledbul.bulletpos.x,y=untitledbul.bulletpos.y; + else + untitledlas.EnableColl=true, + untitledlas.Process(); + if (!untitledbul.exist)y=-1; + if (y>pos&&!done&&!las) + { + las=true; + range1=range2=2; + for (int i=0;i<60;++i) + { + double trad=(i/60.0f)*pi*2; + vector2d a,b; + a.x=cos(trad)*range1;a.y=sin(trad)*range1; + b.x=cos(trad)*(range1-10);b.y=sin(trad)*(range1-10); + untitledlas.InsPoint(a,b,color); + } + int i=60; + double trad=1.0f/60*pi*2; + vector2d a,b; + if (!(i%PMod)) + { + a.x=cos(trad)*range2;a.y=sin(trad)*range2; + b.x=cos(trad)*(range2-10);b.y=sin(trad)*(range2-10); + } + else + { + a.x=cos(trad)*range1;a.y=sin(trad)*range1; + b.x=cos(trad)*(range1-10);b.y=sin(trad)*(range1-10); + } + for (int i=60;i<MaxRes;++i)untitledlas.InsPoint(a,b,color); + }else + if (las) + { + untitledlas.RenCtr=vector2d(x+7.2,y+7.2); + untitledlas.Render();untitledlas.EnableColl=true; + untitledlas.Process(); + if (!reverse) + { + if (range1<r1lim)range1+=0.2*(1000.0/hge->Timer_GetFPS()),range2=range1; + if (range1>=r1lim&&range2<r2lim)range2+=0.1*(1000.0/hge->Timer_GetFPS()); + if (range2>=r2lim)reverse=true; + } + else + { + if (range2>=r1lim)range2-=0.1*(1000.0/hge->Timer_GetFPS());else range1-=0.2*(1000.0/hge->Timer_GetFPS()),range2=range1; + if (range1<=2)las=false,done=true; + } + for (int i=0;i<60;++i) + { + double trad=(i/60.0f)*pi*2; + vector2d a,b; + if (!(i%PMod)) + { + a.x=cos(trad)*range2;a.y=sin(trad)*range2; + b.x=cos(trad)*(range2-10);b.y=sin(trad)*(range2-10); + } + else + { + a.x=cos(trad)*range1;a.y=sin(trad)*range1; + b.x=cos(trad)*(range1-10);b.y=sin(trad)*(range1-10); + } + untitledlas.Setdata(i,a,b,color); + } + int i=60; + double trad=pi*2; + vector2d a,b; + if (!(i%PMod)) + { + a.x=cos(trad)*range2;a.y=sin(trad)*range2; + b.x=cos(trad)*(range2-10);b.y=sin(trad)*(range2-10); + } + else + { + a.x=cos(trad)*range1;a.y=sin(trad)*range1; + b.x=cos(trad)*(range1-10);b.y=sin(trad)*(range1-10); + } + for (int i=60;i<MaxRes;++i) + untitledlas.Setdata(60,a,b,color); + } + } +}noname[1000]; +//"CTarg" +class SimpleBullet +{ +public: + TColors aC,aC2; + vector2d bulletpos; + int scollable,lastcoll; + double rot; + bool Update_SimpBul() + { + if (lastcoll) + { + ++lastcoll; + if (LOWFPS)lastcoll+=16; + } + if (scollable) + { + ++scollable; + if (LOWFPS)scollable+=16; + } + if (lastcoll>=200)lastcoll=0; + if (scollable>=200)scollable=0; + if (aC2==COLOR_COUNT)bulletspr[aC]->RenderEx(bulletpos.x+7.2,bulletpos.y+7.2,0,0.6,0);//blink hack + else RenderAlter(vector2d(bulletpos.x+7.2,bulletpos.y+7.2),aC,aC2,rot,0.6); + double dis=GetDist(bulletpos,playerpos); + if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&!lastcoll) + { + ++coll,scminus+=10000;lastcoll=1;Mult_BatClear(); + return true;//Collision + } + else + { + if (dis<=16&&!scollable)++semicoll,++dsmc,scollable=1,SCEffect_Attatch(); + return false; + } + } +}; +class TCTarg +{ +private: + Target Targ; + SimpleBullet CircBul[37]; + int BulLim,bul; + double radian,range; + double Ubrk,Ulim; +public: + void Init(int _BulLim,double _InitRange,double _Ulim) + { + Targ.Init(-0.01,playerpos); + Targ.TargShow(); + BulLim=_BulLim; + Ulim=_Ulim; + bul=BulLim; + radian=0; + range=_InitRange; + for (int i=1;i<=BulLim;++i) + { + CircBul[i].bulletpos=vector2d(3+Targ.targpos.x+range*sin(radian-i*(2*pi/BulLim)), + 3+Targ.targpos.y-range*cos(radian-i*(2*pi/BulLim))); + CircBul[i].aC=blue;CircBul[i].aC2=COLOR_COUNT;CircBul[i].rot=0; + CircBul[i].scollable=0; + } + } + double GetRange() + { + return range; + } + void SetRange(double _range) + { + range=_range; + } + void Update() + { + Targ.TargRender(); + if (LOWFPS)radian+=17*60*pi/50000.0f;else radian+=60*pi/50000.0f; + Ubrk+=hge->Timer_GetDelta(); + hgeColorRGB tcol; + tcol.a=tcol.r=1; + tcol.b=tcol.g=Ubrk>Ulim?0.0f:(Ulim-Ubrk)/Ulim; + Targ.targspr->SetColor(tcol.GetHWColor()); + if (Ubrk>Ulim) + { + Targ.TargFollowPlayer(); + if (GetDist(Targ.targpos,playerpos)<4.0f)Ubrk=0.0f; + } + for (int i=1;i<=bul;++i) + { + CircBul[i].bulletpos=vector2d(3+Targ.targpos.x+range*sin(radian-i*(2*pi/BulLim))-6, + 3+Targ.targpos.y-range*cos(radian-i*(2*pi/BulLim))-6); + CircBul[i].Update_SimpBul(); + } + } +}; +TCTarg CTarg; +#undef rad1 +#undef rad2 +class TROF +{ +public: + int Bul[64]; + double rad1,rad2,drad,srad,dtrad,dtrad2; + double range,drange,dtrange,cdtrange; + int stage,cnt,ccnt,delay,cf; + double elasp; + void init() + { + stage=0;rad1=rad2=srad;elasp=0.0f;ccnt=0; + for (int i=0;i<cnt;++i)Bul[i]=CreateBullet8(400,300,0,false),bullet[Bul[i]].setdir(srad),bullet[Bul[i]].scale=0.01,bullet[Bul[i]].inv=true; + bullet[Bul[0]].bulletspeed=2;bullet[Bul[0]].scale=1; + } + void stage0() + { + elasp+=hge->Timer_GetDelta(); + if ((int)(elasp/0.15f)>ccnt&&ccnt<cnt-1) + { + ccnt=(int)(elasp/0.2f); + if (ccnt==1)dtrange=GetDist(bullet[Bul[0]].bulletpos,bullet[Bul[1]].bulletpos); + bullet[Bul[ccnt]].bulletspeed=2;bullet[Bul[ccnt]].scale=1; + } + if (elasp>2) + { + stage=1;NewMultpo(vector2d(400,300)); + drange=GetDist(bullet[Bul[ccnt-1]].bulletpos,vector2d(400,300)); + dtrad=(drad-srad);while (dtrad>pi/6.0f)dtrad-=pi/6.0f;dtrad/=delay; + dtrad2=(2*pi-drad+srad);while (dtrad2>pi/6.0f)dtrad2-=pi/6.0f;dtrad2/=delay; + for (int i=0;i<cnt;++i)bullet[Bul[i]].bulletspeed=0; + cf=0; + } + } + void stage1() + { + cf+=(LOWFPS?17:1); + rad1=srad+dtrad*cf;rad2=srad-dtrad2*cf; + for (int i=0;i<cnt;++i) + if (bullet[Bul[i]].bullettype==8) + { + if (i&1) + bullet[Bul[i]].bulletpos=vector2d(400+(drange+(cnt-i)*dtrange)*cos(rad1-pi),300+(drange+(cnt-i)*dtrange)*sin(rad1-pi)); + else + bullet[Bul[i]].bulletpos=vector2d(400+(drange+(cnt-i)*dtrange)*cos(rad2-pi),300+(drange+(cnt-i)*dtrange)*sin(rad2-pi)); + } + if (cf>delay) + { + cf=delay; + rad1=srad+dtrad*cf;rad2=srad-dtrad2*cf; + for (int i=0;i<cnt;++i) + if (bullet[Bul[i]].bullettype==8) + { + if (i&1) + bullet[Bul[i]].bulletpos=vector2d(400+(drange+(cnt-i)*dtrange)*cos(rad1-pi),300+(drange+(cnt-i)*dtrange)*sin(rad1-pi)); + else + bullet[Bul[i]].bulletpos=vector2d(400+(drange+(cnt-i)*dtrange)*cos(rad2-pi),300+(drange+(cnt-i)*dtrange)*sin(rad2-pi)); + bullet[Bul[i]].bulletspeed=2,bullet[Bul[i]].redir(vector2d(400,300)), + bullet[Bul[i]].bulletdir=vector2d(-bullet[Bul[i]].bulletdir.x,-bullet[Bul[i]].bulletdir.y); + bullet[Bul[i]].inv=false; + } + stage=2; + } + } + void stage2(){} + void update() + { + switch(stage) + { + case 0:stage0();break; + case 1:stage1();break; + case 2:stage2();break; + } + } +}; +class BCircle +{ +private: + SimpleBullet Bullets[360]; + int BCnt; + double radian,range,DT,drad; + vector2d Centre; +public: + void Init(double _irange,double _drad,int _Cnt,vector2d _Centre,TColors _Col=blue,TColors _Col2=COLOR_COUNT) + { + range=_irange; + BCnt=_Cnt; + radian=0; + DT=0.0f; + drad=_drad; + Centre=_Centre; + for (int i=1;i<=BCnt;++i) + { + Bullets[i].bulletpos=vector2d(3+Centre.x+range*sin(radian-i*(2*pi/BCnt))-6, + 3+Centre.y-range*cos(radian-i*(2*pi/BCnt))-6); + Bullets[i].aC=_Col;Bullets[i].aC2=_Col2; + Bullets[i].rot=0; + } + } + double GetRange(){return range;} + void SetRange(double _range){range=_range;} + void SetDT(double _DT){DT=_DT;} + double GetDT(){return DT;} + double GetRad(){return radian;} + void circ2pnt() + { + for(int i=1;i<=BCnt;++i) + CreateBullet255(Bullets[i].bulletpos.x,Bullets[i].bulletpos.y,10); + } + void Update() + { + DT+=hge->Timer_GetDelta(); + if (LOWFPS)radian+=17*drad;else radian+=drad; + for (int i=1;i<=BCnt;++i) + { + Bullets[i].bulletpos=vector2d(3+Centre.x+range*sin(radian-i*(2*pi/BCnt))-6, + 3+Centre.y-range*cos(radian-i*(2*pi/BCnt))-6); + Bullets[i].rot+=(LOWFPS?17:1)*pi/1000; + Bullets[i].Update_SimpBul(); + } + } +}; +class BulletSine +{ +private: + Bullet headb; + vector2d a,b,lastgenerated; + int generated[400]; + int gencnt; + bool OutOfBound() + { + if (headb.bulletpos.x<=-25||headb.bulletpos.x>=825||headb.bulletpos.y<=-25||headb.bulletpos.y>=625) + return true;return false; + } +public: + bool active; + void Init(vector2d _a,vector2d _b) + { + a=_a;b=_b;lastgenerated=_a; + CreateBullet2(headb,a.x,a.y,6,0); + headb.redir(b); + active=true;memset(generated,0,sizeof(generated)); + gencnt=0; + } + void Update() + { + if (GetDist(lastgenerated,headb.bulletpos)>4.0f) + { + ++gencnt; + double rad=(gencnt&1)?(gencnt+1)/2*pi/18.0f:-gencnt/2*pi/18.0f; + generated[gencnt]=CreateBullet2(headb.bulletpos.x,headb.bulletpos.y,0,rad,true); + bullet[generated[gencnt]].inv=true; + lastgenerated=headb.bulletpos; + } + if (OutOfBound()) + { + active=false; + for (int i=1;i<=gencnt;++i) + if (generated[i]) + bullet[generated[i]].bulletaccel=0.005,bullet[generated[i]].limv=2, + bullet[generated[i]].inv=false,bullet[generated[i]].collable=true; + memset(generated,0,sizeof(generated)); + } + ProcessBullet2(headb); + } +}; +class WOP +{ +private: + int trail[200]; + double brk,blim,rad,k,ml; + vector2d a,b; + Bullet hbul; + bool OutOfBound() + { + if (hbul.bulletpos.x<=-25||hbul.bulletpos.x>=825||hbul.bulletpos.y<=-25||hbul.bulletpos.y>=625) + { + for (int i=0;i<200;++i)if (trail[i])return false; + return true; + }return false; + } +public: + bool active; + void Init(vector2d _a,vector2d _b,double _ml,double _bl) + { + a=_a,b=_b,ml=_ml,blim=_bl;rad=0; + if (fabs(b.x-a.x)<1e-6)return;k=(b.y-a.y)/(b.x-a.x); + CreateBullet2(hbul,a.x,a.y,7,0);hbul.redir(b); + active=true;memset(trail,0,sizeof(trail)); + } + void Update() + { + if (Current_Position!=1)return; + ProcessBullet2(hbul,false); + brk+=hge->Timer_GetDelta(); + if (brk>blim) + { + brk=0; + for (int i=0;i<200;++i) + { + if (trail[i]) + if (bullet[trail[i]].lifetime>ml)BulletEffect_Death(bullet[trail[i]],0x8000CCFF),bullet[trail[i]].exist=false,trail[i]=0; + } + rad+=pi/16.0f; + vector2d uv=ToUnitCircle(vector2d(1,-k));uv.Swap(); + int pnt=0;while (trail[pnt])++pnt; + trail[pnt]=CreateBullet2(hbul.bulletpos.x+uv.x*50*sin(rad),hbul.bulletpos.y+uv.y*50*sin(rad),0,0,true); + pnt=0;while (trail[pnt])++pnt; + trail[pnt]=CreateBullet2(hbul.bulletpos.x-uv.x*50*sin(rad),hbul.bulletpos.y-uv.y*50*sin(rad),0,0,true); + } + if (OutOfBound())active=false; + } +}; +class BTail +{ +//devide the screen into a 16*12 matrix, put random colored bullets, arranged +//in the shape of the snake, on to it. +//^Maybe this description is too bad to understand. See the code. +//Partly based on class WOP +private: + class Pile + { + private: + int pb[200]; + int matrixx,matrixy,progress,cnt; + double brk;TColors color; + public: + int getProgress(){return progress;} + void create(int _x,int _y,TColors _col) + { + matrixx=_x;matrixy=_y;color=_col; + progress=1;cnt=0; + } + void kill() + { + for(int i=0;i<cnt;++i) + { + if(pb[i]) + { + if(bullet[pb[i]].bullettype==2) + { + bullet[pb[i]].exist=false;pb[i]=0; + } + } + } + } + void update() + { + if(!progress)return; + if(progress<10) + { + brk+=hge->Timer_GetDelta(); + if(brk>0.03) + { + brk=0;if(progress++>5)return (void)(progress=10); + for(int i=0;i<10;++i) + { + vector2d ran=vector2d(re.NextDouble(0,50)+matrixx*50,re.NextDouble(0,50)+matrixy*50); + pb[cnt++]=CreateBullet2(ran.x,ran.y,0,0,true); + bullet[pb[cnt-1]].alterColor=color; + } + } + } + else + { + brk+=hge->Timer_GetDelta(); + if(brk>0.03) + { + bool alldone=true; + for(int i=0;i<cnt;++i) + { + if(pb[i]) + { + if(bullet[pb[i]].bullettype==2&&bullet[pb[i]].lifetime>1) + { + BulletEffect_Death(bullet[pb[i]],ColorToDWORD(color)); + bullet[pb[i]].exist=false;pb[i]=0; + } + else alldone=false; + } + } + if(alldone)progress=0; + } + } + } + }; + Pile piles[30]; + bool tactive; + int listx[30],listy[30],cnt; + TColors pcolor;double tlifetime; + bool check(int x,int y) + { + if(x<0||x>15)return false; + if(y<0||y>12)return false; + for(int i=0;i<cnt;++i) + if(x==listx[i]&&y==listy[i])return false; + return true; + } +public: + bool isActive(){return tactive;} + void Create() + { + pcolor=(TColors)re.NextInt(0,7);tactive=true; + cnt=0;memset(listx,0,sizeof(listx)); + memset(listy,0,sizeof(listy));tlifetime=0; + listx[cnt++]=re.NextInt(0,15);listy[cnt-1]=re.NextInt(0,11); + piles[cnt-1].create(listx[cnt-1],listy[cnt-1],pcolor); + } + void Update() + { + tlifetime+=hge->Timer_GetDelta(); + if(tlifetime>15) + { + tactive=false; + for(int i=0;i<30;++i) + if(piles[i].getProgress())piles[i].kill(); + } + if(piles[cnt-1].getProgress()==10) + { + int dlx[4],dly[4],dcnt=0; + if(check(listx[cnt-1]+1,listy[cnt-1])) + dlx[dcnt]=listx[cnt-1]+1,dly[dcnt++]=listy[cnt-1]; + if(check(listx[cnt-1]-1,listy[cnt-1])) + dlx[dcnt]=listx[cnt-1]-1,dly[dcnt++]=listy[cnt-1]; + if(check(listx[cnt-1],listy[cnt-1]+1)) + dlx[dcnt]=listx[cnt-1],dly[dcnt++]=listy[cnt-1]+1; + if(check(listx[cnt-1],listy[cnt-1]-1)) + dlx[dcnt]=listx[cnt-1],dly[dcnt++]=listy[cnt-1]-1; + if(dcnt&&cnt<30) + { + int rd=re.NextInt(0,dcnt-1); + listx[cnt++]=dlx[rd];listy[cnt-1]=dly[rd]; + piles[cnt-1].create(listx[cnt-1],listy[cnt-1],pcolor); + } + } + bool none=true; + for(int i=0;i<30;++i) + if(piles[i].getProgress())none=false,piles[i].update(); + if(none)tactive=false; + } +}; +class SimpleThing +{ +private: + vector2d center; + int step,cnt; + double rad,dly,lr,ra; + SimpleBullet b[500]; + double r[500],mr[500]; + bool create,rot; +public: + void Init(vector2d _ctr) + { + center=_ctr;step=cnt=dly=lr=ra=0; + create=true;rot=false; + } + void Update(bool rv) + { + dly+=hge->Timer_GetDelta(); + if(dly>0.2&&create) + { + dly=0; + for(int i=0;i<10;++i) + { + b[cnt].bulletpos=center; + b[cnt].aC=blue;b[cnt].aC2=COLOR_COUNT; + r[cnt/10]=0;mr[cnt/10]=(lr+=2); + if (lr>620)create=false; + ++cnt; + } + } + bool all=!create; + if(!rot) + for(int i=0;i<cnt;++i) + { + b[i].bulletpos=vector2d(center.x+r[i/10]*cos(i/10*pi/12+pi/5*(i%10)),center.y+r[i/10]*sin(i/10*pi/12+pi/5*(i%10))); + if(r[i/10]<mr[i/10])r[i/10]+=(LOWFPS?17:1)*0.01,all=false; + else r[i/10]=mr[i/10]; + b[i].Update_SimpBul(); + } + if(all||rot) + { + rot=true; + rv?rad+=(LOWFPS?17:1)*ra:rad-=(LOWFPS?17:1)*ra; + if(ra<pi/7200)ra+=(LOWFPS?17:1)*pi/630000000.0f; + for(int i=0;i<cnt;++i) + { + b[i].bulletpos=vector2d(center.x+r[i/10]*cos(i/10*pi/12+rad+pi/5*(i%10)),center.y+r[i/10]*sin(i/10*pi/12+rad+pi/5*(i%10))); + b[i].Update_SimpBul(); + } + } + } + void toPoint() + { + for(int i=0;i<cnt;++i) + CreateBullet255(b[i].bulletpos.x,b[i].bulletpos.y,10); + } +}; +class diffCreator +{ +protected: + bool active; + double range; + int cnt; + vector2d center; + int C; + int target[200]; + vector2d created[200]; +private: + TColors rbGetColor(int a) + { + switch (a) + { + case 2:return orange; + case 3:return yellow; + case 4:return green; + case 5:return blue; + case 6:return dblue; + case 7:return purple; + default:return circle; + } + } + bool test(vector2d a) + { + for(int i=0;i<cnt;++i) + if(GetDist(a,created[i])<12)return false; + return true; + } +public: + void init(vector2d _ctr) + { + active=true; + cnt=0;range=0; + center=_ctr; + C=CreateBullet2(center.x,center.y,0,0,true); + bullet[C].alterColor=red; + } + bool isActive(){return active;} + void update() + { + range+=hge->Timer_GetDelta()*400; + vector2d a;bool all=true; + for(a=vector2d(center.x-15,center.y);a.x>-25;a.x-=15) + if(GetDist(a,center)<=range) + { + if(test(a)) + target[cnt++]=CreateBullet2(a.x,a.y,0,0,true), + created[cnt-1]=vector2d(a.x,a.y), + bullet[target[cnt-1]].inv=true, + bullet[target[cnt-1]].alterColor=red; + } + else all=false; + for(a=vector2d(center.x+15,center.y);a.x<825;a.x+=15) + if(GetDist(a,center)<=range) + { + if(test(a)) + target[cnt++]=CreateBullet2(a.x,a.y,0,pi,true), + created[cnt-1]=vector2d(a.x,a.y), + bullet[target[cnt-1]].inv=true, + bullet[target[cnt-1]].alterColor=red; + } + else all=false; + for(a=vector2d(center.x,center.y-15);a.y>-25;a.y-=15) + if(GetDist(a,center)<=range) + { + if(test(a)) + target[cnt++]=CreateBullet2(a.x,a.y,0,pi/2,true), + created[cnt-1]=vector2d(a.x,a.y), + bullet[target[cnt-1]].inv=true, + bullet[target[cnt-1]].alterColor=red; + } + else all=false; + for(a=vector2d(center.x,center.y+15);a.y<625;a.y+=15) + if(GetDist(a,center)<=range) + { + if(test(a)) + target[cnt++]=CreateBullet2(a.x,a.y,0,-pi/2,true), + created[cnt-1]=vector2d(a.x,a.y), + bullet[target[cnt-1]].inv=true, + bullet[target[cnt-1]].alterColor=red; + } + else all=false; + a=center; +#define _bat \ + bullet[target[cnt-1]].redir(center),\ + created[cnt-1]=bullet[target[cnt-1]].bulletpos,\ + bullet[target[cnt-1]].bulletdir.x=-bullet[target[cnt-1]].bulletdir.x,\ + bullet[target[cnt-1]].bulletdir.y=-bullet[target[cnt-1]].bulletdir.y,\ + bullet[target[cnt-1]].inv=true,\ + bullet[target[cnt-1]].alterColor=rbGetColor(i+j); + for(int i=1;i<=6;++i) + for(int j=1;j<=7-i;++j) + if(GetDist(vector2d(a.x+i*15,a.y+j*15),center)<=range){ + if(test(vector2d(a.x+i*15,a.y+j*15))) + target[cnt++]=CreateBullet2(a.x+i*15,a.y+j*15,0,0,true),_bat;} + else all=false; + for(int i=1;i<=6;++i) + for(int j=1;j<=7-i;++j) + if(GetDist(vector2d(a.x-i*15,a.y+j*15),center)<=range){ + if(test(vector2d(a.x-i*15,a.y+j*15))) + target[cnt++]=CreateBullet2(a.x-i*15,a.y+j*15,0,0,true),_bat;} + else all=false; + for(int i=1;i<=6;++i) + for(int j=1;j<=7-i;++j) + if(GetDist(vector2d(a.x+i*15,a.y-j*15),center)<=range){ + if(test(vector2d(a.x+i*15,a.y-j*15))) + target[cnt++]=CreateBullet2(a.x+i*15,a.y-j*15,0,0,true),_bat;} + else all=false; + for(int i=1;i<=6;++i) + for(int j=1;j<=7-i;++j) + if(GetDist(vector2d(a.x-i*15,a.y-j*15),center)<=range){ + if(test(vector2d(a.x-i*15,a.y-j*15))) + target[cnt++]=CreateBullet2(a.x-i*15,a.y-j*15,0,0,true),_bat;} + else all=false; +#undef _bat + if(all) + { + BulletEffect_Death(bullet[C],0x80FF3333); + bullet[C].exist=false; + for(int i=0;i<cnt;++i) + { + bullet[target[i]].bulletspeed=-0.5; + bullet[target[i]].bulletaccel=0.0005; + bullet[target[i]].limv=3; + bullet[target[i]].inv=false; + bullet[target[i]].collable=true; + } + active=false; + } + }; +}; +class RTV +{ +private: + int mode,cnt,stage,spnr,dcorr; + bool active;TColors col; + double drad,rad,brk; + int targ[600]; +public: + bool isActive(){return active;} + void Init(int _mode,double _drad,int _spnr,TColors _c,int _dcorr) + { + mode=_mode;drad=_drad;rad=0;spnr=_spnr; + brk=0;active=true;cnt=0;stage=0;col=_c; + memset(targ,0,sizeof(targ));dcorr=_dcorr; + } + void Update() + { + switch(mode) + { + case 1: + { + brk+=hge->Timer_GetDelta(); + bool dchk=(stage==1); + for(int i=0;i<cnt;++i) + { + if(bullet[targ[i]].bulletspeed>1&&GetDist(vector2d(400,300),bullet[targ[i]].bulletpos)>=200) + bullet[targ[i]].bulletspeed=0; + if(bullet[targ[i]].bulletspeed>1)dchk=false; + } + if(dchk) + { + for(int i=0;i<cnt;++i) + { + double rad=atan2(bullet[targ[i]].bulletdir.y,bullet[targ[i]].bulletdir.x); + int cc=(int)(rad/drad); + if((cc/6+dcorr)&1) + bullet[targ[i]].bulletaccel=0.005, + bullet[targ[i]].limv=3; + else + bullet[targ[i]].bulletaccel=-0.005, + bullet[targ[i]].limv=-3; + } + return(void)(active=false); + } + if(stage==0) + { + if(brk>0.05) + { + brk=0;rad+=drad; + if(fabs(rad)>2*pi/spnr+pi/180)return(void)(stage=1); + for(int i=0;i<spnr;++i) + { + targ[cnt]=CreateBullet2(400,300,2,rad+i*2*pi/spnr), + bullet[targ[cnt]].inv=true, + bullet[targ[cnt++]].alterColor=col; + } + } + } + } + break; + case 2: + { + brk+=hge->Timer_GetDelta(); + bool dchk=(stage==1); + for(int i=0;i<cnt;++i) + { + if(bullet[targ[i]].bulletspeed>1&&GetDist(vector2d(400,300),bullet[targ[i]].bulletpos)>=200) + bullet[targ[i]].bulletspeed=0; + if(bullet[targ[i]].bulletspeed>1)dchk=false; + } + if(dchk) + { + if(re.NextInt(0,1)) + for(int i=0;i<cnt;++i) + bullet[targ[i]].bulletaccel=-0.005, + bullet[targ[i]].limv=-3; + else + for(int i=0;i<cnt;++i) + bullet[targ[i]].bulletaccel=0.005, + bullet[targ[i]].limv=3; + return(void)(active=false); + } + if(stage==0) + { + if(brk>0.05) + { + brk=0;rad+=drad; + if(fabs(rad)>2*pi/spnr+pi/180)return(void)(stage=1); + for(int i=0;i<spnr;++i) + { + targ[cnt]=CreateBullet2(400,300,2,rad+i*2*pi/spnr), + bullet[targ[cnt]].inv=true; + bullet[targ[cnt++]].alterColor=col; + } + } + } + } + break; + case 3: + { + brk+=hge->Timer_GetDelta(); + if(brk>0.05) + { + brk=0;rad+=drad; + if(fabs(rad)>2*pi/spnr+pi/180)return(void)(active=false); + for(int i=0;i<spnr;++i) + { + targ[cnt]=CreateBullet2(400,300,2,rad+i*2*pi/spnr); + bullet[targ[cnt]].inv=true; + bullet[targ[cnt++]].alterColor=col; + targ[cnt]=CreateBullet2(400,300,2,-rad+i*2*pi/spnr); + bullet[targ[cnt]].inv=true; + bullet[targ[cnt++]].alterColor=col; + } + } + } + break; + } + } +}; +bool achromab,achromaB[100]; +class achromaGroup +{ +private: + class achromaBullet:public SimpleBullet + { + private: + bool active; + double spd,acc,lim; + public: + bool isActive(){return active;} + void achromaInit(vector2d pos,TColors initcol,double _lim) + { + bulletpos=pos;spd=0;acc=0.0005;lim=_lim;rot=0; + lastcoll=0;aC=initcol;aC2=COLOR_COUNT; + active=true; + } + void Reverse() + { + spd=0; + if(aC==green)aC=red; + else if(aC==red)aC=green; + } + void achromaUpdate() + { + if(aC==red)lastcoll=1;//ignore coll for red. + bulletpos.y+=spd*(1000.0f/hge->Timer_GetFPS()); + if(spd+acc*(1000.0f/hge->Timer_GetFPS())<lim)spd+=acc*(1000.0f/hge->Timer_GetFPS()); + if(bulletpos.y>610)active=false; + Update_SimpBul(); + } + }bullets[1000]; +public: + double crbrk,llim;TColors col; + void Init(TColors initcol,double _llim) + { + col=initcol;llim=_llim; + crbrk=re.NextDouble(0,frameleft/(double)(AMinute+ThirtySeconds))*(part==36?0.07:0.02)+0.03; + } + void Reverse() + { + if(col==red)col=green; + else if(col==green)col=red; + for(int i=0;i<1000;++i)if(bullets[i].isActive())bullets[i].Reverse(); + } + void achroma2pnt() + { + for(int i=0;i<1000;++i)if(bullets[i].isActive())CreateBullet255(bullets[i].bulletpos.x,bullets[i].bulletpos.y,10); + } + void Update(int msk=0) + { + crbrk-=hge->Timer_GetDelta(); + if(achromab) + { + if(crbrk<=0) + { + crbrk=re.NextDouble(0,frameleft/(double)AMinute)*(part==36?0.07:0.02)+0.03; + for(int i=0;i<1000;++i) + if(!bullets[i].isActive()) + { + bullets[i].achromaInit(vector2d(re.NextDouble(10,790),-5),col,llim); + break; + } + } + for(int i=0;i<1000;++i)if(bullets[i].isActive())bullets[i].achromaUpdate(); + } + else + { + if(crbrk<=0) + { + crbrk=1; + if(msk) + { + memset(achromaB,0,sizeof(achromaB)); + for(int i=0;i<80;++i)achromaB[i]=re.NextInt(0,1); + } + for(int i=0;i<80;++i) + { + if(achromaB[i]&&col==green) + { + for(int j=0;j<1000;++j) + if(!bullets[j].isActive()) + { + bullets[j].achromaInit(vector2d(i*10,-5),col,llim); + break; + } + } + if(!achromaB[i]&&col==red) + { + for(int j=0;j<500;++j) + if(!bullets[j].isActive()) + { + bullets[j].achromaInit(vector2d(i*10,-5),col,llim); + break; + } + } + } + } + for(int i=0;i<500;++i)if(bullets[i].isActive())bullets[i].achromaUpdate(); + } + } +}; +class yellowGroup +{ +private: + int ylw[100]; + bool dirdone[100]; + bool active; +public: + bool isActive(){return active;} + void Init(int _cnt,double _yv) + { + memset(ylw,0,sizeof(ylw));active=true; + memset(dirdone,0,sizeof(dirdone)); + for (int i=0;i<_cnt;++i) + { + int pnt=CreateBullet2(400,300,_yv,frameleft*pi/AMinute+i*(2*pi/_cnt)); + bullet[pnt].alterColor=yellow; + ylw[i]=pnt; + } + } + void Update() + { + bool done=true; + for (int i=0;i<100;++i) + { + if(ylw[i]&&bullet[ylw[i]].lifetime>2&&!dirdone[i]&&bullet[ylw[i]].alterColor==yellow) + bullet[ylw[i]].redir(playerpos),dirdone[i]=true; + if(ylw[i]&&bullet[ylw[i]].lifetime>5&&bullet[ylw[i]].alterColor==yellow) + { + int cc=re.NextInt(0,5); + for(int j=0;j<cc;++j) + { + int pnt=CreateBullet2(bullet[ylw[i]].bulletpos.x,bullet[ylw[i]].bulletpos.y,0,re.NextDouble(-pi,pi)); + if(!re.NextInt(0,3))bullet[pnt].redir(playerpos); + bullet[pnt].bulletaccel=0.002;bullet[pnt].limv=3; + } + BulletEffect_Death(bullet[ylw[i]],ColorToDWORD(yellow)); + bullet[ylw[i]].exist=false; + bullet[ylw[i]].bullettype=0; + ylw[i]=0; + } + else done=false; + } + if(done)active=false; + } +}; +class Spinner +{ +private: + SimpleBullet abullet[40][100]; + int arms; + double rad,rstep; +public: + void Init(int _arms,double _rstep) + { + memset(abullet,0,sizeof(abullet)); + arms=_arms;rstep=_rstep;rad=0; + for(int i=0;i<arms;++i) + for(int j=0;j*rstep<505;++j) + { + abullet[i][j].aC=blue;abullet[i][j].aC2=COLOR_COUNT; + } + } + void Update(double delta) + { + for(int i=0;i<arms;++i) + for(int j=0;j*rstep<505;++j) + { + double crad=rad+i*(2*pi/arms); + abullet[i][j].bulletpos=vector2d(400+j*rstep*cos(crad),300+j*rstep*sin(crad)); + abullet[i][j].Update_SimpBul(); + } + rad+=hge->Timer_GetDelta()*1000*delta; + } +}; +class expSpinner +{ +private: + int bullets[1000]; + int arms,cnt,lc; + double brk,len,dr,da; + bool active; + bool InBound(vector2d pos) + { + if (pos.x<=-25||pos.x>=825||pos.y<=-25||pos.y>=625) + return false;return true; + } +public: + void Init(int _arms,double _drange,double _drad) + { + arms=_arms;lc=cnt=len=0;dr=_drange;da=_drad;active=true; + } + bool isActive(){return active;} + void Update() + { + brk+=hge->Timer_GetDelta(); + if(brk<0.03)return;brk=0; + bool none=true; + for(int i=0;i<arms;++i) + { + double rad=da+i*2*pi/(double)arms,drad=rad+lc*pi/15;int c=(lc&1)?1:-1; + if(InBound(vector2d(400+len*cos(rad),300+len*sin(rad)))) + { + bullets[cnt++]=CreateBullet2( + 400+len*cos(rad),300+len*sin(rad),0,c*drad,true); + c=-c;none=false; + } + } + len+=dr;++lc; + if(none) + { + active=false; + for(int i=0;i<cnt;++i)bullet[bullets[i]].bulletaccel=0.002,bullet[bullets[i]].limv=2; + } + } +}; +class CPinBall +{ +private: + int center; + int circles[10][30]; + int layer,lifetime;double rot,drt; + vector2d delta; +public: + vector2d& Delta(){return delta;} + vector2d& Position(){return bullet[center].bulletpos;} + double Radius(){return layer*10.0-5;} + void Init(vector2d pos,int _lay) + { + center=0;memset(circles,0,sizeof(circles));double speed=re.NextDouble(2,5); + center=CreateBullet2(pos.x,pos.y,speed,re.NextInt(-pi,pi),true); + delta=speed*bullet[center].bulletdir; + layer=_lay;rot=0;lifetime=1;drt=re.NextDouble(-0.5*pi,0.5*pi); + for(int i=0;i<layer;++i) + { + for(int j=0;j<(i+1)*3;++j) + { + circles[i][j]=CreateBullet2(pos.x,pos.y,0,0,true); + bullet[circles[i][j]].bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3))); + } + } + } + void Kill() + { + BulletEffect_Death(bullet[center],ColorToDWORD(blue)); + bullet[center].exist=bullet[center].bullettype=0; + for(int i=0;i<layer;++i) + for(int j=0;j<(i+1)*3;++j) + { + BulletEffect_Death(bullet[circles[i][j]],ColorToDWORD(blue)); + bullet[circles[i][j]].exist=bullet[circles[i][j]].bullettype=0; + } + lifetime=0; + } + int& Getlifetime(){return lifetime;} + void UpdateDelta() + { + vector2d tdt=ToUnitCircle(delta); + bullet[center].bulletdir=tdt;bullet[center].bulletspeed=delta.l(); + } + void Update() + { + vector2d pos=bullet[center].bulletpos; + rot+=hge->Timer_GetDelta()*drt; + for(int i=0;i<layer;++i) + for(int j=0;j<(i+1)*3;++j) + bullet[circles[i][j]].bulletpos=vector2d(pos.x+10*i*cos(rot+j*2*pi/((i+1)*3)),pos.y+10*i*sin(rot+j*2*pi/((i+1)*3))); + } +}; +class LineLaser:public Laser +{ +protected: + double width; + vector2d a,b; + DWORD color; +public: + void SetColl(bool col){EnableColl=col;} + void InitLine(vector2d _a,vector2d _b,double _w,DWORD _c) + { + a=_a;b=_b;color=_c;Init(2); + SetTexture(SprSheet,151,264,2,8); + SetWidth(_w);RenCtr=vector2d(0,0); + } + void SetWidth(double _w) + { + width=_w; + vector2d dir(a-b);dir.ToUnitCircle(); + vector2d pd=dir;pd.Rotate(pi/2); + Setdata(0,a-width*pd,a+width*pd,color); + for(int i=1;i<MaxRes;++i)Setdata(i,b-width*pd,b+width*pd,color); + } + double GetWidth(){return width;} + void llsrtopnt(double dis) + { + vector2d dir=a-b;dir.ToUnitCircle();dir=dis*dir; + vector2d x=b; + while(!(x.x<=-25||x.x>=825||x.y<=-25||x.y>=625)) + { + CreateBullet255(x.x,x.y,10); + x=x+dir; + } + } + //use Laser::Process... +}; +class SimpLL:public LineLaser +{ +public: + bool active; + int stp; + double brk; +}; +class SELineLaser +{ +private: + LineLaser lsr; + bool active,h; + double brk,x; +public: + bool isActive(){return active;} + void Init(int _x,bool _h) + { + x=_x;h=_h; + if(h) + lsr.InitLine(vector2d(0,x),vector2d(800,x),0,SETA(ColorToDWORD(blue),0x80)); + else + lsr.InitLine(vector2d(x,0),vector2d(x,600),0,SETA(ColorToDWORD(blue),0x80)); + active=true;brk=0.05; + } + void Update() + { + lsr.Process(); + brk-=hge->Timer_GetDelta(); + if(brk<0) + { + brk=0.05; + lsr.SetWidth(lsr.GetWidth()+0.2); + if(lsr.GetWidth()>1)lsr.SetColl(true); + if(lsr.GetWidth()>6) + { + int t=0; + if(!re.NextInt(0,2)) + { + if(h?playerpos.y>x:playerpos.x>x)t=1; + vector2d px; + vector2d dir=h?vector2d(-1,0):vector2d(0,-1);dir=18*dir; + for(int c=0,tt=t;c<2;++c,dir=-1*dir,tt=t^1) + { + px=h?vector2d(playerpos.x,x):vector2d(x,playerpos.y); + if(c)px=px+dir; + while(!(px.x<=-25||px.x>=825||px.y<=-25||px.y>=625)) + { + tt^=1; + int pnt=CreateBullet2(px.x,px.y,0,0); + bullet[pnt].bulletdir=(tt?1:-1)*(h?vector2d(0,1):vector2d(1,0)); + bullet[pnt].limv=3;bullet[pnt].bulletaccel=0.001; + px=px+dir; + } + } + } + else + { + vector2d dir=h?vector2d(-1,0):vector2d(0,-1);dir=18*dir; + vector2d px=h?vector2d(800+re.NextInt(-18,0),x):vector2d(x,600+re.NextInt(-18,0)); + while(!(px.x<=-25||px.x>=825||px.y<=-25||px.y>=625)) + { + t^=1; + int pnt=CreateBullet2(px.x,px.y,0,0); + bullet[pnt].bulletdir=(t?1:-1)*(h?vector2d(0,1):vector2d(1,0)); + bullet[pnt].limv=3;bullet[pnt].bulletaccel=0.001; + px=px+dir; + } + } + active=false; + } + } + } +}; |