Compare commits
	
		
			551 Commits
		
	
	
		
			b_schmidt_
			...
			008cb1ebe4
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 008cb1ebe4 | ||
|  | 723c934d73 | ||
|  | 4eac2e3312 | ||
|  | fef881f42c | ||
|  | eeaf29a646 | ||
|  | 2eae0fce2a | ||
|  | aa9e8ed3f0 | ||
|  | 3e14a2674f | ||
|  | 815899fa8d | ||
|  | 793e93ef24 | ||
|  | 43d0549e9e | ||
|  | 170afe2718 | ||
|  | 17220c228b | ||
|  | 0f1be83064 | ||
|  | e0ab09295d | ||
|  | 758e9b8397 | ||
|  | b3fe289fbe | ||
|  | 42fefb2899 | ||
|  | 5da86117c8 | ||
|  | 1376da3ba6 | ||
|  | fb280101a5 | ||
|  | 844495ebbb | ||
|  | e14f6bbef7 | ||
|  | 4839ddd497 | ||
|  | b901323e2f | ||
|  | 640665fd29 | ||
|  | ba8791d9fe | ||
|  | f8fe0b9877 | ||
|  | 48913356e3 | ||
|  | e498c6f179 | ||
|  | 31fe60807f | ||
|  | c758ba9735 | ||
|  | 650dcb85db | ||
|  | 6b110c81c8 | ||
|  | 93ef00870b | ||
|  | 645433610f | ||
|  | 10a5b6b4d4 | ||
|  | 69fccefed9 | ||
|  | 14aecdd929 | ||
|  | 48f18dd468 | ||
|  | 96fe09c6fa | ||
|  | 14c68f55d9 | ||
|  | 392a81b2d8 | ||
|  | 944b6b674e | ||
|  | 5f4c6be7b8 | ||
|  | aca92cd7f1 | ||
|  | b50b5e64d1 | ||
|  | 551786bf30 | ||
|  | 2aca94100e | ||
|  | 9e81fb8549 | ||
|  | 3c6e519e77 | ||
|  | 9be00ab848 | ||
|  | c2c22f9ae5 | ||
|  | e65c2661f7 | ||
|  | 88db193b5e | ||
|  | 38824895bb | ||
|  | a78261594d | ||
|  | 646d301554 | ||
|  | e49b22c022 | ||
|  | 8821602728 | ||
|  | eb19e290bb | ||
|  | b477077b9b | ||
|  | 02cfc1d21a | ||
|  | 4c40b447a5 | ||
|  | eaff7b6c5d | ||
|  | 9ee1b5b81b | ||
|  | 49b9972ade | ||
|  | aae003823d | ||
|  | 1369de865a | ||
|  | 8e3cf9c31e | ||
|  | bc31c61fb3 | ||
|  | 975e4a2737 | ||
|  | 8d638158e4 | ||
|  | 1f37eb9962 | ||
|  | 09ea8a046e | ||
|  | 0acb23ab8b | ||
|  | 831974cb63 | ||
|  | 031ac52670 | ||
|  | 14ceb9dc67 | ||
|  | aa86c25e7c | ||
|  | cb0788e44c | ||
|  | 9e88353bd5 | ||
|  | 6db96f0a1d | ||
|  | b01bb3cf7b | ||
|  | 95b9da9377 | ||
|  | 30822e3f4d | ||
|  | 957bf8ffcc | ||
|  | 446ecfd4b5 | ||
|  | 821c9ec3fb | ||
|  | 531a3e263c | ||
|  | 4917208818 | ||
|  | e81cdf3b40 | ||
|  | bffe614b54 | ||
|  | 69ad19757d | ||
|  | a4c0afe277 | ||
|  | cc157a3cf3 | ||
|  | ff2b64d476 | ||
|  | 459a54ac5d | ||
|  | a50821f2e6 | ||
|  | 72e0fc7cbd | ||
|  | 3260d06bc8 | ||
|  | e07db0129f | ||
|  | 3bfa7ff69f | ||
|  | 160fff88ea | ||
|  | 7a658cb3d6 | ||
|  | 25361933d7 | ||
|  | 4ac02a1a7b | ||
|  | 6f15f12b49 | ||
|  | 9e50c1afe2 | ||
|  | 3a43ea10d9 | ||
|  | 3539b1cf23 | ||
|  | d0ba0d011f | ||
|  | 1f07affbef | ||
|  | c83f7de30c | ||
|  | acb5c75379 | ||
|  | a73384c436 | ||
|  | 96542fa42b | ||
|  | 0d885203a7 | ||
|  | e08654bb20 | ||
|  | 486c0a9810 | ||
|  | 0b71c2cb96 | ||
|  | 737576e0ca | ||
|  | db7a99dc59 | ||
|  | 4b48229329 | ||
|  | 1a41b548c4 | ||
|  | 7f58558da4 | ||
|  | 1503e18585 | ||
|  | 94155d2816 | ||
|  | ec42cc2c07 | ||
|  | af79e39492 | ||
|  | 0698c29410 | ||
|  | 08c1854885 | ||
|  | ff39402d82 | ||
|  | 4e375131d1 | ||
|  | ac9ced2cf4 | ||
|  | e93791e6e8 | ||
|  | fa554cbffc | ||
|  | f317d7723e | ||
|  | 07fd92c9b2 | ||
|  | 91fea83f26 | ||
|  | 471f703634 | ||
|  | 065049f663 | ||
|  | 580d81a621 | ||
|  | 7acf448c0c | ||
|  | bcf4956d2d | ||
|  | 13754c843a | ||
|  | 4743a6882c | ||
|  | 2dbc727728 | ||
|  | 560bedc80b | ||
|  | 7ace959f1f | ||
|  | 95dc7b07e2 | ||
|  | fa20a6cb2a | ||
|  | 36b308e616 | ||
|  | b912835edb | ||
|  | add5dab611 | ||
|  | 5172766216 | ||
|  | fcb55e52fc | ||
|  | 411f7ea25b | ||
|  | e05ad71fff | ||
|  | d08a172227 | ||
|  | 4fff8394d9 | ||
|  | 5bb438c221 | ||
|  | a753017fcd | ||
|  | 5522be228b | ||
|  | 3b729c9a04 | ||
|  | eda2fcd327 | ||
|  | 09e12fc610 | ||
|  | 93152f4073 | ||
|  | 17a1d3fbbb | ||
|  | a0e2b6e8e2 | ||
|  | 79a08a0c9e | ||
|  | a24d6fd4b6 | ||
|  | f220aeb78c | ||
|  | 85e0c68a36 | ||
|  | 113e1b7aa5 | ||
|  | cfcc232432 | ||
|  | 29e9b54cc4 | ||
|  | 0c90d1f185 | ||
|  | b5090ea179 | ||
|  | cfbf20f745 | ||
|  | dd002746aa | ||
|  | 11f4560745 | ||
|  | b702e3a14d | ||
|  | 3b2cfad774 | ||
|  | 9164dc6893 | ||
|  | d3cf36ecb1 | ||
|  | 7d0a0123e0 | ||
|  | 2f025e2e1a | ||
|  | 9bf9e8406b | ||
|  | 6bd1ed6e3a | ||
|  | 0f6205fbc7 | ||
|  | f2a6888fb2 | ||
|  | 5143e21ba6 | ||
|  | 26dc24a1f4 | ||
|  | 350c157493 | ||
|  | 51b879a7c8 | ||
|  | 528126aa29 | ||
|  | 73bfafa7f7 | ||
|  | 686a12e465 | ||
|  | 358beacc65 | ||
|  | 69db0aa29b | ||
|  | 20f44ad2d4 | ||
|  | d73c5e0904 | ||
|  | f322e9bd8f | ||
|  | b8e1645eb8 | ||
|  | 73a908cd71 | ||
|  | a6b7ea4ce8 | ||
|  | 4af08ffffd | ||
|  | dc66fd7384 | ||
|  | 16ff61264b | ||
|  | f3ec17b0b1 | ||
|  | 1c31915627 | ||
|  | 79c96677bd | ||
|  | 54118071cb | ||
|  | 2e28b54936 | ||
|  | f333e2d2c0 | ||
|  | b89d40b39f | ||
|  | 488ae154cf | ||
|  | c1e501c271 | ||
|  | 89d5185c91 | ||
|  | f4bf38bca1 | ||
|  | b87b3f054b | ||
|  | f6137b8b68 | ||
|  | 87309235bd | ||
|  | d37017bfa0 | ||
|  | 5d6440bd50 | ||
|  | a70295f1ff | ||
|  | b681b13468 | ||
|  | 2c536f32cf | ||
|  | 991fe5280f | ||
|  | 174fe5cfb3 | ||
|  | 119284f256 | ||
|  | 05680af726 | ||
|  | fba82f670b | ||
|  | afa2ebd004 | ||
|  | f0eeff3493 | ||
|  | 44d64c4e0f | ||
|  | 86ece3b70d | ||
|  | 6cdad71693 | ||
|  | cf6d5ea22e | ||
|  | ecf227daa6 | ||
|  | 4b5a156865 | ||
|  | cfae369fd3 | ||
|  | b05eabbbf8 | ||
|  | fd178eee43 | ||
|  | aef2ef34fb | ||
|  | fcbffa1189 | ||
|  | 0d8240381e | ||
|  | 77da6679ef | ||
|  | 5845254caa | ||
|  | 5d92d7cfcc | ||
|  | 67f6649242 | ||
|  | 1438ae5e4f | ||
|  | 01c351e64b | ||
|  | b0c21dfcb8 | ||
|  | f4cddbc87f | ||
|  | cfce176c82 | ||
|  | 782b1a10c3 | ||
|  | 2d9cd0e4e1 | ||
|  | 908ba09e2a | ||
|  | 4a84ef4b3c | ||
|  | f3353327dd | ||
|  | 316433f592 | ||
|  | 1ccdea0c87 | ||
|  | 7d9af0c4c7 | ||
|  | a1247cdae5 | ||
|  | 5696192cce | ||
|  | 91826b730f | ||
|  | 48b1cf817a | ||
|  | 94ba9f0af2 | ||
|  | 333f27a016 | ||
|  | b67379a6c3 | ||
|  | 1e6188cf24 | ||
|  | 12e859edd5 | ||
|  | e000dcfc51 | ||
|  | e7a06159bb | ||
|  | c900b6384d | ||
|  | 970a0ae254 | ||
|  | 5e0ac0abc7 | ||
|  | bcd6711965 | ||
|  | bb63a4df9f | ||
|  | b4d7349583 | ||
|  | fed8a3fd2d | ||
|  | bc6e7174ec | ||
|  | 075f98883a | ||
|  | c9df3a6176 | ||
|  | b2d2a79b00 | ||
|  | 26d8283930 | ||
|  | 4079c0a32c | ||
|  | 6d72a94fe4 | ||
|  | 227a7a027f | ||
|  | 9e595b92ba | ||
|  | c346058631 | ||
|  | f2678ea33d | ||
|  | 45a43d6998 | ||
|  | cb9888af7a | ||
|  | 93b183254f | ||
|  | e92b305a56 | ||
|  | 5b0628da15 | ||
|  | 8d087a8e84 | ||
|  | 1715926c1c | ||
|  | c8b69efca2 | ||
|  | 7f6011720c | ||
|  | bdc5f0269f | ||
|  | a6054e825e | ||
|  | 156e76fe0a | ||
|  | 89587a4c78 | ||
|  | 29cc73e83b | ||
|  | e56cdb1dcb | ||
|  | 9107a08011 | ||
|  | 0242587a5f | ||
|  | 3ce27023c2 | ||
|  | 174958c6b1 | ||
|  | c71e8b1e8e | ||
|  | ada067a2a0 | ||
|  | f4c4f6bc93 | ||
|  | 6eeb6fd209 | ||
|  | efba3c496a | ||
|  | 27a0ab52e6 | ||
|  | d6ce859fcd | ||
|  | e5f69c9536 | ||
|  | d8a2225038 | ||
|  | 7b91a679f5 | ||
|  | 840658b590 | ||
|  | c5e7ef855e | ||
|  | 170227c97f | ||
|  | 379803278b | ||
|  | 3956d8efa7 | ||
|  | 269aceaf1a | ||
|  | 41127565fc | ||
|  | 0e405d2f90 | ||
|  | f67810b288 | ||
|  | 4095d9e79d | ||
|  | 547a4c2353 | ||
|  | 9120e4d53c | ||
|  | 1a62b76104 | ||
|  | cc7f277bef | ||
|  | 274df8dfd1 | ||
|  | 2e256f4ff5 | ||
|  | d10111d2ab | ||
|  | 0c2b266f5e | ||
|  | 16b4dbae18 | ||
|  | 88409dcc99 | ||
|  | 5cacff39b7 | ||
|  | 093723a9d0 | ||
|  | f67ce6be44 | ||
|  | 1be29b8b7a | ||
|  | dfdbcdc9f3 | ||
|  | bd725e2dc4 | ||
|  | dd9d9144dd | ||
|  | 1a429e4bb6 | ||
|  | ad6fb5e926 | ||
|  | 72cb7049ba | ||
|  | 2e42f3afac | ||
|  | 8474c9f5bc | ||
|  | b7ed03f7e8 | ||
|  | a44b6b5e4c | ||
|  | 5268f75e17 | ||
|  | 687d1621fc | ||
|  | a6944aa6e3 | ||
|  | b8365c76a1 | ||
|  | 19216cc174 | ||
|  | c6a23b9b8e | ||
|  | c0f42fb1eb | ||
|  | 160873e2cc | ||
|  | 8df859bbef | ||
|  | e30d10a85d | ||
|  | bafc3f1db6 | ||
|  | 03571fcf74 | ||
|  | e7a6802488 | ||
|  | a6e6b5e158 | ||
|  | 74c3d925e6 | ||
|  | f67fa4d7f0 | ||
|  | 225a8c0e08 | ||
|  | 9a6ce27fe1 | ||
|  | 437114704a | ||
|  | 9b4cac4e56 | ||
|  | e780513b35 | ||
|  | d582c59a7d | ||
|  | 7d2c85f617 | ||
|  | 4a882bc4ac | ||
|  | 3c4eac1fcd | ||
|  | 75d5a15bdb | ||
|  | 17f121f7d1 | ||
|  | a66c570b51 | ||
|  | e1e7f2eaf6 | ||
|  | 46d2dce372 | ||
|  | c39f1f6d4c | ||
|  | 738b04f2d9 | ||
|  | ecba1c3135 | ||
|  | 748226f4ed | ||
|  | f658f53ba9 | ||
|  | 4a8304ee4f | ||
|  | 7fe9604338 | ||
|  | 7f09a6dae8 | ||
|  | 270129bc97 | ||
|  | 62ec6f6bef | ||
|  | b24c14900c | ||
|  | 44c55ce3a6 | ||
|  | 895bea048c | ||
|  | 885ab5bdc9 | ||
|  | c6355b2c09 | ||
|  | ada6bf3f24 | ||
|  | db471ac679 | ||
|  | 84059c4085 | ||
|  | 09b363f943 | ||
|  | fd347c7780 | ||
|  | b38a34efa5 | ||
|  | 10e24cf30e | ||
|  | 3369057afb | ||
|  | 7ada56e215 | ||
|  | 373b9e6d53 | ||
|  | 3de31de9f7 | ||
|  | 7252259ab3 | ||
|  | f33c673a05 | ||
|  | 65a7958b66 | ||
|  | 91e4df7478 | ||
|  | 399606d9a0 | ||
|  | 559afcaffd | ||
|  | 15f5f91ddb | ||
|  | 067a8063a5 | ||
|  | 35e367ba24 | ||
|  | fe68d991fc | ||
|  | 88dc633e8e | ||
|  | 0b9cbb0f5f | ||
|  | c3a33b4402 | ||
|  | e12f00aad6 | ||
|  | 47bac0185f | ||
|  | dafe1dab2a | ||
|  | 8ba4ea2819 | ||
|  | f6f708fd5b | ||
|  | 1203077aed | ||
|  | ddbf79c928 | ||
|  | aa47dd579f | ||
|  | cdce478d77 | ||
|  | f11f4a59f1 | ||
|  | d631e8df1e | ||
|  | af80d40700 | ||
|  | 3a6f8a945a | ||
|  | bb9727d54a | ||
|  | 7da8b3e545 | ||
|  | b6968df451 | ||
|  | b85bbdd0ad | ||
|  | aa986fb948 | ||
|  | 6e63de6e99 | ||
|  | 962ecd08fa | ||
|  | 580a26b3ea | ||
|  | 0cda6b5fa0 | ||
|  | cc8c3795b8 | ||
|  | 3c21165efb | ||
|  | 818fdf4670 | ||
|  | b7d679b492 | ||
|  | a42093df23 | ||
|  | 6157db51da | ||
|  | 843052989b | ||
|  | 8e01fa3192 | ||
|  | e2126a7ea7 | ||
|  | 0b46d14650 | ||
|  | 9e28deedf7 | ||
|  | 9c0172b413 | ||
|  | 2933d022aa | ||
|  | bdefb7193e | ||
|  | 7246133363 | ||
|  | 69b68a6975 | ||
|  | e38a7e8cdd | ||
|  | dbd9dd0001 | ||
|  | ccb1743a01 | ||
|  | 4ac897693c | ||
|  | dfb962e9fe | ||
|  | f97cbd778d | ||
|  | e889a61d43 | ||
|  | a33d422547 | ||
|  | c4b4001b96 | ||
|  | 20949b641e | ||
|  | 56e2174b6d | ||
|  | acfeebca14 | ||
|  | cc47acbd3f | ||
|  | 869e16406d | ||
|  | 1c99da4fc5 | ||
|  | b74ca4e702 | ||
|  | 5fde7451c8 | ||
|  | 6fd9209336 | ||
|  | 0213dc3560 | ||
|  | e73c434c1b | ||
|  | b135f3fa50 | ||
|  | 0e580a3180 | ||
|  | 8e3cb43244 | ||
|  | 6dcfb92dba | ||
|  | a7ea5773da | ||
|  | 5b66131d30 | ||
|  | cac06dda7d | ||
|  | 12c1c97a99 | ||
|  | af4b4243ea | ||
|  | 5189c74058 | ||
|  | fffd32e13c | ||
|  | b37a5095f0 | ||
|  | 951b4c198c | ||
|  | 8698eed273 | ||
|  | 1af8614b35 | ||
|  | 11faeeaf45 | ||
|  | 9d0fcc3370 | ||
|  | 2f6d6037de | ||
|  | 1d69bcc814 | ||
|  | 62c363068b | ||
|  | d2e0b8187b | ||
|  | 628b98af9b | ||
|  | 627e3dbd7f | ||
|  | 61b88f6bf8 | ||
|  | 8ab37e73c1 | ||
|  | afdf43ebf1 | ||
|  | 2e0d1c059d | ||
|  | 2b772199b0 | ||
|  | c37b850798 | ||
|  | c31f924d77 | ||
|  | ed87a6167d | ||
|  | 0d86ba0ca9 | ||
|  | f2fd283d06 | ||
|  | 10b978debf | ||
|  | 85756713df | ||
|  | 3bdfd6a78a | ||
|  | e59ab4a320 | ||
|  | 15b3902bd3 | ||
|  | b622d66942 | ||
|  | 12ef219064 | ||
|  | 853b52b52d | ||
|  | 7a2ad1d31a | ||
|  | c5ad476eaf | ||
|  | 12978ff410 | ||
|  | caa45097c3 | ||
|  | 232e3a117c | ||
|  | 3668382911 | ||
|  | fafa53ffb7 | ||
|  | 44673fd57e | ||
|  | f7149f225c | ||
|  | 6773e18d34 | ||
|  | 19a9b06f3c | ||
|  | 7ee2273761 | ||
|  | 86b8297c9d | ||
|  | 17533112a1 | ||
|  | 2cc1a338ec | ||
|  | 81731247c7 | ||
|  | 65c85aacf0 | ||
|  | dca23151a8 | ||
|  | 25305760c5 | ||
|  | 3ef2459ad0 | ||
|  | 29a56f42a8 | ||
|  | 3784348f91 | ||
|  | 188ec03abd | ||
|  | f47cda7dc4 | ||
|  | c7269f032f | ||
|  | 4581e611ca | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @@ -4,6 +4,7 @@ build | ||||
|  | ||||
| # VSC | ||||
| bin | ||||
| .vscode | ||||
|  | ||||
| # IntelliJ | ||||
| *.iml | ||||
|   | ||||
							
								
								
									
										18
									
								
								Projekte/.run/MonopolyApp (Mac).run.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,18 @@ | ||||
