Fix bump collision direction bug. Add AIs for Stages I and II

sigonasr2 3 months ago
parent a235dc7ca3
commit e967e00257
  1. 1
      assets/StageI.tmx.0
  2. 1
      assets/StageI.tmx.1
  3. 1
      assets/StageI.tmx.2
  4. 1
      assets/StageI.tmx.3
  5. 1
      assets/StageI.tmx.4
  6. 1
      assets/StageI.tmx.5
  7. 1
      assets/StageI.tmx.6
  8. 1
      assets/StageI.tmx.7
  9. 1
      assets/StageI.tmx.8
  10. 1
      assets/StageII.tmx.2
  11. 1
      assets/StageII.tmx.3
  12. 1
      assets/StageII.tmx.4
  13. 1
      assets/StageII.tmx.5
  14. 1
      assets/StageII.tmx.6
  15. 1
      assets/StageII.tmx.7
  16. 1
      assets/StageII.tmx.8
  17. 85
      src/Hamster.cpp
  18. 3
      src/Hamster.h
  19. 2
      src/HamsterGame.cpp

@ -0,0 +1 @@
269 3999 0 267 3983 0 255 3971 0 252 3967 0 245 3951 0 245 3935 0 249 3919 0 256 3912 0 265 3903 0 272 3893 0 272 3887 0 272 3871 0 272 3855 0 272 3839 0 272 3823 0 272 3807 0 272 3791 0 276 3775 0 286 3759 0 286 3743 0 286 3727 0 286 3711 0 286 3695 0 286 3679 0 286 3663 0 286 3647 0 286 3631 0 286 3615 0 286 3599 0 286 3583 0 286 3567 0 286 3551 0 286 3536 5 286 3535 0 286 3519 0 287 3503 0 288 3502 0 301 3487 0 304 3484 0 316 3471 0 320 3468 0 336 3465 0 352 3465 0 368 3465 0 384 3465 0 400 3465 0 416 3465 0 432 3465 0 448 3465 0 464 3465 0 480 3465 0 496 3465 0 512 3465 0 528 3465 0 544 3465 0 560 3465 0 576 3465 0 592 3465 0 608 3465 0 624 3465 0 640 3465 0 656 3465 0 672 3465 0 688 3465 0 704 3465 0 720 3465 0 736 3465 0 752 3465 0 768 3465 0 784 3465 0 800 3465 0 816 3465 0 832 3465 0 848 3465 0 864 3465 0 880 3465 0 896 3465 0 912 3465 0 928 3465 0 944 3465 0 960 3465 0 976 3465 0 992 3464 0 1005 3455 0 1008 3453 0 1024 3441 0 1040 3441 0 1056 3441 0 1072 3441 0 1088 3441 0 1104 3441 0 1120 3441 0 1136 3440 0 1140 3439 0 1152 3430 0 1158 3424 5 1159 3423 0 1168 3411 0 1169 3407 0 1169 3391 0 1169 3375 0 1169 3359 0 1169 3343 0 1169 3327 0 1169 3311 0 1169 3295 0 1169 3279 0 1169 3263 0 1172 3247 0 1184 3236 0 1188 3231 0 1200 3220 0 1204 3215 0 1211 3208 1 1216 3203 0 1217 3199 0 1218 3183 0 1218 3167 0 1218 3151 0 1218 3135 0 1218 3119 0 1218 3103 0 1218 3087 0 1218 3071 0 1218 3055 0 1218 3039 0 1218 3023 0 1218 3007 0 1218 2991 0 1218 2975 0 1218 2959 0 1218 2943 0 1218 2927 0 1218 2911 0 1218 2895 0 1218 2879 0 1218 2863 0 1218 2847 0 1218 2831 0 1218 2815 0 1218 2799 0 1218 2783 0 1218 2767 0 1218 2751 0 1218 2735 0 1218 2719 0 1218 2703 0 1218 2687 0 1218 2671 0 1218 2655 0 1218 2639 0 1218 2623 0 1215 2614 0 1210 2607 0 1201 2591 0 1201 2576 5 1201 2575 0 1199 2569 0 1191 2559 0 1183 2551 0 1174 2543 0 1167 2540 0 1151 2540 0 1135 2540 0 1119 2540 0 1103 2540 0 1087 2540 0 1071 2540 0 1055 2540 0 1039 2540 0 1023 2540 0 1007 2540 0 991 2540 0 975 2543 0 975 2544 0 959 2559 0 959 2560 0 943 2575 0 943 2576 0 927 2591 0 927 2592 0 911 2607 0 911 2608 0 895 2615 0 879 2615 0 863 2615 0 847 2615 0 831 2615 0 831 2615 1 815 2615 0 799 2612 0 794 2607 0 783 2596 0 778 2591 0 772 2575 0 772 2559 0 772 2543 0 772 2527 0 772 2511 0 772 2495 0 772 2479 0 772 2463 0 772 2447 0 772 2431 0 778 2415 0 784 2409 0 794 2399 0 800 2393 0 810 2383 0 816 2377 0 826 2367 0 832 2361 0 836 2351 0 838 2335 0 838 2319 0 838 2303 0 838 2287 0 838 2271 0 838 2255 0 838 2238 0 838 2223 0 838 2207 0 838 2190 0 838 2175 0 838 2158 0 838 2143 0 838 2127 0 838 2111 0 838 2095 0 847 2079 0 848 2078 0 860 2063 0 863 2047 0 863 2031 0 864 2024 0 867 2015 0 877 1999 0 879 1983 0 879 1967 0 879 1951 0 879 1935 0 879 1919 0 879 1903 0 880 1900 0 886 1887 0 896 1877 0 902 1871 0 912 1861 0 918 1855 0 928 1845 0 934 1839 0 944 1829 0 950 1823 0 960 1813 0 966 1807 0 976 1797 0 982 1791 0 992 1781 0 998 1775 0 1008 1765 0 1014 1759 0 1024 1749 0 1030 1743 0 1040 1733 0 1046 1727 0 1056 1717 0 1062 1711 0 1072 1701 0 1077 1695 0 1088 1685 0 1093 1679 0 1104 1669 0 1110 1663 0 1120 1653 0 1126 1647 0 1136 1637 0 1142 1631 0 1152 1619 0 1153 1616 5 1153 1615 0 1155 1598 0 1155 1582 0 1155 1567 0 1155 1550 0 1155 1535 0 1155 1519 0 1155 1503 0 1155 1487 0 1155 1471 0 1155 1455 0 1155 1439 0 1155 1423 0 1155 1407 0 1155 1390 0 1155 1375 0 1155 1359 0 1155 1343 0 1155 1327 0 1155 1311 0 1155 1295 0 1155 1279 0 1155 1263 0 1155 1246 0 1155 1231 0 1155 1215 0 1155 1199 0 1155 1183 0 1155 1166 0 1155 1151 0 1154 1135 0 1151 1126 0 1147 1119 0 1135 1107 0 1131 1103 0 1119 1092 0 1115 1087 0 1103 1076 0 1099 1071 0 1087 1060 0 1083 1055 0 1071 1044 0 1067 1039 0 1055 1028 0 1051 1023 0 1039 1012 0 1035 1007 0 1023 996 0 1019 991 0 1007 980 0 1003 975 0 991 964 0 987 959 0 975 948 0 971 943 0 959 932 0 950 927 0 942 926 0 927 926 0 911 926 0 895 926 0 879 926 0 863 924 0 847 912 0 846 911 0 831 897 0 829 895 0 815 892 0 799 891 0 783 882 0 780 879 0 767 866 0 765 863 0 762 847 0 762 831 0 762 815 0 762 799 0 762 783 0 762 767 0 762 751 0 762 735 0 756 719 0 751 715 0 740 703 0 735 698 0 724 687 0 719 682 0 708 671 0 703 667 0 692 655 0 687 651 0 676 639 0 671 635 0 659 623 0 655 618 0 644 607 0 639 603 0 628 591 0 623 588 0 607 583 0 591 582 0 577 575 0 575 573 0 561 559 0 559 557 0 546 543 0 543 541 0 529 527 0 527 525 0 514 511 0 511 509 0 501 495 0 499 479 0 499 463 0 499 447 0 499 431 0 499 415 0 499 399 0 499 383 0 499 367 0 499 351 0 499 335 0 499 319 0 499 303 0 499 287 0 500 271 0 512 255 0 527 239 0 528 239 0 542 223 0 544 221 0 548 207 0 560 192 0 561 191 0 576 181 0 592 181 0 608 181 0 624 181 0 640 181 0 656 181 0 672 181 0 688 181 0 704 181 0 720 181 0 736 181 0 752 186 0 757 192 0 761 208 0 761 224 0 761 240 0 761 256 0 761 272 0 761 280 5 761 288 0 761 304 0