| <component name="ProjectRunConfigurationManager"> | ||||
|     <configuration default="false" name="MonopolyApp (Mac)" type="Application" factoryName="Application" | ||||
|                    singleton="false"> | ||||
|         <option name="MAIN_CLASS_NAME" value="pp.monopoly.client.MonopolyApp"/> | ||||
|         <module name="Projekte.monopoly.client.main"/> | ||||
|         <option name="VM_PARAMETERS" value="-XstartOnFirstThread"/> | ||||
|         <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/> | ||||
|         <extension name="coverage"> | ||||
|             <pattern> | ||||
|                 <option name="PATTERN" value="pp.monopoly.client.*"/> | ||||
|                 <option name="ENABLED" value="true"/> | ||||
|             </pattern> | ||||
|         </extension> | ||||
|         <method v="2"> | ||||
|             <option name="Make" enabled="true"/> | ||||
|         </method> | ||||
|     </configuration> | ||||
| </component> | ||||
							
								
								
									
										18
									
								
								Projekte/.run/MonopolyApp.run.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,18 @@ | ||||
| <component name="ProjectRunConfigurationManager"> | ||||
|   <configuration default="false" name="MonopolyApp" type="Application" factoryName="Application" singleton="false" | ||||
|                  nameIsGenerated="true"> | ||||
|     <option name="MAIN_CLASS_NAME" value="pp.monopoly.client.MonopolyApp"/> | ||||
|     <module name="Projekte.monopoly.client.main"/> | ||||
|     <option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=logging.properties"/> | ||||
|     <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/> | ||||
|     <extension name="coverage"> | ||||
|       <pattern> | ||||
|         <option name="PATTERN" value="pp.monopoly.client.*"/> | ||||
|         <option name="ENABLED" value="true"/> | ||||
|       </pattern> | ||||
|     </extension> | ||||
|     <method v="2"> | ||||
|       <option name="Make" enabled="true"/> | ||||
|     </method> | ||||
|   </configuration> | ||||
| </component> | ||||
							
								
								
									
										17
									
								
								Projekte/.run/MonopolyServer.run.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,17 @@ | ||||