@ -0,0 +1 @@
321 3967 0 319 3965 0 306 3951 0 303 3949 0 292 3935 0 290 3919 0 293 3903 0 298 3887 0 299 3871 0 299 3855 0 299 3839 0 299 3823 0 299 3807 0 299 3791 0 299 3775 0 302 3759 0 303 3743 0 303 3727 0 303 3711 0 303 3695 0 303 3679 0 303 3663 0 303 3647 0 303 3631 0 303 3615 0 303 3599 0 303 3583 0 303 3567 0 304 3559 0 305 3551 0 308 3536 5 308 3535 0 308 3519 0 312 3503 0 320 3496 0 329 3487 0 336 3481 0 352 3473 0 368 3478 0 384 3481 0 400 3481 0 416 3481 0 433 3481 0 448 3481 0 464 3481 0 481 3481 0 497 3481 0 512 3481 0 529 3481 0 545 3481 0 560 3481 0 576 3481 0 592 3481 0 608 3481 0 625 3481 0 641 3481 0 657 3481 0 673 3481 0 688 3481 0 705 3481 0 720 3481 0 736 3481 0 752 3481 0 768 3481 0 784 3481 0 800 3481 0 816 3481 0 832 3481 0 848 3481 0 864 3481 0 880 3481 0 896 3481 0 912 3481 0 928 3481 0 944 3481 0 960 3481 0 976 3481 0 992 3481 0 1008 3481 0 1024 3481 0 1040 3481 0 1056 3481 0 1072 3481 0 1088 3481 0 1104 3481 0 1120 3478 0 1128 3471 0 1136 3463 0 1144 3455 0 1152 3447 0 1158 3442 5 1160 3439 0 1168 3432 0 1178 3423 0 1184 3417 0 1195 3407 0 1200 3401 0 1211 3391 0 1216 3386 0 1225 3374 0 1226 3359 0 1226 3342 0 1226 3327 0 1226 3310 0 1226 3295 0 1226 3279 0 1226 3262 0 1226 3247 0 1226 3231 0 1227 3215 0 1228 3214 1 1231 3199 0 1232 3199 0 1234 3182 0 1234 3167 0 1234 3151 0 1234 3135 0 1234 3118 0 1234 3103 0 1234 3087 0 1234 3070 0 1234 3055 0 1234 3039 0 1234 3022 0 1234 3006 0 1234 2991 0 1234 2975 0 1234 2959 0 1234 2942 0 1234 2927 0 1234 2911 0 1234 2895 0 1234 2879 0 1234 2863 0 1234 2847 0 1234 2831 0 1234 2815 0 1234 2799 0 1234 2783 0 1234 2767 0 1234 2751 0 1234 2735 0 1234 2719 0 1234 2703 0 1234 2687 0 1234 2671 0 1234 2655 0 1234 2639 0 1232 2623 0 1231 2620 0 1228 2607 0 1228 2591 0 1228 2576 5 1228 2575 0 1228 2559 0 1228 2543 0 1217 2526 0 1215 2524 0 1202 2511 0 1199 2510 0 1182 2507 0 1167 2507 0 1151 2507 0 1133 2507 0 1118 2507 0 1103 2507 0 1087 2507 0 1071 2507 0 1055 2507 0 1039 2507 0 1022 2507 0 1007 2507 0 991 2507 0 975 2507 0 959 2507 0 943 2507 0 927 2507 0 911 2506 0 900 2495 0 895 2490 0 884 2479 0 879 2475 0 875 2463 0 875 2447 0 875 2431 0 875 2415 0 875 2399 0 875 2383 0 875 2367 0 875 2351 0 875 2335 0 875 2319 0 875 2303 0 875 2287 0 875 2271 0 875 2255 0 875 2239 0 875 2223 0 875 2207 0 875 2191 0 875 2175 0 875 2159 0 875 2143 0 875 2127 0 875 2111 0 875 2095 0 875 2079 0 875 2063 0 875 2047 0 875 2031 0 875 2015 0 875 1999 0 875 1983 0 875 1967 0 875 1951 0 875 1935 0 875 1919 0 880 1904 0 880 1903 0 896 1888 0 896 1887 0 912 1872 0 913 1871 0 928 1856 0 928 1855 0 934 1839 0 934 1823 0 934 1807 0 934 1791 0 934 1775 0 938 1759 0 944 1754 0 954 1743 0 960 1738 0 970 1727 0 976 1721 0 986 1711 0 992 1705 0 1002 1695 0 1008 1690 0 1018 1679 0 1024 1673 0 1034 1663 0 1040 1657 0 1050 1647 0 1056 1642 0 1066 1631 0 1072 1626 0 1082 1615 0 1088 1609 0 1098 1599 0 1104 1593 0 1114 1583 0 1120 1577 0 1126 1572 5 1130 1567 0 1136 1561 0 1146 1551 0 1152 1546 0 1162 1535 0 1168 1529 0 1180 1519 0 1185 1518 0 1201 1517 0 1217 1517 0 1232 1517 0 1248 1517 0 1264 1517 0 1280 1517 0 1296 1517 0 1312 1517 0 1328 1517 0 1345 1517 0 1361 1517 0 1377 1517 0 1393 1517 0 1408 1517 0 1424 1517 0 1440 1512 0 1449 1503 0 1456 1496 0 1465 1487 0 1471 1471 0 1471 1455 0 1471 1438 0 1471 1422 0 1471 1407 0 1471 1391 0 1471 1375 0 1471 1359 0 1471 1343 0 1471 1327 0 1471 1311 0 1471 1295 0 1471 1279 0 1471 1263 0 1471 1247 0 1471 1231 0 1471 1215 0 1471 1199 0 1471 1183 0 1471 1167 0 1471 1151 0 1471 1135 0 1471 1119 0 1471 1103 0 1471 1087 0 1471 1071 0 1471 1055 0 1471 1039 0 1471 1023 0 1471 1007 0 1471 991 0 1471 975 0 1471 959 0 1471 943 0 1471 927 0 1471 911 0 1471 895 0 1471 879 0 1471 863 0 1471 847 0 1471 831 0 1471 815 0 1471 799 0 1471 783 0 1471 767 0 1471 751 0 1471 735 0 1471 719 0 1471 703 0 1471 687 0 1471 671 0 1471 655 0 1471 639 0 1472 633 0 1475 623 0 1485 607 0 1485 591 0 1485 575 0 1485 575 1 1485 559 0 1485 543 0 1485 527 0 1485 511 0 1485 495 0 1485 479 0 1485 463 0 1485 447 0 1485 431 0 1485 415 0 1485 399 0 1485 383 0 1485 367 0 1477 351 0 1471 345 0 1461 335 0 1455 327 0 1454 319 0 1454 303 0 1456 291 0 1458 287 0 1472 272 0 1472 271 0 1474 255 0 1474 239 0 1474 223 0 1474 207 0 1474 191 0 1471 180 0 1467 175 0 1455 166 0 1439 164 0 1423 164 0 1406 164 0 1391 164 0 1375 164 0 1359 164 0 1343 164 0 1327 164 0 1310 164 0 1294 164 0 1279 164 0 1263 164 0 1247 164 0 1231 164 0 1215 164 0 1199 164 0 1183 164 0 1166 164 0 1151 164 0 1135 164 0 1119 164 0 1102 164 0 1086 164 0 1070 164 0 1055 164 0 1039 164 0 1023 164 0 1006 162 0 1001 159 0 991 149 0 985 143 0 975 133 0 959 128 0 943 128 0 927 128 0 911 128 0 895 128 0 879 128 0 863 128 0 847 128 0 831 132 0 817 144 0 815 144 0 799 144 0 783 152 0 776 160 0 767 168 0 761 176 0 760 192 0 760 208 0 760 224 0 760 240 0 760 256 0 760 272 0 760 280 5 760 288 0 761 304 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1 @@
269 3999 0 267 3983 0 255 3971 0 252 3967 0 245 3951 0 245 3935 0 249 3919 0 256 3912 0 265 3903 0 272 3893 0 272 3887 0 272 3871 0 272 3855 0 272 3839 0 272 3823 0 272 3807 0 272 3791 0 276 3775 0 286 3759 0 286 3743 0 286 3727 0 286 3711 0 286 3695 0 286 3679 0 286 3663 0 286 3647 0 286 3631 0 286 3615 0 286 3599 0 286 3583 0 286 3567 0 286 3551 0 286 3536 5 286 3535 0 286 3519 0 287 3503 0 288 3502 0 301 3487 0 304 3484 0 316 3471 0 320 3468 0 336 3465 0 352 3465 0 368 3465 0 384 3465 0 400 3465 0 416 3465 0 432 3465 0 448 3465 0 464 3465 0 480 3465 0 496 3465 0 512 3465 0 528 3465 0 544 3465 0 560 3465 0 576 3465 0 592 3465 0 608 3465 0 624 3465 0 640 3465 0 656 3465 0 672 3465 0 688 3465 0 704 3465 0 720 3465 0 736 3465 0 752 3465 0 768 3465 0 784 3465 0 800 3465 0 816 3465 0 832 3465 0 848 3465 0 864 3465 0 880 3465 0 896 3465 0 912 3465 0 928 3465 0 944 3465 0 960 3465 0 976 3465 0 992 3464 0 1005 3455 0 1008 3453 0 1024 3441 0 1040 3441 0 1056 3441 0 1072 3441 0 1088 3441 0 1104 3441 0 1120 3441 0 1136 3440 0 1140 3439 0 1152 3430 0 1158 3424 5 1159 3423 0 1168 3411 0 1169 3407 0 1169 3391 0 1169 3375 0 1169 3359 0 1169 3343 0 1169 3327 0 1169 3311 0 1169 3295 0 1169 3279 0 1169 3263 0 1172 3247 0 1184 3236 0 1188 3231 0 1200 3220 0 1204 3215 0 1211 3208 1 1216 3203 0 1217 3199 0 1218 3183 0 1218 3167 0 1218 3151 0 1218 3135 0 1218 3119 0 1218 3103 0 1218 3087 0 1218 3071 0 1218 3055 0 1218 3039 0 1218 3023 0 1218 3007 0 1218 2991 0 1218 2975 0 1218 2959 0 1218 2943 0 1218 2927 0 1218 2911 0 1218 2895 0 1218 2879 0 1218 2863 0 1218 2847 0 1218 2831 0 1218 2815 0 1218 2799 0 1218 2783 0 1218 2767 0 1218 2751 0 1218 2735 0 1218 2719 0 1218 2703 0 1218 2687 0 1218 2671 0 1218 2655 0 1218 2639 0 1218 2623 0 1215 2614 0 1210 2607 0 1201 2591 0 1201 2576 5 1201 2575 0 1199 2569 0 1191 2559 0 1183 2551 0 1174 2543 0 1167 2540 0 1151 2540 0 1135 2540 0 1119 2540 0 1103 2540 0 1087 2540 0 1071 2540 0 1055 2540 0 1039 2540 0 1023 2540 0 1007 2540 0 991 2540 0 975 2543 0 975 2544 0 959 2559 0 959 2560 0 943 2575 0 943 2576 0 927 2591 0 927 2592 0 911 2607 0 911 2608 0 895 2615 0 879 2615 0 863 2615 0 847 2615 0 831 2615 0 831 2615 1 815 2615 0 799 2612 0 794 2607 0 783 2596 0 778 2591 0 772 2575 0 772 2559 0 772 2543 0 772 2527 0 772 2511 0 772 2495 0 772 2479 0 772 2463 0 772 2447 0 772 2431 0 778 2415 0 784 2409 0 794 2399 0 800 2393 0 810 2383 0 816 2377 0 826 2367 0 832 2361 0 836 2351 0 838 2335 0 838 2319 0 838 2303 0 838 2287 0 838 2271 0 838 2255 0 838 2238 0 838 2223 0 838 2207 0 838 2190 0 838 2175 0 838 2158 0 838 2143 0 838 2127 0 838 2111 0 838 2095 0 847 2079 0 848 2078 0 860 2063 0 863 2047 0 863 2031 0 864 2024 0 867 2015 0 877 1999 0 879 1983 0 879 1967 0 879 1951 0 879 1935 0 879 1919 0 879 1903 0 880 1900 0 886 1887 0 896 1877 0 902 1871 0 912 1861 0 918 1855 0 928 1845 0 934 1839 0 944 1829 0 950 1823 0 960 1813 0 966 1807 0 976 1797 0 982 1791 0 992 1781 0 998 1775 0 1008 1765 0 1014 1759 0 1024 1749 0 1030 1743 0 1040 1733 0 1046 1727 0 1056 1717 0 1062 1711 0 1072 1701 0 1077 1695 0 1088 1685 0 1093 1679 0 1104 1669 0 1110 1663 0 1120 1653 0 1126 1647 0 1136 1637 0 1142 1631 0 1152 1619 0 1153 1616 5 1153 1615 0 1155 1598 0 1155 1582 0 1155 1567 0 1155 1550 0 1155 1535 0 1155 1519 0 1155 1503 0 1155 1487 0 1155 1471 0 1155 1455 0 1155 1439 0 1155 1423 0 1155 1407 0 1155 1390 0 1155 1375 0 1155 1359 0 1155 1343 0 1155 1327 0 1155 1311 0 1155 1295 0 1155 1279 0 1155 1263 0 1155 1246 0 1155 1231 0 1155 1215 0 1155 1199 0 1155 1183 0 1155 1166 0 1155 1151 0 1154 1135 0 1151 1126 0 1147 1119 0 1135 1107 0 1131 1103 0 1119 1092 0 1115 1087 0 1103 1076 0 1099 1071 0 1087 1060 0 1083 1055 0 1071 1044 0 1067 1039 0 1055 1028 0 1051 1023 0 1039 1012 0 1035 1007 0 1023 996 0 1019 991 0 1007 980 0 1003 975 0 991 964 0 987 959 0 975 948 0 971 943 0 959 932 0 950 927 0 942 926 0 927 926 0 911 926 0 895 926 0 879 926 0 863 924 0 847 912 0 846 911 0 831 897 0 829 895 0 815 892 0 799 891 0 783 882 0 780 879 0 767 866 0 765 863 0 762 847 0 762 831 0 762 815 0 762 799 0 762 783 0 762 767 0 762 751 0 762 735 0 756 719 0 751 715 0 740 703 0 735 698 0 724 687 0 719 682 0 708 671 0 703 667 0 692 655 0 687 651 0 676 639 0 671 635 0 659 623 0 655 618 0 644 607 0 639 603 0 628 591 0 623 588 0 607 583 0 591 582 0 577 575 0 575 573 0 561 559 0 559 557 0 546 543 0 543 541 0 529 527 0 527 525 0 514 511 0 511 509 0 501 495 0 499 479 0 499 463 0 499 447 0 499 431 0 499 415 0 499 399 0 499 383 0 499 367 0 499 351 0 499 335 0 499 319 0 499 303 0 499 287 0 500 271 0 512 255 0 527 239 0 528 239 0 542 223 0 544 221 0 548 207 0 560 192 0 561 191 0 576 181 0 592 181 0 608 181 0 624 181 0 640 181 0 656 181 0 672 181 0 688 181 0 704 181 0 720 181 0 736 181 0 752 186 0 757 192 0 761 208 0 761 224 0 761 240 0 761 256 0 761 272 0 761 280 5 761 288 0 761 304 0

@ -0,0 +1 @@
321 3967 0 319 3965 0 306 3951 0 303 3949 0 292 3935 0 290 3919 0 293 3903 0 298 3887 0 299 3871 0 299 3855 0 299 3839 0 299 3823 0 299 3807 0 299 3791 0 299 3775 0 302 3759 0 303 3743 0 303 3727 0 303 3711 0 303 3695 0 303 3679 0 303 3663 0 303 3647 0 303 3631 0 303 3615 0 303 3599 0 303 3583 0 303 3567 0 304 3559 0 305 3551 0 308 3536 5 308 3535 0 308 3519 0 312 3503 0 320 3496 0 329 3487 0 336 3481 0 352 3473 0 368 3478 0 384 3481 0 400 3481 0 416 3481 0 433 3481 0 448 3481 0 464 3481 0 481 3481 0 497 3481 0 512 3481 0 529 3481 0 545 3481 0 560 3481 0 576 3481 0 592 3481 0 608 3481 0 625 3481 0 641 3481 0 657 3481 0 673 3481 0 688 3481 0 705 3481 0 720 3481 0 736 3481 0 752 3481 0 768 3481 0 784 3481 0 800 3481 0 816 3481 0 832 3481 0 848 3481 0 864 3481 0 880 3481 0 896 3481 0 912 3481 0 928 3481 0 944 3481 0 960 3481 0 976 3481 0 992 3481 0 1008 3481 0 1024 3481 0 1040 3481 0 1056 3481 0 1072 3481 0 1088 3481 0 1104 3481 0 1120 3478 0 1128 3471 0 1136 3463 0 1144 3455 0 1152 3447 0 1158 3442 5 1160 3439 0 1168 3432 0 1178 3423 0 1184 3417 0 1195 3407 0 1200 3401 0 1211 3391 0 1216 3386 0 1225 3374 0 1226 3359 0 1226 3342 0 1226 3327 0 1226 3310 0 1226 3295 0 1226 3279 0 1226 3262 0 1226 3247 0 1226 3231 0 1227 3215 0 1228 3214 1 1231 3199 0 1232 3199 0 1234 3182 0 1234 3167 0 1234 3151 0 1234 3135 0 1234 3118 0 1234 3103 0 1234 3087 0 1234 3070 0 1234 3055 0 1234 3039 0 1234 3022 0 1234 3006 0 1234 2991 0 1234 2975 0 1234 2959 0 1234 2942 0 1234 2927 0 1234 2911 0 1234 2895 0 1234 2879 0 1234 2863 0 1234 2847 0 1234 2831 0 1234 2815 0 1234 2799 0 1234 2783 0 1234 2767 0 1234 2751 0 1234 2735 0 1234 2719 0 1234 2703 0 1234 2687 0 1234 2671 0 1234 2655 0 1234 2639 0 1232 2623 0 1231 2620 0 1228 2607 0 1228 2591 0 1228 2576 5 1228 2575 0 1228 2559 0 1228 2543 0 1217 2526 0 1215 2524 0 1202 2511 0 1199 2510 0 1182 2507 0 1167 2507 0 1151 2507 0 1133 2507 0 1118 2507 0 1103 2507 0 1087 2507 0 1071 2507 0 1055 2507 0 1039 2507 0 1022 2507 0 1007 2507 0 991 2507 0 975 2507 0 959 2507 0 943 2507 0 927 2507 0 911 2506 0 900 2495 0 895 2490 0 884 2479 0 879 2475 0 875 2463 0 875 2447 0 875 2431 0 875 2415 0 875 2399 0 875 2383 0 875 2367 0 875 2351 0 875 2335 0 875 2319 0 875 2303 0 875 2287 0 875 2271 0 875 2255 0 875 2239 0 875 2223 0 875 2207 0 875 2191 0 875 2175 0 875 2159 0 875 2143 0 875 2127 0 875 2111 0 875 2095 0 875 2079 0 875 2063 0 875 2047 0 875 2031 0 875 2015 0 875 1999 0 875 1983 0 875 1967 0 875 1951 0 875 1935 0 875 1919 0 880 1904 0 880 1903 0 896 1888 0 896 1887 0 912 1872 0 913 1871 0 928 1856 0 928 1855 0 934 1839 0 934 1823 0 934 1807 0 934 1791 0 934 1775 0 938 1759 0 944 1754 0 954 1743 0 960 1738 0 970 1727 0 976 1721 0 986 1711 0 992 1705 0 1002 1695 0 1008 1690 0 1018 1679 0 1024 1673 0 1034 1663 0 1040 1657 0 1050 1647 0 1056 1642 0 1066 1631 0 1072 1626 0 1082 1615 0 1088 1609 0 1098 1599 0 1104 1593 0 1114 1583 0 1120 1577 0 1126 1572 5 1130 1567 0 1136 1561 0 1146 1551 0 1152 1546 0 1162 1535 0 1168 1529 0 1180 1519 0 1185 1518 0 1201 1517 0 1217 1517 0 1232 1517 0 1248 1517 0 1264 1517 0 1280 1517 0 1296 1517 0 1312 1517 0 1328 1517 0 1345 1517 0 1361 1517 0 1377 1517 0 1393 1517 0 1408 1517 0 1424 1517 0 1440 1512 0 1449 1503 0 1456 1496 0 1465 1487 0 1471 1471 0 1471 1455 0 1471 1438 0 1471 1422 0 1471 1407 0 1471 1391 0 1471 1375 0 1471 1359 0 1471 1343 0 1471 1327 0 1471 1311 0 1471 1295 0 1471 1279 0 1471 1263 0 1471 1247 0 1471 1231 0 1471 1215 0 1471 1199 0 1471 1183 0 1471 1167 0 1471 1151 0 1471 1135 0 1471 1119 0 1471 1103 0 1471 1087 0 1471 1071 0 1471 1055 0 1471 1039 0 1471 1023 0 1471 1007 0 1471 991 0 1471 975 0 1471 959 0 1471 943 0 1471 927 0 1471 911 0 1471 895 0 1471 879 0 1471 863 0 1471 847 0 1471 831 0 1471 815 0 1471 799 0 1471 783 0 1471 767 0 1471 751 0 1471 735 0 1471 719 0 1471 703 0 1471 687 0 1471 671 0 1471 655 0 1471 639 0 1472 633 0 1475 623 0 1485 607 0 1485 591 0 1485 575 0 1485 575 1 1485 559 0 1485 543 0 1485 527 0 1485 511 0 1485 495 0 1485 479 0 1485 463 0 1485 447 0 1485 431 0 1485 415 0 1485 399 0 1485 383 0 1485 367 0 1477 351 0 1471 345 0 1461 335 0 1455 327 0 1454 319 0 1454 303 0 1456 291 0 1458 287 0 1472 272 0 1472 271 0 1474 255 0 1474 239 0 1474 223 0 1474 207 0 1474 191 0 1471 180 0 1467 175 0 1455 166 0 1439 164 0 1423 164 0 1406 164 0 1391 164 0 1375 164 0 1359 164 0 1343 164 0 1327 164 0 1310 164 0 1294 164 0 1279 164 0 1263 164 0 1247 164 0 1231 164 0 1215 164 0 1199 164 0 1183 164 0 1166 164 0 1151 164 0 1135 164 0 1119 164 0 1102 164 0 1086 164 0 1070 164 0 1055 164 0 1039 164 0 1023 164 0 1006 162 0 1001 159 0 991 149 0 985 143 0 975 133 0 959 128 0 943 128 0 927 128 0 911 128 0 895 128 0 879 128 0 863 128 0 847 128 0 831 132 0 817 144 0 815 144 0 799 144 0 783 152 0 776 160 0 767 168 0 761 176 0 760 192 0 760 208 0 760 224 0 760 240 0 760 256 0 760 272 0 760 280 5 760 288 0 761 304 0