| <component name="ProjectRunConfigurationManager"> | ||||
|   <configuration default="false" name="MonopolyServer" type="Application" factoryName="Application" | ||||
|                  nameIsGenerated="true"> | ||||
|     <option name="MAIN_CLASS_NAME" value="pp.monopoly.server.MonopolyServer"/> | ||||
|     <module name="Projekte.monopoly.server.main"/> | ||||
|     <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/> | ||||
|     <extension name="coverage"> | ||||
|       <pattern> | ||||
|         <option name="PATTERN" value="pp.monopoly.server.*"/> | ||||
|         <option name="ENABLED" value="true"/> | ||||
|       </pattern> | ||||
|     </extension> | ||||
|     <method v="2"> | ||||
|       <option name="Make" enabled="true"/> | ||||
|     </method> | ||||
|   </configuration> | ||||
| </component> | ||||
| @@ -9,6 +9,7 @@ dependencies { | ||||
|     implementation project(":battleship:model") | ||||
|  | ||||
|     implementation libs.jme3.desktop | ||||
|     implementation libs.jme3.effects | ||||
|  | ||||
|     runtimeOnly libs.jme3.awt.dialogs | ||||
|     runtimeOnly libs.jme3.plugins | ||||
|   | ||||
| @@ -22,6 +22,7 @@ import com.simsilica.lemur.GuiGlobals; | ||||
| import com.simsilica.lemur.style.BaseStyles; | ||||
| import pp.battleship.client.gui.BattleAppState; | ||||
| import pp.battleship.client.gui.EditorAppState; | ||||
| import pp.battleship.client.gui.GameMusic; | ||||
| import pp.battleship.client.gui.SeaAppState; | ||||
| import pp.battleship.game.client.BattleshipClient; | ||||
| import pp.battleship.game.client.ClientGameLogic; | ||||
| @@ -267,6 +268,7 @@ public class BattleshipApp extends SimpleApplication implements BattleshipClient | ||||
|         stateManager.detach(stateManager.getState(DebugKeysAppState.class)); | ||||
|  | ||||
|         attachGameSound(); | ||||
|         attachGameMusic(); | ||||
|         stateManager.attachAll(new EditorAppState(), new BattleAppState(), new SeaAppState()); | ||||
|     } | ||||
|  | ||||
| @@ -280,6 +282,15 @@ public class BattleshipApp extends SimpleApplication implements BattleshipClient | ||||
|         stateManager.attach(gameSound); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Attaches the background music state and sets its initial enabled state. | ||||
|      */ | ||||
|     private void attachGameMusic() { | ||||
|         final GameMusic gameSound = new GameMusic(); | ||||
|         gameSound.setEnabled(GameMusic.enabledInPreferences()); | ||||
|         stateManager.attach(gameSound); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Updates the application state every frame. | ||||
|      * This method is called once per frame during the game loop. | ||||
|   | ||||
| @@ -34,6 +34,7 @@ public class GameSound extends AbstractAppState implements GameEventListener { | ||||
|     private AudioNode splashSound; | ||||
|     private AudioNode shipDestroyedSound; | ||||
|     private AudioNode explosionSound; | ||||
|     private AudioNode shellFlyingSound; | ||||
|  | ||||
|     /** | ||||
|      * Checks if sound is enabled in the preferences. | ||||
| @@ -78,6 +79,7 @@ public class GameSound extends AbstractAppState implements GameEventListener { | ||||
|         shipDestroyedSound = loadSound(app, "Sound/Effects/sunken.wav"); //NON-NLS | ||||
|         splashSound = loadSound(app, "Sound/Effects/splash.wav"); //NON-NLS | ||||
|         explosionSound = loadSound(app, "Sound/Effects/explosion.wav"); //NON-NLS | ||||
|         shellFlyingSound = loadSound(app, "Sound/Effects/shell_flying.wav"); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -124,12 +126,27 @@ public class GameSound extends AbstractAppState implements GameEventListener { | ||||
|             shipDestroyedSound.playInstance(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Plays the shell flying sound effect. | ||||
|      */ | ||||
|     public void shellFly() { | ||||
|         if (isEnabled() && shellFlyingSound != null) { | ||||
|             shellFlyingSound.playInstance(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Handles a recieved {@code SoundEvent} and plays the according sound. | ||||
|      *  | ||||
|      * @param event the Sound event to be processed | ||||
|      */ | ||||
|     @Override | ||||
|     public void receivedEvent(SoundEvent event) { | ||||
|         switch (event.sound()) { | ||||
|             case EXPLOSION -> explosion(); | ||||
|             case SPLASH -> splash(); | ||||
|             case DESTROYED_SHIP -> shipDestroyed(); | ||||
|             case SHELL_FLYING -> shellFly(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -7,19 +7,22 @@ | ||||
|  | ||||
| package pp.battleship.client; | ||||
|  | ||||
| import com.simsilica.lemur.Button; | ||||
| import com.simsilica.lemur.Checkbox; | ||||
| import com.simsilica.lemur.Label; | ||||
| import com.simsilica.lemur.style.ElementId; | ||||
| import pp.dialog.Dialog; | ||||
| import pp.dialog.StateCheckboxModel; | ||||
| import pp.dialog.TextInputDialog; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.util.prefs.Preferences; | ||||
|  | ||||
| import com.simsilica.lemur.Button; | ||||
| import com.simsilica.lemur.Checkbox; | ||||
| import com.simsilica.lemur.Label; | ||||
| import com.simsilica.lemur.style.ElementId; | ||||
|  | ||||
| import static pp.battleship.Resources.lookup; | ||||
| import pp.battleship.client.gui.GameMusic; | ||||
| import pp.dialog.Dialog; | ||||
| import pp.dialog.StateCheckboxModel; | ||||
| import pp.dialog.TextInputDialog; | ||||
| import pp.battleship.client.gui.VolumeSlider; | ||||
|  | ||||
| import static pp.util.PreferencesUtils.getPreferences; | ||||
|  | ||||
| /** | ||||
| @@ -33,26 +36,29 @@ class Menu extends Dialog { | ||||
|     private final BattleshipApp app; | ||||
|     private final Button loadButton = new Button(lookup("menu.map.load")); | ||||
|     private final Button saveButton = new Button(lookup("menu.map.save")); | ||||
|     private final VolumeSlider slider; | ||||
|  | ||||
|     /** | ||||
|      * Constructs the Menu dialog for the Battleship application. | ||||
|      * Constructs the Menu dialog for the Battleship application.+ | ||||
|      * | ||||
|      * @param app the BattleshipApp instance | ||||
|      */ | ||||
|     public Menu(BattleshipApp app) { | ||||
|         super(app.getDialogManager()); | ||||
|         this.app = app; | ||||
|         slider = new VolumeSlider(app.getStateManager().getState(GameMusic.class)); | ||||
|         addChild(new Label(lookup("battleship.name"), new ElementId("header"))); //NON-NLS | ||||
|         addChild(new Checkbox(lookup("menu.sound-enabled"), | ||||
|                               new StateCheckboxModel(app, GameSound.class))); | ||||
|         addChild(loadButton) | ||||
|                 .addClickCommands(s -> ifTopDialog(this::loadDialog)); | ||||
|         addChild(saveButton) | ||||
|                 .addClickCommands(s -> ifTopDialog(this::saveDialog)); | ||||
|         addChild(new Button(lookup("menu.return-to-game"))) | ||||
|                 .addClickCommands(s -> ifTopDialog(this::close)); | ||||
|         addChild(new Button(lookup("menu.quit"))) | ||||
|                 .addClickCommands(s -> ifTopDialog(app::closeApp)); | ||||
|         addChild(new Checkbox(lookup("menu.sound-enabled"), new StateCheckboxModel(app, GameSound.class))); | ||||
|  | ||||
|         addChild(new Checkbox(lookup("menu.background-sound-enabled"), new StateCheckboxModel(app, GameMusic.class))); | ||||
|          | ||||
|         addChild(slider); | ||||
|  | ||||
|         addChild(loadButton).addClickCommands(s -> ifTopDialog(this::loadDialog)); | ||||
|         addChild(saveButton).addClickCommands(s -> ifTopDialog(this::saveDialog)); | ||||
|         addChild(new Button(lookup("menu.return-to-game"))).addClickCommands(s -> ifTopDialog(this::close)); | ||||
|         addChild(new Button(lookup("menu.quit"))).addClickCommands(s -> ifTopDialog(app::closeApp)); | ||||
|          | ||||
|         update(); | ||||
|     } | ||||
|  | ||||
| @@ -65,6 +71,11 @@ class Menu extends Dialog { | ||||
|         saveButton.setEnabled(app.getGameLogic().maySaveMap()); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void update(float delta) { | ||||
|         slider.update(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * As an escape action, this method closes the menu if it is the top dialog. | ||||
|      */ | ||||
|   | ||||
| @@ -7,20 +7,22 @@ | ||||
|  | ||||
| package pp.battleship.client; | ||||
|  | ||||
| import com.simsilica.lemur.Container; | ||||
| import com.simsilica.lemur.Label; | ||||
| import com.simsilica.lemur.TextField; | ||||
| import com.simsilica.lemur.component.SpringGridLayout; | ||||
| import pp.dialog.Dialog; | ||||
| import pp.dialog.DialogBuilder; | ||||
| import pp.dialog.SimpleDialog; | ||||
|  | ||||
| import java.lang.System.Logger; | ||||
| import java.lang.System.Logger.Level; | ||||
| import java.util.concurrent.ExecutionException; | ||||
| import java.util.concurrent.Future; | ||||
|  | ||||
| import com.simsilica.lemur.Button; | ||||
| import com.simsilica.lemur.Container; | ||||
| import com.simsilica.lemur.Label; | ||||
| import com.simsilica.lemur.TextField; | ||||
| import com.simsilica.lemur.component.SpringGridLayout; | ||||
|  | ||||
| import static pp.battleship.Resources.lookup; | ||||
| import pp.battleship.server.BattleshipServer; | ||||
| import pp.dialog.Dialog; | ||||
| import pp.dialog.DialogBuilder; | ||||
| import pp.dialog.SimpleDialog; | ||||
|  | ||||
| /** | ||||
|  * Represents a dialog for setting up a network connection in the Battleship game. | ||||
| @@ -29,10 +31,12 @@ import static pp.battleship.Resources.lookup; | ||||
| class NetworkDialog extends SimpleDialog { | ||||
|     private static final Logger LOGGER = System.getLogger(NetworkDialog.class.getName()); | ||||
|     private static final String LOCALHOST = "localhost"; //NON-NLS | ||||
|     private static final String DEFAULT_PORT = "1234"; //NON-NLS | ||||
|     private static final String DEFAULT_PORT = "42069"; //NON-NLS | ||||
|     private final NetworkSupport network; | ||||
|     private final TextField host = new TextField(LOCALHOST); | ||||
|     private final TextField port = new TextField(DEFAULT_PORT); | ||||
|     // private final Button serverButton = new Button(lookup("client.server-star")); | ||||
|     private final Button serverButton = new Button(lookup("client.server-start")); | ||||
|     private String hostname; | ||||
|     private int portNumber; | ||||
|     private Future<Object> connectionFuture; | ||||
| @@ -65,6 +69,9 @@ class NetworkDialog extends SimpleDialog { | ||||
|                      .setOkClose(false) | ||||
|                      .setNoClose(false) | ||||
|                      .build(this); | ||||
|          | ||||
|         //Add the button to start the sever | ||||
|         addChild(serverButton).addClickCommands(s -> ifTopDialog(this::startServerInThread)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -150,4 +157,21 @@ class NetworkDialog extends SimpleDialog { | ||||
|         network.getApp().errorDialog(lookup("server.connection.failed")); | ||||
|         network.getApp().setInfoText(e.getLocalizedMessage()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Starts the server in a separate thread. | ||||
|      */ | ||||
|     private void startServerInThread() { | ||||
|         serverButton.setEnabled(false); | ||||
|         Thread serverThread = new Thread(() -> { | ||||
|             try { | ||||
|                 BattleshipServer.main(null); | ||||
|             } catch (Exception e) { | ||||
|                 serverButton.setEnabled(true); | ||||
|                 LOGGER.log(Level.ERROR, "Server could not be started", e); | ||||
|                 network.getApp().errorDialog("Could not start server: " + e.getMessage()); | ||||
|             } | ||||
|         }); | ||||
|         serverThread.start(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,122 @@ | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import static pp.util.PreferencesUtils.getPreferences; | ||||
|  | ||||
| import java.lang.System.Logger; | ||||
| import java.lang.System.Logger.Level; | ||||
| import java.util.prefs.Preferences; | ||||
|  | ||||
| import com.jme3.app.Application; | ||||
| import com.jme3.app.state.AbstractAppState; | ||||
| import com.jme3.app.state.AppStateManager; | ||||
| import com.jme3.asset.AssetLoadException; | ||||
| import com.jme3.asset.AssetNotFoundException; | ||||
| import com.jme3.audio.AudioData; | ||||
| import com.jme3.audio.AudioNode; | ||||
|  | ||||
| /** | ||||
|  * Handles the background music beeing played. Is able to start and stop the music. Set the Volume of the Audio. | ||||
|  */ | ||||
| public class GameMusic extends AbstractAppState{ | ||||
|     private static final Logger LOGGER = System.getLogger(GameMusic.class.getName()); | ||||
|     private static final Preferences PREFERENCES = getPreferences(GameMusic.class); | ||||
|     private static final String ENABLED_PREF = "enabled"; //NON-NLS | ||||
|     private static final String VOLUME_PREF = "volume"; //NON-NLS | ||||
|  | ||||
|     private AudioNode music; | ||||
|  | ||||
|     /** | ||||
|      * Checks if sound is enabled in the preferences. | ||||
|      * | ||||
|      * @return {@code true} if sound is enabled, {@code false} otherwise. | ||||
|      */ | ||||
|     public static boolean enabledInPreferences() { | ||||
|         return PREFERENCES.getBoolean(ENABLED_PREF, true); | ||||
|     } | ||||
|  | ||||
|         /** | ||||
|      * Checks if sound is enabled in the preferences. | ||||
|      * | ||||
|      * @return float to which the volume is set | ||||
|      */ | ||||
|     public static float volumeInPreferences() { | ||||
|         return PREFERENCES.getFloat(VOLUME_PREF, 0.5f); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Initializes the sound effects for the game. | ||||
|      * Overrides {@link AbstractAppState#initialize(AppStateManager, Application)} | ||||
|      * | ||||
|      * @param stateManager The state manager | ||||
|      * @param app          The application | ||||
|      */ | ||||
|     @Override | ||||
|     public void initialize(AppStateManager stateManager, Application app) { | ||||
|         super.initialize(stateManager, app); | ||||
|         music = loadSound(app, "Sound/background.ogg"); | ||||
|         setVolume(volumeInPreferences()); | ||||
|         music.setLooping(true); | ||||
|         if (isEnabled() && music != null) { | ||||
|             music.play(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Loads a sound from the specified file. | ||||
|      * | ||||
|      * @param app  The application | ||||
|      * @param name The name of the sound file. | ||||
|      * @return The loaded AudioNode. | ||||
|      */ | ||||
|     private AudioNode loadSound(Application app, String name) { | ||||
|         try { | ||||
|             final AudioNode sound = new AudioNode(app.getAssetManager(), name, AudioData.DataType.Buffer); | ||||
|             sound.setLooping(false); | ||||
|             sound.setPositional(false); | ||||
|             return sound; | ||||
|         } | ||||
|         catch (AssetLoadException | AssetNotFoundException ex) { | ||||
|             LOGGER.log(Level.ERROR, ex.getMessage(), ex); | ||||
|         } | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Sets the enabled state of this AppState. | ||||
|      * Overrides {@link com.jme3.app.state.AbstractAppState#setEnabled(boolean)} | ||||
|      * | ||||
|      * @param enabled {@code true} to enable the AppState, {@code false} to disable it. | ||||
|      */ | ||||
|     @Override | ||||
|     public void setEnabled(boolean enabled) { | ||||
|         if (isEnabled() == enabled) return; | ||||
|  | ||||
|         if (music != null) { | ||||
|             if (enabled) { | ||||
|                 music.play(); | ||||
|             } else { | ||||
|                 music.stop(); | ||||
|             } | ||||
|         } | ||||
|      | ||||
|         super.setEnabled(enabled); | ||||
|         LOGGER.log(Level.INFO, "Sound enabled: {0}", enabled); //NON-NLS | ||||
|         PREFERENCES.putBoolean(ENABLED_PREF, enabled); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Toggles the game sound on or off. | ||||
|      */ | ||||
|     public void toggleSound() { | ||||
|         setEnabled(!isEnabled()); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Sets the volume of music | ||||
|      * @param vol the volume to which the music should be set | ||||
|      */ | ||||
|     public void setVolume(float vol){ | ||||
|         music.setVolume(vol); | ||||
|         PREFERENCES.putFloat(VOLUME_PREF, vol); | ||||
|     } | ||||
| } | ||||
| @@ -28,7 +28,7 @@ import pp.util.Position; | ||||
|  * and interaction between the model and the view. | ||||
|  */ | ||||
| class MapView { | ||||
|     private static final float FIELD_SIZE = 40f; | ||||
|     public static final float FIELD_SIZE = 40f; | ||||
|     private static final float GRID_LINE_WIDTH = 2f; | ||||
|     private static final float BACKGROUND_DEPTH = -4f; | ||||
|     private static final float GRID_DEPTH = -1f; | ||||
|   | ||||
| @@ -7,14 +7,23 @@ | ||||
|  | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.jme3.material.Material; | ||||
| import com.jme3.material.RenderState; | ||||
| import com.jme3.material.RenderState.BlendMode; | ||||
| import com.jme3.math.ColorRGBA; | ||||
| import com.jme3.scene.Geometry; | ||||
| import com.jme3.scene.Node; | ||||
| import com.jme3.scene.Spatial; | ||||
| import com.jme3.scene.shape.Sphere; | ||||
|  | ||||
| import pp.battleship.model.Battleship; | ||||
| import pp.battleship.model.Shell; | ||||
| import pp.battleship.model.Shot; | ||||
| import pp.util.Position; | ||||
|  | ||||
| import static com.jme3.material.Materials.UNSHADED; | ||||
|  | ||||
|  | ||||
| /** | ||||
|  * Synchronizes the visual representation of the ship map with the game model. | ||||
|  * It handles the rendering of ships and shots on the map view, updating the view | ||||
| @@ -122,4 +131,24 @@ class MapViewSynchronizer extends ShipMapSynchronizer { | ||||
|     private Geometry shipLine(float x1, float y1, float x2, float y2, ColorRGBA color) { | ||||
|         return view.getApp().getDraw().makeFatLine(x1, y1, x2, y2, SHIP_DEPTH, color, SHIP_LINE_WIDTH); | ||||
|     } | ||||
|  | ||||
|         /** | ||||
|      * Creates and returns a Spatial representation of the given {@code Shell} object | ||||
|      * for 2D visualization in the game. The shell is represented as a circle. | ||||
|      * | ||||
|      * @param shell The {@code Shell} object to be visualized. | ||||
|      * @return A {@code Spatial} object representing the shell on the map. | ||||
|      */ | ||||
|     @Override | ||||
|     public Spatial visit(Shell shell) { | ||||
|         final ColorRGBA color = ColorRGBA.Black; | ||||
|         Geometry ellipse = new Geometry("ellipse", new Sphere(50, 50, MapView.FIELD_SIZE / 2 * 0.8f)); | ||||
|         Material mat = new Material(view.getApp().getAssetManager(), UNSHADED); //NON-NLS | ||||
|         mat.getAdditionalRenderState().setBlendMode(BlendMode.Alpha); | ||||
|         mat.getAdditionalRenderState().setFaceCullMode(RenderState.FaceCullMode.Off); | ||||
|         mat.setColor("Color", color); | ||||
|         ellipse.setMaterial(mat); | ||||
|         ellipse.addControl(new Shell2DControl(view, shell)); | ||||
|         return ellipse; | ||||
|     }       | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,285 @@ | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.jme3.effect.ParticleEmitter; | ||||
| import com.jme3.effect.ParticleMesh.Type; | ||||
| import com.jme3.effect.shapes.EmitterSphereShape; | ||||
| import com.jme3.material.Material; | ||||
| import com.jme3.math.ColorRGBA; | ||||
| import com.jme3.math.FastMath; | ||||
| import com.jme3.math.Vector3f; | ||||
| import pp.battleship.client.BattleshipApp; | ||||
|  | ||||
| /** | ||||
|  * Factory class responsible for creating particle effects used in the game. | ||||
|  * This centralizes the creation of various types of particle emitters. | ||||
|  */ | ||||
| public class ParticleEffectFactory { | ||||
|     private static final int COUNT_FACTOR = 1; | ||||
|     private static final float COUNT_FACTOR_F = 1f; | ||||
|     private static final boolean POINT_SPRITE = true; | ||||
|     private static final Type EMITTER_TYPE = POINT_SPRITE ? Type.Point : Type.Triangle; | ||||
|      | ||||
|     private final BattleshipApp app; | ||||
|  | ||||
|     ParticleEffectFactory(BattleshipApp app) { | ||||
|         this.app = app; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a flame particle emitter. | ||||
|      *  | ||||
|      * @return a configured flame particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createFlame() { | ||||
|         ParticleEmitter flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR); | ||||
|         flame.setSelectRandomImage(true); | ||||
|         flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F))); | ||||
|         flame.setEndColor(new ColorRGBA(.4f, .22f, .12f, 0f)); | ||||
|         flame.setStartSize(0.1f); | ||||
|         flame.setEndSize(0.5f); | ||||
|         flame.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f)); | ||||
|         flame.setParticlesPerSec(0); | ||||
|         flame.setGravity(0, -5, 0); | ||||
|         flame.setLowLife(.4f); | ||||
|         flame.setHighLife(.5f); | ||||
|         flame.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 7, 0)); | ||||
|         flame.getParticleInfluencer().setVelocityVariation(1f); | ||||
|         flame.setImagesX(2); | ||||
|         flame.setImagesY(2); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/flame.png")); | ||||
|         mat.setBoolean("PointSprite", POINT_SPRITE); | ||||
|         flame.setMaterial(mat); | ||||
|  | ||||
|         return flame; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a flash particle emitter. | ||||
|      *  | ||||
|      * @return a configured flash particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createFlash() { | ||||
|         ParticleEmitter flash = new ParticleEmitter("Flash", EMITTER_TYPE, 24 * COUNT_FACTOR); | ||||
|         flash.setSelectRandomImage(true); | ||||
|         flash.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1f / COUNT_FACTOR_F)); | ||||
|         flash.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f)); | ||||
|         flash.setStartSize(.1f); | ||||
|         flash.setEndSize(0.5f); | ||||
|         flash.setShape(new EmitterSphereShape(Vector3f.ZERO, .05f)); | ||||
|         flash.setParticlesPerSec(0); | ||||
|         flash.setGravity(0, 0, 0); | ||||
|         flash.setLowLife(.2f); | ||||
|         flash.setHighLife(.2f); | ||||
|         flash.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 5f, 0)); | ||||
|         flash.getParticleInfluencer().setVelocityVariation(1); | ||||
|         flash.setImagesX(2); | ||||
|         flash.setImagesY(2); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/flash.png")); | ||||
|         mat.setBoolean("PointSprite", POINT_SPRITE); | ||||
|         flash.setMaterial(mat); | ||||
|  | ||||
|         return flash; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a round spark particle emitter. | ||||
|      *  | ||||
|      * @return a configured round spark particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createRoundSpark() { | ||||
|         ParticleEmitter roundSpark = new ParticleEmitter("RoundSpark", EMITTER_TYPE, 20 * COUNT_FACTOR); | ||||
|         roundSpark.setStartColor(new ColorRGBA(1f, 0.29f, 0.34f, (float) (1.0 / COUNT_FACTOR_F))); | ||||
|         roundSpark.setEndColor(new ColorRGBA(0, 0, 0, 0.5f / COUNT_FACTOR_F)); | ||||
|         roundSpark.setStartSize(0.2f); | ||||
|         roundSpark.setEndSize(0.8f); | ||||
|         roundSpark.setShape(new EmitterSphereShape(Vector3f.ZERO, 1f)); | ||||
|         roundSpark.setParticlesPerSec(0); | ||||
|         roundSpark.setGravity(0, -.5f, 0); | ||||
|         roundSpark.setLowLife(1.8f); | ||||
|         roundSpark.setHighLife(2f); | ||||
|         roundSpark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 3, 0)); | ||||
|         roundSpark.getParticleInfluencer().setVelocityVariation(.5f); | ||||
|         roundSpark.setImagesX(1); | ||||
|         roundSpark.setImagesY(1); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/roundspark.png")); | ||||
|         mat.setBoolean("PointSprite", POINT_SPRITE); | ||||
|         roundSpark.setMaterial(mat); | ||||
|  | ||||
|         return roundSpark; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a spark particle emitter. | ||||
|      *  | ||||
|      * @return a configured spark particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createSpark() { | ||||
|         ParticleEmitter spark = new ParticleEmitter("Spark", Type.Triangle, 30 * COUNT_FACTOR); | ||||
|         spark.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1.0f / COUNT_FACTOR_F)); | ||||
|         spark.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f)); | ||||
|         spark.setStartSize(.5f); | ||||
|         spark.setEndSize(.5f); | ||||
|         spark.setFacingVelocity(true); | ||||
|         spark.setParticlesPerSec(0); | ||||
|         spark.setGravity(0, 5, 0); | ||||
|         spark.setLowLife(1.1f); | ||||
|         spark.setHighLife(1.5f); | ||||
|         spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 20, 0)); | ||||
|         spark.getParticleInfluencer().setVelocityVariation(1); | ||||
|         spark.setImagesX(1); | ||||
|         spark.setImagesY(1); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/spark.png")); | ||||
|         spark.setMaterial(mat); | ||||
|  | ||||
|         return spark; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a smoke trail particle emitter. | ||||
|      *  | ||||
|      * @return a configured smoke trail particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createSmokeTrail() { | ||||
|         ParticleEmitter smokeTrail = new ParticleEmitter("SmokeTrail", Type.Triangle, 22 * COUNT_FACTOR); | ||||
|         smokeTrail.setStartColor(new ColorRGBA(1f, 0.8f, 0.36f, 1.0f / COUNT_FACTOR_F)); | ||||
|         smokeTrail.setEndColor(new ColorRGBA(1f, 0.8f, 0.36f, 0f)); | ||||
|         smokeTrail.setStartSize(.2f); | ||||
|         smokeTrail.setEndSize(1f); | ||||
|         smokeTrail.setFacingVelocity(true); | ||||
|         smokeTrail.setParticlesPerSec(0); | ||||
|         smokeTrail.setGravity(0, 1, 0); | ||||
|         smokeTrail.setLowLife(.4f); | ||||
|         smokeTrail.setHighLife(.5f); | ||||
|         smokeTrail.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 12, 0)); | ||||
|         smokeTrail.getParticleInfluencer().setVelocityVariation(1); | ||||
|         smokeTrail.setImagesX(1); | ||||
|         smokeTrail.setImagesY(3); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/smoketrail.png")); | ||||
|         smokeTrail.setMaterial(mat); | ||||
|  | ||||
|         return smokeTrail; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a debris particle emitter. | ||||
|      *  | ||||
|      * @return a configured debris particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createDebris() { | ||||
|         ParticleEmitter debris = new ParticleEmitter("Debris", Type.Triangle, 15 * COUNT_FACTOR); | ||||
|         debris.setSelectRandomImage(true); | ||||
|         debris.setRandomAngle(true); | ||||
|         debris.setRotateSpeed(FastMath.TWO_PI * 4); | ||||
|         debris.setStartColor(new ColorRGBA(1f, 0.59f, 0.28f, 1.0f / COUNT_FACTOR_F)); | ||||
|         debris.setEndColor(new ColorRGBA(.5f, 0.5f, 0.5f, 0f)); | ||||
|         debris.setStartSize(.10f); | ||||
|         debris.setEndSize(.15f); | ||||
|         debris.setParticlesPerSec(0); | ||||
|         debris.setGravity(0, 12f, 0); | ||||
|         debris.setLowLife(1.4f); | ||||
|         debris.setHighLife(1.5f); | ||||
|         debris.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 15, 0)); | ||||
|         debris.getParticleInfluencer().setVelocityVariation(.60f); | ||||
|         debris.setImagesX(3); | ||||
|         debris.setImagesY(3); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/Debris.png")); | ||||
|         debris.setMaterial(mat); | ||||
|  | ||||
|         return debris; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a shockwave particle emitter. | ||||
|      *  | ||||
|      * @return a configured shockwave particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createShockwave() { | ||||
|         ParticleEmitter shockwave = new ParticleEmitter("Shockwave", Type.Triangle, 1 * COUNT_FACTOR); | ||||
|         shockwave.setFaceNormal(Vector3f.UNIT_Y); | ||||
|         shockwave.setStartColor(new ColorRGBA(.48f, 0.17f, 0.01f, .8f / COUNT_FACTOR_F)); | ||||
|         shockwave.setEndColor(new ColorRGBA(.48f, 0.17f, 0.01f, 0f)); | ||||
|         shockwave.setStartSize(0f); | ||||
|         shockwave.setEndSize(3f); | ||||
|         shockwave.setParticlesPerSec(0); | ||||
|         shockwave.setGravity(0, 0, 0); | ||||
|         shockwave.setLowLife(0.5f); | ||||
|         shockwave.setHighLife(0.5f); | ||||
|         shockwave.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 0, 0)); | ||||
|         shockwave.getParticleInfluencer().setVelocityVariation(0f); | ||||
|         shockwave.setImagesX(1); | ||||
|         shockwave.setImagesY(1); | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Explosion/shockwave.png")); | ||||
|         shockwave.setMaterial(mat); | ||||
|  | ||||
|         return shockwave; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a moving smoke emitter. | ||||
|      *  | ||||
|      * @return a configured smoke emitter | ||||
|      */ | ||||
|     ParticleEmitter createMovingSmokeEmitter() { | ||||
|         ParticleEmitter smokeEmitter = new ParticleEmitter("SmokeEmitter", Type.Triangle, 300); | ||||
|         smokeEmitter.setGravity(0, 0, 0); | ||||
|         smokeEmitter.getParticleInfluencer().setVelocityVariation(1); | ||||
|         smokeEmitter.setLowLife(1); | ||||
|         smokeEmitter.setHighLife(1); | ||||
|         smokeEmitter.getParticleInfluencer().setInitialVelocity(new Vector3f(0, .5f, 0)); | ||||
|         smokeEmitter.setImagesX(15); // Assuming the smoke texture is a sprite sheet with 15 frames | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Smoke/Smoke.png")); | ||||
|         smokeEmitter.setMaterial(mat); | ||||
|  | ||||
|         return smokeEmitter; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a one-time water splash particle emitter. | ||||
|      *  | ||||
|      * @return a configured one-time water splash particle emitter | ||||
|      */ | ||||
|     public ParticleEmitter createWaterSplash() { | ||||
|         // Create a new particle emitter for the splash effect | ||||
|         ParticleEmitter waterSplash = new ParticleEmitter("WaterSplash", Type.Triangle, 30); | ||||
|          | ||||
|         // Set the shape of the emitter, making particles emit from a point or small area | ||||
|         waterSplash.setShape(new EmitterSphereShape(Vector3f.ZERO, 0.2f)); | ||||
|          | ||||
|         // Start and end colors for water (blue, fading out) | ||||
|         waterSplash.setStartColor(new ColorRGBA(0.4f, 0.4f, 1f, 1f));  // Light blue at start | ||||
|         waterSplash.setEndColor(new ColorRGBA(0.4f, 0.4f, 1f, 0f));    // Transparent at the end | ||||
|          | ||||
|         // Particle size: small at start, larger before fading out | ||||
|         waterSplash.setStartSize(0.1f); | ||||
|         waterSplash.setEndSize(0.3f); | ||||
|  | ||||
|         // Particle lifespan (how long particles live) | ||||
|         waterSplash.setLowLife(0.5f); | ||||
|         waterSplash.setHighLife(1f); | ||||
|  | ||||
|         // Gravity: Pull the water particles downwards | ||||
|         waterSplash.setGravity(0, -9.81f, 0);  // Earth's gravity simulation | ||||
|          | ||||
|         // Velocity: Give particles an initial burst upward (simulates splash) | ||||
|         waterSplash.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 3, 0)); | ||||
|         waterSplash.getParticleInfluencer().setVelocityVariation(0.6f);  // Add randomness to splash | ||||
|          | ||||
|         // Set how many particles are emitted per second (0 to emit all particles at once) | ||||
|         waterSplash.setParticlesPerSec(0); | ||||
|          | ||||
|         // Load a texture for the water splash (assuming a texture exists at this path) | ||||
|         Material mat = new Material(app.getAssetManager(), "Common/MatDefs/Misc/Particle.j3md"); | ||||
|         mat.setTexture("Texture", app.getAssetManager().loadTexture("Effects/Splash/splash.png")); | ||||
|         waterSplash.setMaterial(mat); | ||||
|  | ||||
|         return waterSplash; | ||||
|     } | ||||
| } | ||||
| @@ -7,6 +7,7 @@ | ||||
|  | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.jme3.effect.ParticleEmitter; | ||||
| import com.jme3.material.Material; | ||||
| import com.jme3.material.RenderState.BlendMode; | ||||
| import com.jme3.math.ColorRGBA; | ||||
| @@ -19,6 +20,7 @@ import com.jme3.scene.shape.Cylinder; | ||||
| import pp.battleship.client.BattleshipApp; | ||||
| import pp.battleship.model.Battleship; | ||||
| import pp.battleship.model.Rotation; | ||||
| import pp.battleship.model.Shell; | ||||
| import pp.battleship.model.ShipMap; | ||||
| import pp.battleship.model.Shot; | ||||
|  | ||||
| @@ -35,6 +37,10 @@ import static pp.util.FloatMath.PI; | ||||
| class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|     private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS | ||||
|     private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS | ||||
|     private static final String BOAT_SMALL_MODEL = "Models/BoatSmall/12219_boat_v2_L2.j3o"; //NON-NLS | ||||
|     private static final String CV_MODEL = "Models/CV/CV.j3o"; //NON-NLS | ||||
|     private static final String BATTLE_MODEL = "Models/Battle/Battle.j3o"; //NON-NLS | ||||
|     private static final String LIGHTING = "Common/MatDefs/Light/Lighting.j3md"; | ||||
|     private static final String COLOR = "Color"; //NON-NLS | ||||
|     private static final String SHIP = "ship"; //NON-NLS | ||||
|     private static final String SHOT = "shot"; //NON-NLS | ||||
| @@ -44,6 +50,7 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|  | ||||
|     private final ShipMap map; | ||||
|     private final BattleshipApp app; | ||||
|     private final ParticleEffectFactory particleFactory; | ||||
|  | ||||
|     /** | ||||
|      * Constructs a {@code SeaSynchronizer} object with the specified application, root node, and ship map. | ||||
| @@ -56,6 +63,7 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|         super(app.getGameLogic().getOwnMap(), root); | ||||
|         this.app = app; | ||||
|         this.map = map; | ||||
|         this.particleFactory = new ParticleEffectFactory(app); | ||||
|         addExisting(); | ||||
|     } | ||||
|  | ||||
| @@ -69,7 +77,44 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|      */ | ||||
|     @Override | ||||
|     public Spatial visit(Shot shot) { | ||||
|         return shot.isHit() ? handleHit(shot) : createCylinder(shot); | ||||
|         return shot.isHit() ? handleHit(shot) : handleMiss(shot); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Handles a miss by representing it with a blue cylinder | ||||
|      * and attaching a water splash effect to it. | ||||
|      * @param shot the shot to be processed | ||||
|      * @return a Spatial simulating a miss with water splash effect | ||||
|      */ | ||||
|     private Spatial handleMiss(Shot shot) { | ||||
|         Node shotNode = new Node("ShotNode"); | ||||
|         Geometry shotCylinder = createCylinder(shot); | ||||
|         shotNode.attachChild(shotCylinder); | ||||
|         ParticleEmitter waterSplash = particleFactory.createWaterSplash(); | ||||
|         waterSplash.setLocalTranslation(shot.getY() + 0.5f, 0f, shot.getX() + 0.5f); | ||||
|         shotNode.attachChild(waterSplash); | ||||
|         waterSplash.emitAllParticles(); | ||||
|  | ||||
|         return shotNode; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Handles the sinking animation and removal of ship if destroyed | ||||
|      * @param ship the ship to be sunk | ||||
|      */ | ||||
|     private void sinkAndRemoveShip(Battleship ship) { | ||||
|         Battleship wilkeningklaunichtmeinencode = ship; | ||||
|         final Node shipNode = (Node) getSpatial(wilkeningklaunichtmeinencode); | ||||
|         if (shipNode == null) return; | ||||
|  | ||||
|         // Add sinking control to animate the sinking | ||||
|         shipNode.addControl(new SinkingControl(shipNode)); | ||||
|  | ||||
|         // Add particle effects | ||||
|         ParticleEmitter bubbles = particleFactory.createWaterSplash(); | ||||
|         bubbles.setLocalTranslation(shipNode.getLocalTranslation()); | ||||
|         shipNode.attachChild(bubbles); | ||||
|         bubbles.emitAllParticles(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -77,16 +122,58 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|      * contains the ship model as a child so that it moves with the ship. | ||||
|      * | ||||
|      * @param shot a hit | ||||
|      * @return always null to prevent the representation from being attached | ||||
|      * to the items node as well | ||||
|      * @return always null to prevent the representation from being attached to the items node as well | ||||
|      */ | ||||
|     private Spatial handleHit(Shot shot) { | ||||
|         final Battleship ship = requireNonNull(map.findShipAt(shot), "Missing ship"); | ||||
|         final Node shipNode = requireNonNull((Node) getSpatial(ship), "Missing ship node"); | ||||
|  | ||||
|         final Geometry representation = createCylinder(shot); | ||||
|         representation.getLocalTranslation().subtractLocal(shipNode.getLocalTranslation()); | ||||
|         shipNode.attachChild(representation); | ||||
|  | ||||
|  | ||||
|         // Create a new node specifically for the hit effects | ||||
|         Node hitEffectNode = new Node("HitEffectNode"); | ||||
|  | ||||
|         // Create particle effects | ||||
|         ParticleEmitter flame = particleFactory.createFlame(); | ||||
|         ParticleEmitter flash = particleFactory.createFlash(); | ||||
|         ParticleEmitter spark = particleFactory.createSpark(); | ||||
|         ParticleEmitter roundSpark = particleFactory.createRoundSpark(); | ||||
|         ParticleEmitter smokeTrail = particleFactory.createSmokeTrail(); | ||||
|         ParticleEmitter debris = particleFactory.createDebris(); | ||||
|         ParticleEmitter shockwave = particleFactory.createShockwave(); | ||||
|         ParticleEmitter movingSmoke = particleFactory.createMovingSmokeEmitter(); | ||||
|  | ||||
|         // Attach all effects to the hitEffectNode | ||||
|         hitEffectNode.attachChild(flame); | ||||
|         hitEffectNode.attachChild(flash); | ||||
|         hitEffectNode.attachChild(spark); | ||||
|         hitEffectNode.attachChild(roundSpark); | ||||
|         hitEffectNode.attachChild(smokeTrail); | ||||
|         hitEffectNode.attachChild(debris); | ||||
|         hitEffectNode.attachChild(shockwave); | ||||
|         hitEffectNode.attachChild(movingSmoke); | ||||
|  | ||||
|         // Set the local translation for the hit effect to the point of impact | ||||
|         hitEffectNode.setLocalTranslation(shot.getY() + 0.5f - shipNode.getLocalTranslation().x, | ||||
|                                           0.5f, // Adjust as needed for height above the ship | ||||
|                                           shot.getX() + 0.5f - shipNode.getLocalTranslation().z); | ||||
|  | ||||
|         // Attach the hitEffectNode to the shipNode so it moves with the ship | ||||
|         shipNode.attachChild(hitEffectNode); | ||||
|  | ||||
|         // Emit particles when the hit happens | ||||
|         flash.emitAllParticles(); | ||||
|         spark.emitAllParticles(); | ||||
|         smokeTrail.emitAllParticles(); | ||||
|         debris.emitAllParticles(); | ||||
|         shockwave.emitAllParticles(); | ||||
|         flame.emitAllParticles(); | ||||
|         roundSpark.emitAllParticles(); | ||||
|  | ||||
|         //Checks if ship is destroyed and triggers animation accordingly | ||||
|         if (ship.isDestroyed()) { | ||||
|             sinkAndRemoveShip(ship); | ||||
|         } | ||||
|  | ||||
|         return null; | ||||
|     } | ||||
| @@ -141,7 +228,13 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|      * @return the spatial representing the battleship | ||||
|      */ | ||||
|     private Spatial createShip(Battleship ship) { | ||||
|         return ship.getLength() == 4 ? createBattleship(ship) : createBox(ship); | ||||
|         switch (ship.getLength()) { | ||||
|             case 4: return createBattleship(ship); | ||||
|             case 3: return createCV(ship); | ||||
|             case 2: return createBattle(ship); | ||||
|             case 1: return createSmallship(ship); | ||||
|             default: return createBox(ship); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -191,6 +284,57 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|  | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.scale(1.48f); | ||||
|         // model.scale(0.0007f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
|     } | ||||
|      | ||||
|     /** | ||||
|      * Creates a detailed 3D model to represent a small tug boat. | ||||
|      * | ||||
|      * @param ship the battleship to be represented | ||||
|      * @return the spatial representing a small tug boat | ||||
|      */ | ||||
|     private Spatial createSmallship(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(BOAT_SMALL_MODEL); | ||||
|  | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.scale(0.0005f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a detailed 3D model to represent a "German WWII UBoat". | ||||
|      * | ||||
|      * @param ship the battleship to be represented | ||||
|      * @return the spatial representing the "German WWII UBoat" | ||||
|      */ | ||||
|     private Spatial createCV(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(CV_MODEL); | ||||
|  | ||||
|         model.rotate(0f, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.move(0f, 0.25f, 0f); | ||||
|         model.scale(0.85f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a detailed 3D model to represent a battleship. | ||||
|      * | ||||
|      * @param ship the battleship to be represented | ||||
|      * @return the spatial representing a battleship | ||||
|      */ | ||||
|     private Spatial createBattle(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(BATTLE_MODEL); | ||||
|  | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.move(0f, -0.06f, 0f); | ||||
|         model.scale(0.27f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
| @@ -210,4 +354,25 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|             case UP -> PI; | ||||
|         }; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates and returns a 3D model representation of the given {@code Shell} object | ||||
|      * for visualization in the game. | ||||
|      * | ||||
|      * @param shell The {@code Shell} object to be visualized. | ||||
|      * @return A {@code Spatial} object representing the 3D model of the shell. | ||||
|      */ | ||||
|     @Override | ||||
|     public Spatial visit(Shell shell) { | ||||
|         final Spatial model = app.getAssetManager().loadModel("Models/Shell/shell.j3o"); | ||||
|         model.setLocalScale(.05f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|         Material mat = new Material(app.getAssetManager(), LIGHTING); | ||||
|         mat.setTexture("DiffuseMap", app.getAssetManager().loadTexture("Models/Shell/shell_color.png")); | ||||
|         mat.setReceivesShadows(true); | ||||
|         model.setMaterial(mat); | ||||
|  | ||||
|         model.addControl(new ShellControl(shell)); | ||||
|         return model; | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,57 @@ | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.jme3.math.Vector3f; | ||||
| import com.jme3.renderer.RenderManager; | ||||
| import com.jme3.renderer.ViewPort; | ||||
| import com.jme3.scene.control.AbstractControl; | ||||
| import pp.battleship.model.Shell; | ||||
| import pp.util.Position; | ||||
|  | ||||
| /** | ||||
|  * Controls the 2D representation of a {@code Shell} in the game, updating its position | ||||
|  * based on the shell's current state in the game model. The {@code Shell2DControl} class | ||||
|  * is responsible for translating the shell's 3D position to a 2D view position within | ||||
|  * the game's map view. | ||||
|  */ | ||||
| public class Shell2DControl extends AbstractControl { | ||||
|     private final Shell shell; | ||||
|     private final MapView view; | ||||
|  | ||||
|     /** | ||||
|      * Constructs a new {@code Shell2DControl} to manage the 2D visualization of the given {@code Shell}. | ||||
|      * | ||||
|      * @param view  The {@code MapView} used to get information about the map to display. | ||||
|      * @param shell The {@code Shell} being visualized. | ||||
|      */ | ||||
|     public Shell2DControl(MapView view, Shell shell){ | ||||
|         this.shell = shell; | ||||
|         this.view = view; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Updates the position of the shell's 2D representation based on the shell's current | ||||
|      * 3D position in the game model. The position is mapped from model space to view space | ||||
|      * coordinates and translated to the appropriate location within the {@code MapView}. | ||||
|      * | ||||
|      * @param tpf Time per frame, representing the time elapsed since the last frame. | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlUpdate(float tpf) { | ||||
|         Vector3f shellPos = shell.getPosition(); | ||||
|         Position viewPos = view.modelToView(shellPos.x, shellPos.z); | ||||
|         spatial.setLocalTranslation(viewPos.getX() + MapView.FIELD_SIZE / 2, viewPos.getY() + MapView.FIELD_SIZE / 2, 0); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * This method is called during the rendering phase, but it does not perform any | ||||
|      * operations in this implementation as the control only influences the spatial's | ||||
|      * transformation, not its rendering process. | ||||
|      * | ||||
|      * @param rm the RenderManager rendering the controlled Spatial (not null) | ||||
|      * @param vp the ViewPort being rendered (not null) | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlRender(RenderManager rm, ViewPort vp) { | ||||
|         // No rendering-specific behavior required for this control | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,58 @@ | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.jme3.math.Vector3f; | ||||
| import com.jme3.renderer.RenderManager; | ||||
| import com.jme3.renderer.ViewPort; | ||||
| import com.jme3.scene.control.AbstractControl; | ||||
| import pp.battleship.model.Shell; | ||||
|  | ||||
| import static pp.util.FloatMath.PI; | ||||
|  | ||||
| /** | ||||
|  * Controls the 3D representation of a {@code Shell} in the game, updating its position | ||||
|  * and rotation based on the shell's current state in the game model. The {@code ShellControl} | ||||
|  * class ensures that the spatial associated with the shell is positioned and oriented correctly | ||||
|  * within the world. | ||||
|  */ | ||||
| public class ShellControl extends AbstractControl { | ||||
|     private final Shell shell; | ||||
|  | ||||
|     /** | ||||
|      * Constructs a new {@code ShellControl} to manage the 3D visualization of the given {@code Shell}. | ||||
|      * | ||||
|      * @param shell The {@code Shell} being visualized and controlled. | ||||
|      */ | ||||
|     public ShellControl(Shell shell){ | ||||
|         super(); | ||||
|         this.shell = shell; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Updates the 3D position and rotation of the shell based on its current state. | ||||
|      * Converts map coordinates to world coordinates and applies the shell's orientation. | ||||
|      * | ||||
|      * @param tpf Time per frame, representing the elapsed time since the last update. | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlUpdate(float tpf) { | ||||
|         Vector3f pos = shell.getPosition(); | ||||
|         Vector3f fixed = new Vector3f(pos.z + 0.5f, pos.y, pos.x + 0.5f); | ||||
|         fixed.setY(pos.y); | ||||
|         spatial.setLocalTranslation(fixed); | ||||
|         spatial.setLocalRotation(shell.getRotation()); | ||||
|         spatial.rotate(PI/2,0,0); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * This method is called during the rendering phase, but it does not perform any | ||||
|      * operations in this implementation as the control only influences the spatial's | ||||
|      * transformation, not its rendering process. | ||||
|      * | ||||
|      * @param rm the RenderManager rendering the controlled Spatial (not null) | ||||
|      * @param vp the ViewPort being rendered (not null) | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlRender(RenderManager rm, ViewPort vp) { | ||||
|         // No rendering-specific behavior required for this control | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,61 @@ | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.jme3.scene.control.AbstractControl; | ||||
| import com.jme3.math.Vector3f; | ||||
| import com.jme3.renderer.RenderManager; | ||||
| import com.jme3.renderer.ViewPort; | ||||
| import com.jme3.scene.Node; | ||||
|  | ||||
| /** | ||||
|  * Control that handles the sinking effect for destroyed ships. | ||||
|  * It will gradually move the ship downwards and then remove it from the scene. | ||||
|  */ | ||||
| class SinkingControl extends AbstractControl { | ||||
|     private static final float SINK_DURATION = 5f;  // Duration of the sinking animation | ||||
|     private static final float SINK_SPEED = 0.1f;   // Speed at which the ship sinks | ||||
|     private float elapsedTime = 0; | ||||
|  | ||||
|     private final Node shipNode; | ||||
|  | ||||
|     /** | ||||
|      * Constructs a {@code SinkingControl} object with the shipNode to be to be sunk | ||||
|      * @param shipNode the node to handeld | ||||
|      */ | ||||
|     public SinkingControl(Node shipNode) { | ||||
|         this.shipNode = shipNode; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Updated the Map to sink the ship | ||||
|      *  | ||||
|      * @param tpf time per frame | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlUpdate(float tpf) { | ||||
|         // Update the sinking effect | ||||
|         elapsedTime += tpf; | ||||
|  | ||||
|         // Move the ship down over time | ||||
|         Vector3f currentPos = shipNode.getLocalTranslation(); | ||||
|         shipNode.setLocalTranslation(currentPos.x, currentPos.y - SINK_SPEED * tpf, currentPos.z); | ||||
|  | ||||
|         // Check if sinking duration has passed | ||||
|         if (elapsedTime >= SINK_DURATION) { | ||||
|             // Remove the ship from the scene | ||||
|             shipNode.removeFromParent(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * This method is called during the rendering phase, but it does not perform any | ||||
|      * operations in this implementation as the control only influences the spatial's | ||||
|      * transformation, not its rendering process. | ||||
|      * | ||||
|      * @param rm the RenderManager rendering the controlled Spatial (not null) | ||||
|      * @param vp the ViewPort being rendered (not null) | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlRender(RenderManager rm, ViewPort vp) { | ||||
|         // No rendering-related code needed | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,36 @@ | ||||
| package pp.battleship.client.gui; | ||||
|  | ||||
| import com.simsilica.lemur.Slider; | ||||
|  | ||||
| /** | ||||
|  * The VolumeSlider class represents the Volume Slider in the Menu. | ||||
|  * It extends the Slider class and provides functionalities for setting the music volume, | ||||
|  * with the help of the Slider in the GUI  | ||||
|  */ | ||||
| public class VolumeSlider extends Slider { | ||||
|  | ||||
|     private final GameMusic music; | ||||
|     private double vol; | ||||
|  | ||||
|     /** | ||||
|      * Constructs the Volume Slider for the Menu dialog | ||||
|      * @param music the music instance | ||||
|      */ | ||||
|     public VolumeSlider(GameMusic music) { | ||||
|         super(); | ||||
|         this.music = music; | ||||
|         vol = GameMusic.volumeInPreferences(); | ||||
|         getModel().setPercent(vol); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * when triggered it updates the volume to the value set with the slider | ||||
|      */ | ||||
|     public void update() { | ||||
|         if (vol != getModel().getPercent()) { | ||||
|             vol = getModel().getPercent(); | ||||
|             music.setVolume( (float) vol); | ||||
|         } | ||||
|     } | ||||
|      | ||||
| } | ||||
| @@ -0,0 +1,182 @@ | ||||
| //////////////////////////////////////// | ||||
| // Programming project code | ||||
| // UniBw M, 2022, 2023, 2024 | ||||
| // www.unibw.de/inf2 | ||||
| // (c) Mark Minas (mark.minas@unibw.de) | ||||
| //////////////////////////////////////// | ||||
|  | ||||
| package pp.battleship.server; | ||||
|  | ||||
| import com.jme3.network.ConnectionListener; | ||||
| import com.jme3.network.HostedConnection; | ||||
| import com.jme3.network.Message; | ||||
| import com.jme3.network.MessageListener; | ||||
| import com.jme3.network.Network; | ||||
| import com.jme3.network.Server; | ||||
| import com.jme3.network.serializing.Serializer; | ||||
| import pp.battleship.BattleshipConfig; | ||||
| import pp.battleship.game.server.Player; | ||||
| import pp.battleship.game.server.ServerGameLogic; | ||||
| import pp.battleship.game.server.ServerSender; | ||||
| import pp.battleship.message.client.AnimationFinishedMessage; | ||||
| import pp.battleship.message.client.ClientMessage; | ||||
| import pp.battleship.message.client.MapMessage; | ||||
| import pp.battleship.message.client.ShootMessage; | ||||
| import pp.battleship.message.server.EffectMessage; | ||||
| import pp.battleship.message.server.GameDetails; | ||||
| import pp.battleship.message.server.ServerMessage; | ||||
| import pp.battleship.message.server.StartBattleMessage; | ||||
| import pp.battleship.model.Battleship; | ||||
| import pp.battleship.model.IntPoint; | ||||
| import pp.battleship.model.Shot; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.FileInputStream; | ||||
| import java.io.IOException; | ||||
| import java.lang.System.Logger; | ||||
| import java.lang.System.Logger.Level; | ||||
| import java.util.concurrent.BlockingQueue; | ||||
| import java.util.concurrent.LinkedBlockingQueue; | ||||
| import java.util.logging.LogManager; | ||||
|  | ||||
| /** | ||||
|  * Server implementing the visitor pattern as MessageReceiver for ClientMessages | ||||
|  */ | ||||
| public class BattleshipServer implements MessageListener<HostedConnection>, ConnectionListener, ServerSender { | ||||
|     private static final Logger LOGGER = System.getLogger(BattleshipServer.class.getName()); | ||||
|     private static final File CONFIG_FILE = new File("server.properties"); | ||||
|  | ||||
|     private final BattleshipConfig config = new BattleshipConfig(); | ||||
|     private Server myServer; | ||||
|     private final ServerGameLogic logic; | ||||
|     private final BlockingQueue<ReceivedMessage> pendingMessages = new LinkedBlockingQueue<>(); | ||||
|  | ||||
|     static { | ||||
|         // Configure logging | ||||
|         LogManager manager = LogManager.getLogManager(); | ||||
|         try { | ||||
|             manager.readConfiguration(new FileInputStream("logging.properties")); | ||||
|             LOGGER.log(Level.INFO, "Successfully read logging properties"); //NON-NLS | ||||
|         } | ||||
|         catch (IOException e) { | ||||
|             LOGGER.log(Level.INFO, e.getMessage()); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Starts the Battleships server. | ||||
|      */ | ||||
|     public static void main(String[] args) { | ||||
|         new BattleshipServer().run(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates the server. | ||||
|      */ | ||||
|     BattleshipServer() { | ||||
|         config.readFromIfExists(CONFIG_FILE); | ||||
|         LOGGER.log(Level.INFO, "Configuration: {0}", config); //NON-NLS | ||||
|         logic = new ServerGameLogic(this, config); | ||||
|     } | ||||
|  | ||||
|     public void run() { | ||||
|         startServer(); | ||||
|         while (true) | ||||
|             processNextMessage(); | ||||
|     } | ||||
|  | ||||
|     private void startServer() { | ||||
|         try { | ||||
|             LOGGER.log(Level.INFO, "Starting server..."); //NON-NLS | ||||
|             myServer = Network.createServer(config.getPort()); | ||||
|             initializeSerializables(); | ||||
|             myServer.start(); | ||||
|             registerListeners(); | ||||
|             LOGGER.log(Level.INFO, "Server started: {0}", myServer.isRunning()); //NON-NLS | ||||
|         } | ||||
|         catch (IOException e) { | ||||
|             LOGGER.log(Level.ERROR, "Couldn't start server: {0}", e.getMessage()); //NON-NLS | ||||
|             exit(1); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void processNextMessage() { | ||||
|         try { | ||||
|             pendingMessages.take().process(logic); | ||||
|         } | ||||
|         catch (InterruptedException ex) { | ||||
|             LOGGER.log(Level.INFO, "Interrupted while waiting for messages"); //NON-NLS | ||||
|             Thread.currentThread().interrupt(); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void initializeSerializables() { | ||||
|         Serializer.registerClass(GameDetails.class); | ||||
|         Serializer.registerClass(StartBattleMessage.class); | ||||
|         Serializer.registerClass(MapMessage.class); | ||||
|         Serializer.registerClass(ShootMessage.class); | ||||
|         Serializer.registerClass(EffectMessage.class); | ||||
|         Serializer.registerClass(AnimationFinishedMessage.class); | ||||
|         Serializer.registerClass(Battleship.class); | ||||
|         Serializer.registerClass(IntPoint.class); | ||||
|         Serializer.registerClass(Shot.class); | ||||
|     } | ||||
|  | ||||
|     private void registerListeners() { | ||||
|         myServer.addMessageListener(this, MapMessage.class); | ||||
|         myServer.addMessageListener(this, ShootMessage.class); | ||||
|         myServer.addMessageListener(this, AnimationFinishedMessage.class); | ||||
|         myServer.addConnectionListener(this); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void messageReceived(HostedConnection source, Message message) { | ||||
|         LOGGER.log(Level.INFO, "message received from {0}: {1}", source.getId(), message); //NON-NLS | ||||
|         if (message instanceof ClientMessage clientMessage) | ||||
|             pendingMessages.add(new ReceivedMessage(clientMessage, source.getId())); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void connectionAdded(Server server, HostedConnection hostedConnection) { | ||||
|         LOGGER.log(Level.INFO, "new connection {0}", hostedConnection); //NON-NLS | ||||
|         logic.addPlayer(hostedConnection.getId()); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void connectionRemoved(Server server, HostedConnection hostedConnection) { | ||||
|         LOGGER.log(Level.INFO, "connection closed: {0}", hostedConnection); //NON-NLS | ||||
|         final Player player = logic.getPlayerById(hostedConnection.getId()); | ||||
|         if (player == null) | ||||
|             LOGGER.log(Level.INFO, "closed connection does not belong to an active player"); //NON-NLS | ||||
|         else { //NON-NLS | ||||
|             LOGGER.log(Level.INFO, "closed connection belongs to {0}", player); //NON-NLS | ||||
|             exit(0); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private void exit(int exitValue) { //NON-NLS | ||||
|         LOGGER.log(Level.INFO, "close request"); //NON-NLS | ||||
|         if (myServer != null) | ||||
|             for (HostedConnection client : myServer.getConnections()) //NON-NLS | ||||
|                 if (client != null) client.close("Game over"); //NON-NLS | ||||
|         System.exit(exitValue); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Send the specified message to the specified connection. | ||||
|      * | ||||
|      * @param id      the connection id | ||||
|      * @param message the message | ||||
|      */ | ||||
|     public void send(int id, ServerMessage message) { | ||||
|         if (myServer == null || !myServer.isRunning()) { | ||||
|             LOGGER.log(Level.ERROR, "no server running when trying to send {0}", message); //NON-NLS | ||||
|             return; | ||||
|         } | ||||
|         final HostedConnection connection = myServer.getConnection(id); | ||||
|         if (connection != null) | ||||
|             connection.send(message); | ||||
|         else | ||||
|             LOGGER.log(Level.ERROR, "there is no connection with id={0}", id); //NON-NLS | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| //////////////////////////////////////// | ||||
| // Programming project code | ||||
| // UniBw M, 2022, 2023, 2024 | ||||
| // www.unibw.de/inf2 | ||||
| // (c) Mark Minas (mark.minas@unibw.de) | ||||
| //////////////////////////////////////// | ||||
|  | ||||
| package pp.battleship.server; | ||||
|  | ||||
| import pp.battleship.message.client.ClientInterpreter; | ||||
| import pp.battleship.message.client.ClientMessage; | ||||
|  | ||||
| record ReceivedMessage(ClientMessage message, int from) { | ||||
|     void process(ClientInterpreter interpreter) { | ||||
|         message.accept(interpreter, from); | ||||
|     } | ||||
| } | ||||
| After Width: | Height: | Size: 16 KiB | 
| After Width: | Height: | Size: 46 KiB | 
| After Width: | Height: | Size: 63 KiB | 
| After Width: | Height: | Size: 2.0 KiB | 
| After Width: | Height: | Size: 16 KiB | 
| After Width: | Height: | Size: 32 KiB | 
| After Width: | Height: | Size: 1.8 KiB | 
| After Width: | Height: | Size: 28 KiB | 
| After Width: | Height: | Size: 16 KiB | 
| After Width: | Height: | Size: 168 KiB | 
| After Width: | Height: | Size: 56 KiB | 
| After Width: | Height: | Size: 166 KiB | 
| After Width: | Height: | Size: 98 KiB | 
| After Width: | Height: | Size: 35 KiB | 
| After Width: | Height: | Size: 54 KiB | 
| After Width: | Height: | Size: 9.3 KiB | 
							
								
								
									
										
											BIN
										
									
								
								Projekte/battleship/client/src/main/resources/Models/CV/CV.j3o
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 66 KiB | 
| After Width: | Height: | Size: 3.2 KiB | 
| After Width: | Height: | Size: 30 KiB | 
| After Width: | Height: | Size: 10 KiB | 
| After Width: | Height: | Size: 9.4 KiB | 
| After Width: | Height: | Size: 264 KiB | 
							
								
								
									
										
											BIN
										
									
								
								Projekte/battleship/client/src/main/resources/Models/CV/_2.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 80 KiB | 
							
								
								
									
										
											BIN
										
									
								
								Projekte/battleship/client/src/main/resources/Models/CV/_6.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 91 KiB | 
| After Width: | Height: | Size: 33 KiB | 
| After Width: | Height: | Size: 98 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 78 B | 
| After Width: | Height: | Size: 79 B | 
| After Width: | Height: | Size: 96 KiB | 
| After Width: | Height: | Size: 82 KiB | 
							
								
								
									
										
											BIN
										
									
								
								Projekte/battleship/client/src/main/resources/Models/CV/prev.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 670 KiB | 
| After Width: | Height: | Size: 43 KiB | 
| @@ -42,7 +42,15 @@ public class ModelExporter extends SimpleApplication { | ||||
|     @Override | ||||
|     public void simpleInitApp() { | ||||
|         export("Models/KingGeorgeV/King_George_V.obj", "KingGeorgeV.j3o"); //NON-NLS | ||||
|  | ||||
|         export("Models/BoatSmall/12219_boat_v2_L2.obj", "BoatSmall.j3o"); //NON-NLS | ||||
|         export("Models/Battle/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "Battle.j3o"); //NON-NLS | ||||
|         export("Models/CV/essex_scb-125_generic.obj", "CV.j3o"); //NON-NLS | ||||
|         export("Models/Figures/Würfel_blau.obj", "Würfel_blau.j30"); | ||||
|         export("Models/Figures/Würfel_gelb.obj", "Würfel_gelb.j30"); | ||||
|         export("Models/Figures/Würfel_grün.obj", "Würfel_grün.j30"); | ||||
|         export("Models/Figures/Würfel_rosa.obj", "Würfel_rosa.j30"); | ||||
|         export("Models/Figures/Würfel_rot.obj", "Würfel_rot.j30"); | ||||
|         export("Models/Figures/Würfel_schwarz.obj", "Würfel_schwarz.j30"); | ||||
|         stop(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -0,0 +1,16 @@ | ||||
| # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware | ||||
| # File Created: 29.03.2012 14:25:39 | ||||
|  | ||||
| newmtl default | ||||
| 	Ns 35.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 1.0000 1.0000 1.0000 | ||||
| 	Kd 1.0000 1.0000 1.0000 | ||||
| 	Ks 0.5400 0.5400 0.5400 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
| 	map_Ka 14084_WWII_ship_German_Type_II_U-boat_diff.jpg | ||||
| 	map_Kd 14084_WWII_ship_German_Type_II_U-boat_diff.jpg | ||||
| After Width: | Height: | Size: 168 KiB | 
| @@ -0,0 +1,104 @@ | ||||
| # 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware | ||||
| # File Created: 16.12.2011 14:18:52 | ||||
|  | ||||
| newmtl white | ||||
| 	Ns 53.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 0.6667 0.6667 0.6667 | ||||
| 	Kd 0.6667 0.6667 0.6667 | ||||
| 	Ks 0.1800 0.1800 0.1800 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
|  | ||||
| newmtl boat_elements_black | ||||
| 	Ns 55.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 0.0000 0.0000 0.0000 | ||||
| 	Kd 0.0000 0.0000 0.0000 | ||||
| 	Ks 0.3600 0.3600 0.3600 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
|  | ||||
| newmtl boat_glass | ||||
| 	Ns 60.0000 | ||||
| 	Ni 7.0000 | ||||
| 	d 0.4000 | ||||
| 	Tr 0.6000 | ||||
| 	Tf 0.4000 0.4000 0.4000  | ||||
| 	illum 2 | ||||
| 	Ka 0.1059 0.1569 0.1451 | ||||
| 	Kd 0.1059 0.1569 0.1451 | ||||
| 	Ks 0.6750 0.6750 0.6750 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
|  | ||||
| newmtl boat_screw_hooks_bronze | ||||
| 	Ns 80.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 0.2941 0.2157 0.0510 | ||||
| 	Kd 0.2941 0.2157 0.0510 | ||||
| 	Ks 0.7200 0.7200 0.7200 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
|  | ||||
| newmtl boat_silver | ||||
| 	Ns 80.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 0.3333 0.3333 0.3333 | ||||
| 	Kd 0.3333 0.3333 0.3333 | ||||
| 	Ks 0.7200 0.7200 0.7200 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
|  | ||||
| newmtl boat_buffer | ||||
| 	Ns 10.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 1.0000 1.0000 1.0000 | ||||
| 	Kd 1.0000 1.0000 1.0000 | ||||
| 	Ks 0.2700 0.2700 0.2700 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
| 	map_Ka boat_buffer_diffuse.jpg | ||||
| 	map_Kd boat_buffer_diffuse.jpg | ||||
|  | ||||
| newmtl boat_roof_accessory | ||||
| 	Ns 15.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 1.0000 1.0000 1.0000 | ||||
| 	Kd 1.0000 1.0000 1.0000 | ||||
| 	Ks 0.3600 0.3600 0.3600 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
| 	map_Ka boat_roof_accessory_diffuse.jpg | ||||
| 	map_Kd boat_roof_accessory_diffuse.jpg | ||||
|  | ||||
| newmtl boat_body | ||||
| 	Ns 55.0000 | ||||
| 	Ni 1.5000 | ||||
| 	d 1.0000 | ||||
| 	Tr 0.0000 | ||||
| 	Tf 1.0000 1.0000 1.0000  | ||||
| 	illum 2 | ||||
| 	Ka 1.0000 1.0000 1.0000 | ||||
| 	Kd 1.0000 1.0000 1.0000 | ||||
| 	Ks 0.3600 0.3600 0.3600 | ||||
| 	Ke 0.0000 0.0000 0.0000 | ||||
| 	map_Ka boat_body_diffuse.jpg | ||||
| 	map_Kd boat_body_diffuse.jpg | ||||
| After Width: | Height: | Size: 56 KiB | 
| After Width: | Height: | Size: 166 KiB | 
| After Width: | Height: | Size: 98 KiB | 
| After Width: | Height: | Size: 35 KiB | 
| After Width: | Height: | Size: 54 KiB | 
| After Width: | Height: | Size: 9.3 KiB | 
| After Width: | Height: | Size: 66 KiB |