@ -0,0 +1 @@
337 4015 0 343 3999 0 343 3983 0 343 3967 0 343 3951 0 343 3935 0 343 3919 0 343 3903 0 343 3887 0 343 3871 0 343 3855 0 343 3839 0 343 3823 0 343 3807 0 343 3791 0 343 3775 0 343 3759 0 343 3743 0 343 3727 0 343 3711 0 343 3695 0 343 3679 0 343 3663 0 343 3647 0 343 3631 0 343 3615 0 343 3599 0 343 3583 0 343 3567 0 343 3551 0 343 3536 5 343 3535 0 345 3519 0 345 3503 0 345 3504 0 345 3503 0 345 3487 0 352 3471 0 368 3455 0 383 3439 0 384 3438 0 400 3435 0 417 3435 0 432 3435 0 448 3435 0 464 3435 0 480 3435 0 497 3435 0 513 3436 0 528 3436 0 544 3436 0 560 3436 0 577 3436 0 592 3436 0 608 3436 0 624 3436 0 640 3437 0 657 3437 0 672 3437 0 688 3437 0 705 3437 0 720 3437 0 736 3437 0 753 3437 0 768 3437 0 784 3437 0 800 3437 0 816 3437 0 832 3437 0 848 3437 0 864 3437 0 880 3437 0 896 3437 0 912 3437 0 928 3437 0 944 3437 0 960 3437 0 976 3437 0 992 3437 0 1008 3437 0 1024 3437 0 1040 3437 0 1056 3437 0 1072 3437 0 1088 3437 0 1104 3437 0 1120 3437 0 1136 3437 0 1152 3436 0 1158 3432 5 1167 3423 0 1168 3423 0 1183 3407 0 1184 3406 0 1199 3391 0 1200 3390 0 1215 3375 0 1216 3375 0 1224 3359 0 1224 3343 0 1224 3327 0 1224 3311 0 1224 3295 0 1224 3278 0 1224 3263 0 1224 3247 0 1224 3231 0 1224 3215 0 1224 3214 1 1224 3198 0 1224 3183 0 1224 3167 0 1224 3150 0 1224 3134 0 1224 3118 0 1224 3103 0 1224 3087 0 1224 3070 0 1224 3055 0 1224 3039 0 1224 3022 0 1224 3007 0 1224 2991 0 1224 2975 0 1224 2958 0 1224 2942 0 1224 2926 0 1224 2911 0 1224 2894 0 1224 2879 0 1224 2863 0 1224 2847 0 1224 2831 0 1224 2815 0 1224 2799 0 1224 2783 0 1224 2767 0 1224 2751 0 1224 2734 0 1224 2719 0 1224 2703 0 1224 2687 0 1224 2671 0 1224 2655 0 1224 2639 0 1224 2623 0 1224 2607 0 1224 2591 0 1224 2576 5 1224 2575 0 1224 2559 0 1224 2543 0 1224 2527 0 1224 2511 0 1224 2495 0 1224 2479 0 1224 2463 0 1224 2447 0 1224 2431 0 1224 2415 0 1222 2399 0 1215 2390 0 1209 2383 0 1199 2374 0 1193 2367 0 1183 2358 0 1177 2351 0 1167 2342 0 1161 2335 0 1151 2331 0 1135 2331 0 1119 2331 0 1103 2331 0 1087 2331 0 1071 2331 0 1055 2330 0 1040 2319 0 1039 2319 0 1036 2303 0 1036 2287 0 1036 2271 0 1036 2255 0 1036 2239 0 1036 2223 0 1036 2207 0 1036 2191 0 1036 2175 0 1036 2159 0 1036 2143 0 1036 2127 0 1036 2111 0 1036 2095 0 1036 2079 0 1036 2063 0 1036 2047 0 1036 2031 0 1036 2015 0 1036 1999 0 1036 1983 0 1036 1967 0 1036 1951 0 1036 1935 0 1036 1919 0 1036 1903 0 1036 1887 0 1036 1871 0 1036 1855 0 1036 1839 0 1037 1823 0 1040 1816 0 1048 1807 0 1056 1799 0 1064 1791 0 1072 1783 0 1080 1775 0 1088 1768 0 1096 1759 0 1104 1752 0 1112 1743 0 1120 1736 0 1128 1727 0 1136 1720 0 1144 1711 0 1150 1695 0 1150 1679 0 1150 1663 0 1150 1647 0 1150 1631 0 1150 1616 5 1150 1615 0 1150 1599 0 1150 1583 0 1151 1567 0 1152 1566 0 1165 1551 0 1168 1548 0 1180 1535 0 1184 1532 0 1197 1519 0 1200 1516 0 1217 1512 0 1232 1512 0 1248 1512 0 1264 1512 0 1280 1509 0 1286 1503 0 1289 1487 0 1289 1471 0 1289 1455 0 1289 1439 0 1289 1423 0 1289 1406 0 1289 1391 0 1289 1375 0 1289 1359 0 1289 1343 0 1289 1327 0 1289 1311 0 1289 1295 0 1289 1279 0 1289 1262 0 1289 1247 0 1279 1233 0 1277 1231 0 1263 1217 0 1261 1215 0 1247 1201 0 1245 1199 0 1231 1185 0 1229 1183 0 1215 1169 0 1213 1167 0 1199 1154 0 1197 1151 0 1183 1137 0 1181 1135 0 1167 1121 0 1165 1119 0 1151 1105 0 1149 1103 0 1135 1089 0 1133 1087 0 1119 1073 0 1117 1071 0 1103 1057 0 1101 1055 0 1087 1041 0 1086 1039 0 1085 1023 0 1085 1007 0 1085 991 0 1085 975 0 1085 959 0 1085 943 0 1085 927 0 1085 911 0 1085 895 0 1085 879 0 1085 863 0 1085 847 0 1085 831 0 1085 815 0 1085 799 0 1085 783 0 1085 767 0 1085 751 0 1085 735 0 1085 719 0 1085 703 0 1085 687 0 1085 671 0 1085 655 0 1085 639 0 1085 623 0 1085 607 0 1080 591 0 1071 583 0 1064 575 0 1055 567 0 1048 559 0 1039 551 0 1032 543 0 1023 535 0 1016 527 0 1007 519 0 1000 511 0 991 503 0 984 495 0 975 487 0 968 479 0 959 471 0 952 463 0 943 455 0 936 447 0 933 431 0 933 415 0 933 399 0 933 383 0 933 367 0 933 351 0 927 337 0 925 335 0 911 324 0 906 319 0 895 319 0 879 319 0 863 319 0 933 347 0 928 335 0 928 319 0 928 303 0 928 287 0 928 271 0 928 255 0 928 239 0 928 223 0 928 207 0 927 193 0 926 191 0 911 176 0 909 175 0 895 175 0 879 175 0 863 175 0 847 175 0 831 175 0 815 175 0 799 175 0 783 175 0 780 176 0 767 186 0 762 192 0 751 202 0 746 208 0 743 224 0 743 240 0 743 256 0 743 272 0 743 280 5 743 288 0 739 304 0 735 311 0 728 320 0 719 332 0 716 336 0 705 352 0 703 354 0 693 368 0 687 375 0 681 384 0 671 396 0 669 400 0 657 416 0 655 418 0 645 432 0 639 439 0 633 448 0

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -54,7 +54,7 @@ const std::string Hamster::PLAYER_HAMSTER_IMAGE{"hamster.png"};
std::optional<Hamster*>Hamster::playerHamster;
Hamster::Hamster(const vf2d spawnPos,const std::string&img,const PlayerControlled IsPlayerControlled)
:pos(spawnPos),IsPlayerControlled(IsPlayerControlled){
:pos(spawnPos),IsPlayerControlled(IsPlayerControlled),randomId(util::random()){
animations=HamsterGame::GetAnimations(img);
animations.ChangeState(internalAnimState,AnimationState::DEFAULT);
}
@ -258,7 +258,7 @@ void Hamster::LoadHamsters(const geom2d::rect<int>startingLoc){
}
}
npcHamster.ai.LoadAI(HamsterGame::Game().GetCurrentMapName(),possibleAIs[util::random()%possibleAIs.size()]);
if(possibleAIs.size()>0)npcHamster.ai.LoadAI(HamsterGame::Game().GetCurrentMapName(),possibleAIs[util::random()%possibleAIs.size()]);
}
}
@ -429,8 +429,8 @@ void Hamster::HandleCollision(){
h.SetPos(collisionResolve2);
vel+=vf2d{GetBumpAmount(),randDir}.cart();
vel=vf2d{std::min(GetMaxSpeed(),vel.polar().x),vel.polar().y}.cart();
h.vel+=vf2d{GetBumpAmount(),float(randDir+geom2d::pi)}.cart();
h.vel=vf2d{std::min(h.GetMaxSpeed(),vel.polar().x),vel.polar().y}.cart();
h.vel+=vf2d{h.GetBumpAmount(),float(randDir+geom2d::pi)}.cart();
h.vel=vf2d{std::min(h.GetMaxSpeed(),h.vel.polar().x),h.vel.polar().y}.cart();
}else{
geom2d::line<float>collisionLine{geom2d::line<float>(GetPos(),h.GetPos())};
float distance{collisionLine.length()};
@ -442,8 +442,8 @@ void Hamster::HandleCollision(){
h.SetPos(collisionResolve2);
vel+=vf2d{GetBumpAmount(),float(collisionLine.vector().polar().y+geom2d::pi)}.cart();
vel=vf2d{std::min(GetMaxSpeed(),vel.polar().x),vel.polar().y}.cart();
h.vel+=vf2d{GetBumpAmount(),collisionLine.vector().polar().y}.cart();
h.vel=vf2d{std::min(h.GetMaxSpeed(),vel.polar().x),vel.polar().y}.cart();
h.vel+=vf2d{h.GetBumpAmount(),collisionLine.vector().polar().y}.cart();
h.vel=vf2d{std::min(h.GetMaxSpeed(),h.vel.polar().x),h.vel.polar().y}.cart();
}
bumpTimer=h.bumpTimer=0.12f;
}
@ -553,6 +553,19 @@ const float Hamster::GetMaxSpeed()const{
if(hamsterJet.value().GetState()==HamsterJet::LANDING)finalMaxSpd*=1.5f;
else if(FlyingInTheAir())finalMaxSpd*=8.f;
}
if(!IsPlayerControlled){
switch(ai.GetAIType()){
case HamsterAI::SMART:{
finalMaxSpd*=0.99f;
}break;
case HamsterAI::NORMAL:{
finalMaxSpd*=0.92f;
}break;
case HamsterAI::DUMB:{
finalMaxSpd*=0.85f;
}break;
}
}
return finalMaxSpd;
}
const float Hamster::GetFriction()const{
@ -764,10 +777,15 @@ void Hamster::HandleAIControls(){
}
vf2d targetLoc{action.pos};
if(action.type==HamsterAI::Action::MOVE)targetLoc+=GetAINodePositionVariance();
if(temporaryNode.has_value())targetLoc=temporaryNode.value();
vf2d diff{targetLoc-GetPos()};
if(diff.mag()<16.f){
float variance{GetAINodeDistanceVariance()};
if(action.type!=HamsterAI::Action::MOVE)variance=12.f;
if(diff.mag()<variance){
if(action.type==HamsterAI::Action::LAUNCH_JET){
if(true||HasPowerup(Powerup::JET)){ //Currently ignoring whether we have a jet or not...We can cheat!
SetState(FLYING);
@ -781,6 +799,23 @@ void Hamster::HandleAIControls(){
}
}
ai.AdvanceToNextAction();
const HamsterAI::ActionOptRef&nextAction{ai.GetCurrentAction()};
if(nextAction.has_value()){
const HamsterAI::Action&futureAction{nextAction.value().get()};
if(futureAction.type==HamsterAI::Action::MOVE){
switch(ai.GetAIType()){
case HamsterAI::SMART:{
if(util::random()%100<2)ai.AdvanceToNextAction();
}break;
case HamsterAI::NORMAL:{
if(util::random()%100<25)ai.AdvanceToNextAction();
}break;
case HamsterAI::DUMB:{
if(util::random()%100<50)ai.AdvanceToNextAction();
}break;
}
}
}
if(chooseTemporaryNodeNext){
int MAX_SEARCH_AMT{100};
float SEARCH_RANGE{1.f};
@ -849,4 +884,40 @@ const float Hamster::GetAIAdjustNodeTime()const{
const bool Hamster::IsBurrowed()const{
return GetState()==BURROWING||GetState()==BURROW_WAIT||GetState()==SURFACING;
}
const float Hamster::GetAINodeDistanceVariance()const{
switch(ai.GetAIType()){
case HamsterAI::SMART:{
return 12.f*float(randomId%100)/100.f+12.f;
}break;
case HamsterAI::NORMAL:{
return 18.f*float(randomId%100)/100.f+18.f;
}break;
case HamsterAI::DUMB:{
return 24.f*float(randomId%100)/100.f+24.f;
}break;
}
return 12.f*float(randomId%100)/100.f+12.f;
}
const vf2d Hamster::GetAINodePositionVariance()const{
vf2d finalOffset{};
float seedX{float(randomId%100)/100.f};
float seedY{float((randomId*457)%100)/100.f};
switch(ai.GetAIType()){
case HamsterAI::SMART:{
finalOffset.x=seedX*16.f-8.f;
finalOffset.y=seedY*16.f-8.f;
}break;
case HamsterAI::NORMAL:{
finalOffset.x=seedX*32.f-16.f;
finalOffset.y=seedY*32.f-16.f;
}break;
case HamsterAI::DUMB:{
finalOffset.x=seedX*48.f-24.f;
finalOffset.y=seedY*48.f-24.f;
}break;
}
return finalOffset;
}

@ -125,6 +125,7 @@ class Hamster{
float aiNodeTime{0.f};
std::optional<vf2d>temporaryNode;
bool chooseTemporaryNodeNext{false};
int randomId{};
public:
Hamster(const vf2d spawnPos,const std::string&img,const PlayerControlled IsPlayerControlled=NPC);
static const Hamster&GetPlayer();
@ -176,5 +177,7 @@ public:
const bool FlyingInTheAir()const;
const float GetAILandingSpeed()const;
const float GetAIAdjustNodeTime()const;
const float GetAINodeDistanceVariance()const;
const vf2d GetAINodePositionVariance()const;
const bool IsBurrowed()const;
};

@ -43,7 +43,7 @@ bool HamsterGame::OnUserCreate(){
LoadSound("nene - Boss Battle #3 Alternate.ogg");
LoadSound("nene - Boss Battle #5 V2.ogg");
LoadLevel("StageII.tmx"); //THIS IS TEMPORARY.
LoadLevel("StageI.tmx"); //THIS IS TEMPORARY.
border.ChangeBorder(Border::DEFAULT);

Loading…
Cancel
Save