diff --git a/2d/platformer/README.md b/2d/platformer/README.md new file mode 100644 index 00000000..14dd89e0 --- /dev/null +++ b/2d/platformer/README.md @@ -0,0 +1,29 @@ +# 2D Platformer + +This demo is a pixel art 2D platformer with graphics and sound. + +It shows you how to code characters and physics-based objects in a real game context. This is a relatively complete demo where the player can jump, walk on slopes, fire bullets, interact with enemies, and more. It contains one closed level, and the player is invincible, unlike the enemies. + +You will find most of the demo’s content in the `Level.tscn` scene. You can open it from the default `Game.tscn` scene, or double click on `Level.tscn` in the `src/Level/` directory. + +We invite you to open the demo's GDScript files in the editor as they contain a lot of comments that explain how each class works. + +## Features + +- Side-scrolling player controller. + - Can walk on and snap to slopes. + - Can shoot, including while jumping. +- Enemies that crawl on the floor and change direction when they encounter an obstacle. +- Camera that stays within the level’s bounds. +- Supports keyboard and gamepad controls. +- Platforms that can move in any direction. +- Gun that shoots bullets with rigid body (natural) physics. +- Collectible coins. +- Pause and pause menu. +- Pixel art visuals. +- Sound effects and music. + +## Screenshots + +![Player shooting in the direction of an enemy](screenshots/shoot.png) +![The entire level layout viewed in the editor](screenshots/layout.png) diff --git a/2d/platformer/Stage.tscn b/2d/platformer/Stage.tscn deleted file mode 100644 index 5bef7416..00000000 --- a/2d/platformer/Stage.tscn +++ /dev/null @@ -1,268 +0,0 @@ -[gd_scene load_steps=9 format=2] - -[ext_resource path="res://TileSet.tres" type="TileSet" id=1] -[ext_resource path="res://coin/Coin.tscn" type="PackedScene" id=2] -[ext_resource path="res://platform/MovingPlatform.tscn" type="PackedScene" id=3] -[ext_resource path="res://platform/OneWayPlatform.tscn" type="PackedScene" id=4] -[ext_resource path="res://enemy/Enemy.tscn" type="PackedScene" id=5] -[ext_resource path="res://background/ParallaxBg.tscn" type="PackedScene" id=6] -[ext_resource path="res://player/Player.tscn" type="PackedScene" id=7] -[ext_resource path="res://audio/music.ogg" type="AudioStream" id=8] - -[node name="Stage" type="Node"] - -[node name="TileMap" type="TileMap" parent="."] -tile_set = ExtResource( 1 ) -cell_quadrant_size = 8 -format = 1 -tile_data = PoolIntArray( 0, 2, 0, 65536, 2, 0, 131072, 2, 0, 196608, 2, 0, 196626, 9, 0, 262144, 2, 0, 262162, 8, 0, 327680, 2, 0, 327697, 536870921, 0, 327698, 7, 0, 393216, 2, 0, 393234, 7, 0, 393276, 536870914, 0, 393277, 536870922, 0, 393278, 536870922, 0, 393279, 536870922, 0, 393280, 536870922, 0, 393281, 536870922, 0, 393282, 536870922, 0, 393283, 536870922, 0, 393284, 536870922, 0, 393285, 536870922, 0, 458752, 2, 0, 458770, 8, 0, 458812, 536870914, 0, 458813, 536870922, 0, 458814, 536870922, 0, 458815, 536870922, 0, 458816, 536870922, 0, 458817, 536870922, 0, 458818, 536870922, 0, 458819, 536870922, 0, 458820, 536870922, 0, 458821, 536870922, 0, 524288, 4, 0, 524289, 1, 0, 524348, 536870914, 0, 524349, 536870922, 0, 524350, 536870922, 0, 524351, 536870922, 0, 524352, 536870922, 0, 524353, 536870922, 0, 524354, 536870922, 0, 524355, 536870922, 0, 524356, 536870922, 0, 524357, 536870922, 0, 589824, 10, 0, 589825, 13, 0, 589860, 536870914, 0, 589861, 10, 0, 589862, 10, 0, 589863, 10, 0, 589864, 10, 0, 589865, 10, 0, 589866, 10, 0, 589867, 10, 0, 589868, 10, 0, 589869, 2, 0, 589884, 536870914, 0, 589885, 536870922, 0, 589886, 536870922, 0, 589887, 536870922, 0, 589888, 536870922, 0, 589889, 536870922, 0, 589890, 536870922, 0, 589891, 536870922, 0, 589892, 536870922, 0, 589893, 536870922, 0, 655360, 2, 0, 655396, 536870914, 0, 655397, 10, 0, 655398, 10, 0, 655399, 10, 0, 655400, 10, 0, 655401, 10, 0, 655402, 10, 0, 655403, 10, 0, 655404, 10, 0, 655405, 2, 0, 655420, 536870914, 0, 655421, 536870922, 0, 655422, 536870922, 0, 655423, 536870922, 0, 655424, 536870922, 0, 655425, 536870922, 0, 655426, 536870922, 0, 655427, 536870922, 0, 655428, 536870922, 0, 655429, 536870922, 0, 720896, 2, 0, 720932, 536870914, 0, 720933, 10, 0, 720934, 10, 0, 720935, 10, 0, 720936, 10, 0, 720937, 10, 0, 720938, 10, 0, 720939, 10, 0, 720940, 10, 0, 720941, 2, 0, 720956, 536870914, 0, 720957, 536870922, 0, 720958, 536870922, 0, 720959, 536870922, 0, 720960, 536870922, 0, 720961, 536870922, 0, 720962, 536870922, 0, 720963, 536870922, 0, 720964, 536870922, 0, 720965, 536870922, 0, 786432, 2, 0, 786437, 9, 0, 786468, 536870914, 0, 786469, 10, 0, 786470, 10, 0, 786471, 10, 0, 786472, 10, 0, 786473, 10, 0, 786474, 10, 0, 786475, 10, 0, 786476, 10, 0, 786477, 2, 0, 786492, 536870914, 0, 786493, 536870922, 0, 786494, 536870922, 0, 786495, 536870922, 0, 786496, 536870922, 0, 786497, 536870922, 0, 786498, 536870922, 0, 786499, 536870922, 0, 786500, 536870922, 0, 786501, 536870922, 0, 851968, 2, 0, 851973, 7, 0, 852004, 536870914, 0, 852005, 10, 0, 852006, 10, 0, 852007, 10, 0, 852008, 10, 0, 852009, 10, 0, 852010, 10, 0, 852011, 10, 0, 852012, 10, 0, 852013, 2, 0, 852028, 536870914, 0, 852029, 536870922, 0, 852030, 536870922, 0, 852031, 536870922, 0, 852032, 536870922, 0, 852033, 536870922, 0, 852034, 536870922, 0, 852035, 536870922, 0, 852036, 536870922, 0, 852037, 536870922, 0, 917504, 2, 0, 917506, 9, 0, 917509, 7, 0, 917512, 536870921, 0, 917540, 536870914, 0, 917541, 10, 0, 917542, 10, 0, 917543, 10, 0, 917544, 10, 0, 917545, 10, 0, 917546, 10, 0, 917547, 10, 0, 917548, 10, 0, 917549, 2, 0, 917564, 536870914, 0, 917565, 536870922, 0, 917566, 536870922, 0, 917567, 536870922, 0, 917568, 536870922, 0, 917569, 536870922, 0, 917570, 536870922, 0, 917571, 536870922, 0, 917572, 536870922, 0, 917573, 536870922, 0, 983040, 2, 0, 983042, 7, 0, 983045, 7, 0, 983048, 536870920, 0, 983076, 536870914, 0, 983077, 10, 0, 983078, 10, 0, 983079, 10, 0, 983080, 10, 0, 983081, 10, 0, 983082, 10, 0, 983083, 10, 0, 983084, 10, 0, 983085, 2, 0, 983100, 536870914, 0, 983101, 536870922, 0, 983102, 536870922, 0, 983103, 536870922, 0, 983104, 536870922, 0, 983105, 536870922, 0, 983106, 536870922, 0, 983107, 536870922, 0, 983108, 536870922, 0, 983109, 536870922, 0, 1048576, 2, 0, 1048578, 8, 0, 1048581, 8, 0, 1048584, 536870919, 0, 1048612, 536870914, 0, 1048613, 10, 0, 1048614, 10, 0, 1048615, 10, 0, 1048616, 10, 0, 1048617, 10, 0, 1048618, 10, 0, 1048619, 10, 0, 1048620, 10, 0, 1048621, 2, 0, 1048636, 536870914, 0, 1048637, 536870922, 0, 1048638, 536870922, 0, 1048639, 536870922, 0, 1048640, 536870922, 0, 1048641, 536870922, 0, 1048642, 536870922, 0, 1048643, 536870922, 0, 1048644, 536870922, 0, 1048645, 536870922, 0, 1114112, 4, 0, 1114113, 0, 0, 1114114, 6, 0, 1114115, 0, 0, 1114116, 0, 0, 1114117, 6, 0, 1114118, 1, 0, 1114120, 536870919, 0, 1114127, 536870913, 0, 1114128, 0, 0, 1114129, 15, 0, 1114139, 536870927, 0, 1114140, 0, 0, 1114141, 536870912, 0, 1114142, 536870912, 0, 1114143, 536870912, 0, 1114144, 15, 0, 1114148, 536870925, 0, 1114149, 536870923, 0, 1114150, 536870923, 0, 1114151, 536870923, 0, 1114152, 536870923, 0, 1114153, 536870923, 0, 1114154, 536870923, 0, 1114155, 536870923, 0, 1114156, 536870923, 0, 1114157, 13, 0, 1114172, 536870914, 0, 1114173, 536870922, 0, 1114174, 536870922, 0, 1114175, 536870922, 0, 1114176, 536870922, 0, 1114177, 536870922, 0, 1114178, 536870922, 0, 1114179, 536870922, 0, 1114180, 536870922, 0, 1114181, 536870922, 0, 1179648, 10, 0, 1179649, 10, 0, 1179650, 10, 0, 1179651, 10, 0, 1179652, 10, 0, 1179653, 10, 0, 1179654, 2, 0, 1179656, 536870919, 0, 1179663, 536870914, 0, 1179664, 2, 0, 1179676, 536870914, 0, 1179677, 536870922, 0, 1179678, 536870922, 0, 1179679, 2, 0, 1179700, 536870913, 0, 1179701, 536870912, 0, 1179702, 536870912, 0, 1179703, 536870912, 0, 1179704, 536870912, 0, 1179705, 536870912, 0, 1179706, 536870912, 0, 1179707, 536870912, 0, 1179708, 536870916, 0, 1179709, 536870922, 0, 1179710, 536870922, 0, 1179711, 536870922, 0, 1179712, 536870922, 0, 1179713, 536870922, 0, 1179714, 536870922, 0, 1179715, 536870922, 0, 1179716, 536870922, 0, 1179717, 536870922, 0, 1245184, 10, 0, 1245185, 10, 0, 1245186, 10, 0, 1245187, 10, 0, 1245188, 10, 0, 1245189, 10, 0, 1245190, 4, 0, 1245191, 1, 0, 1245192, 536870919, 0, 1245199, 536870914, 0, 1245200, 2, 0, 1245212, 536870914, 0, 1245213, 536870922, 0, 1245214, 536870922, 0, 1245215, 2, 0, 1245236, 536870914, 0, 1245237, 536870922, 0, 1245238, 536870922, 0, 1245239, 536870922, 0, 1245240, 536870922, 0, 1245241, 536870922, 0, 1245242, 536870922, 0, 1245243, 536870922, 0, 1245244, 536870922, 0, 1245245, 536870922, 0, 1245246, 536870922, 0, 1245247, 536870922, 0, 1245248, 536870922, 0, 1245249, 536870922, 0, 1245250, 536870922, 0, 1245251, 536870922, 0, 1245252, 536870922, 0, 1245253, 536870922, 0, 1310720, 10, 0, 1310721, 10, 0, 1310722, 10, 0, 1310723, 10, 0, 1310724, 10, 0, 1310725, 10, 0, 1310726, 10, 0, 1310727, 4, 0, 1310728, 6, 0, 1310729, 1, 0, 1310735, 536870914, 0, 1310736, 2, 0, 1310748, 536870914, 0, 1310749, 536870922, 0, 1310750, 536870922, 0, 1310751, 2, 0, 1310772, 536870914, 0, 1310773, 536870922, 0, 1310774, 536870922, 0, 1310775, 536870922, 0, 1310776, 536870922, 0, 1310777, 536870922, 0, 1310778, 536870922, 0, 1310779, 536870922, 0, 1310780, 536870922, 0, 1310781, 536870922, 0, 1310782, 536870922, 0, 1310783, 536870922, 0, 1310784, 536870922, 0, 1310785, 536870922, 0, 1310786, 536870922, 0, 1310787, 536870922, 0, 1310788, 536870922, 0, 1310789, 536870922, 0, 1376256, 10, 0, 1376257, 10, 0, 1376258, 10, 0, 1376259, 10, 0, 1376260, 10, 0, 1376261, 10, 0, 1376262, 10, 0, 1376263, 10, 0, 1376264, 10, 0, 1376265, 4, 0, 1376266, 0, 0, 1376267, 0, 0, 1376268, 0, 0, 1376269, 0, 0, 1376270, 0, 0, 1376271, 536870916, 0, 1376272, 2, 0, 1376284, 536870914, 0, 1376285, 536870922, 0, 1376286, 536870922, 0, 1376287, 2, 0, 1376308, 536870914, 0, 1376309, 536870922, 0, 1376310, 536870922, 0, 1376311, 536870922, 0, 1376312, 536870922, 0, 1376313, 536870922, 0, 1376314, 536870922, 0, 1376315, 536870922, 0, 1376316, 536870922, 0, 1376317, 536870922, 0, 1376318, 536870922, 0, 1376319, 536870922, 0, 1376320, 536870922, 0, 1376321, 536870922, 0, 1376322, 536870922, 0, 1376323, 536870922, 0, 1376324, 536870922, 0, 1376325, 536870922, 0, 1441792, 10, 0, 1441793, 10, 0, 1441794, 10, 0, 1441795, 10, 0, 1441796, 10, 0, 1441797, 10, 0, 1441798, 10, 0, 1441799, 10, 0, 1441800, 10, 0, 1441801, 10, 0, 1441802, 10, 0, 1441803, 10, 0, 1441804, 10, 0, 1441805, 10, 0, 1441806, 10, 0, 1441807, 10, 0, 1441808, 2, 0, 1441820, 536870914, 0, 1441821, 536870922, 0, 1441822, 536870922, 0, 1441823, 2, 0, 1441844, 536870914, 0, 1441845, 536870922, 0, 1441846, 536870922, 0, 1441847, 536870922, 0, 1441848, 536870922, 0, 1441849, 536870922, 0, 1441850, 536870922, 0, 1441851, 536870922, 0, 1441852, 536870922, 0, 1441853, 536870922, 0, 1441854, 536870922, 0, 1441855, 536870922, 0, 1441856, 536870922, 0, 1441857, 536870922, 0, 1441858, 536870922, 0, 1441859, 536870922, 0, 1441860, 536870922, 0, 1441861, 536870922, 0, 1507328, 10, 0, 1507329, 10, 0, 1507330, 10, 0, 1507331, 10, 0, 1507332, 10, 0, 1507333, 10, 0, 1507334, 10, 0, 1507335, 10, 0, 1507336, 10, 0, 1507337, 10, 0, 1507338, 10, 0, 1507339, 10, 0, 1507340, 10, 0, 1507341, 10, 0, 1507342, 10, 0, 1507343, 10, 0, 1507344, 2, 0, 1507356, 536870914, 0, 1507357, 536870922, 0, 1507358, 536870922, 0, 1507359, 4, 0, 1507360, 0, 0, 1507361, 0, 0, 1507362, 0, 0, 1507363, 0, 0, 1507364, 0, 0, 1507365, 0, 0, 1507366, 12, 0, 1507380, 536870914, 0, 1507381, 536870922, 0, 1507382, 536870922, 0, 1507383, 536870922, 0, 1507384, 536870922, 0, 1507385, 536870922, 0, 1507386, 536870922, 0, 1507387, 536870922, 0, 1507388, 536870922, 0, 1507389, 536870922, 0, 1507390, 536870922, 0, 1507391, 536870922, 0, 1507392, 536870922, 0, 1507393, 536870922, 0, 1507394, 536870922, 0, 1507395, 536870922, 0, 1507396, 536870922, 0, 1507397, 536870922, 0, 1572864, 10, 0, 1572865, 10, 0, 1572866, 10, 0, 1572867, 10, 0, 1572868, 10, 0, 1572869, 10, 0, 1572870, 10, 0, 1572871, 10, 0, 1572872, 10, 0, 1572873, 10, 0, 1572874, 10, 0, 1572875, 10, 0, 1572876, 10, 0, 1572877, 10, 0, 1572878, 10, 0, 1572879, 10, 0, 1572880, 2, 0, 1572892, 536870914, 0, 1572893, 536870922, 0, 1572894, 536870922, 0, 1572895, 536870922, 0, 1572896, 536870922, 0, 1572897, 536870922, 0, 1572898, 536870922, 0, 1572899, 536870922, 0, 1572900, 536870922, 0, 1572901, 536870922, 0, 1572903, 12, 0, 1572916, 536870914, 0, 1572917, 536870922, 0, 1572918, 536870922, 0, 1572919, 536870922, 0, 1572920, 536870922, 0, 1572921, 536870922, 0, 1572922, 536870922, 0, 1572923, 536870922, 0, 1572924, 536870922, 0, 1572925, 536870922, 0, 1572926, 536870922, 0, 1572927, 536870922, 0, 1572928, 536870922, 0, 1572929, 536870922, 0, 1572930, 536870922, 0, 1572931, 536870922, 0, 1572932, 536870922, 0, 1572933, 536870922, 0, 1638400, 10, 0, 1638401, 10, 0, 1638402, 10, 0, 1638403, 10, 0, 1638404, 10, 0, 1638405, 10, 0, 1638406, 10, 0, 1638407, 10, 0, 1638408, 10, 0, 1638409, 10, 0, 1638410, 10, 0, 1638411, 10, 0, 1638412, 10, 0, 1638413, 10, 0, 1638414, 10, 0, 1638415, 10, 0, 1638416, 2, 0, 1638428, 536870914, 0, 1638429, 536870922, 0, 1638430, 536870922, 0, 1638431, 536870922, 0, 1638432, 536870922, 0, 1638433, 536870922, 0, 1638434, 536870922, 0, 1638435, 536870922, 0, 1638436, 536870922, 0, 1638437, 536870922, 0, 1638438, 536870922, 0, 1638440, 12, 0, 1638452, 536870914, 0, 1638453, 536870922, 0, 1638454, 536870922, 0, 1638455, 536870922, 0, 1638456, 536870922, 0, 1638457, 536870922, 0, 1638458, 536870922, 0, 1638459, 536870922, 0, 1638460, 536870922, 0, 1638461, 536870922, 0, 1638462, 536870922, 0, 1638463, 536870922, 0, 1638464, 536870922, 0, 1638465, 536870922, 0, 1638466, 536870922, 0, 1638467, 536870922, 0, 1638468, 536870922, 0, 1638469, 536870922, 0, 1703964, 536870914, 0, 1703965, 536870922, 0, 1703966, 536870922, 0, 1703967, 536870922, 0, 1703968, 536870922, 0, 1703969, 536870922, 0, 1703970, 536870922, 0, 1703971, 536870922, 0, 1703972, 536870922, 0, 1703973, 536870922, 0, 1703974, 536870922, 0, 1703975, 536870922, 0, 1703977, 12, 0, 1703988, 536870914, 0, 1703989, 536870922, 0, 1703990, 536870922, 0, 1703991, 536870922, 0, 1703992, 536870922, 0, 1703993, 536870922, 0, 1703994, 536870922, 0, 1703995, 536870922, 0, 1703996, 536870922, 0, 1703997, 536870922, 0, 1703998, 536870922, 0, 1703999, 536870922, 0, 1704000, 536870922, 0, 1704001, 536870922, 0, 1704002, 536870922, 0, 1704003, 536870922, 0, 1704004, 536870922, 0, 1704005, 536870922, 0, 1769500, 536870914, 0, 1769501, 536870922, 0, 1769502, 536870922, 0, 1769503, 536870922, 0, 1769504, 536870922, 0, 1769505, 536870922, 0, 1769506, 536870922, 0, 1769507, 536870922, 0, 1769508, 536870922, 0, 1769509, 536870922, 0, 1769510, 536870922, 0, 1769511, 536870922, 0, 1769512, 536870922, 0, 1769514, 12, 0, 1769524, 536870914, 0, 1769525, 536870922, 0, 1769526, 536870922, 0, 1769527, 536870922, 0, 1769528, 536870922, 0, 1769529, 536870922, 0, 1769530, 536870922, 0, 1769531, 536870922, 0, 1769532, 536870922, 0, 1769533, 536870922, 0, 1769534, 536870922, 0, 1769535, 536870922, 0, 1769536, 536870922, 0, 1769537, 536870922, 0, 1769538, 536870922, 0, 1769539, 536870922, 0, 1769540, 536870922, 0, 1769541, 536870922, 0, 1835036, 536870914, 0, 1835037, 536870922, 0, 1835038, 536870922, 0, 1835039, 536870922, 0, 1835040, 536870922, 0, 1835041, 536870922, 0, 1835042, 536870922, 0, 1835043, 536870922, 0, 1835044, 536870922, 0, 1835045, 536870922, 0, 1835046, 536870922, 0, 1835047, 536870922, 0, 1835048, 536870922, 0, 1835049, 536870922, 0, 1835051, 12, 0, 1835060, 536870914, 0, 1835061, 536870922, 0, 1835062, 536870922, 0, 1835063, 536870922, 0, 1835064, 536870922, 0, 1835065, 536870922, 0, 1835066, 536870922, 0, 1835067, 536870922, 0, 1835068, 536870922, 0, 1835069, 536870922, 0, 1835070, 536870922, 0, 1835071, 536870922, 0, 1835072, 536870922, 0, 1835073, 536870922, 0, 1835074, 536870922, 0, 1835075, 536870922, 0, 1835076, 536870922, 0, 1835077, 536870922, 0, 1900572, 536870914, 0, 1900573, 536870922, 0, 1900574, 536870922, 0, 1900575, 536870922, 0, 1900576, 536870922, 0, 1900577, 536870922, 0, 1900578, 536870922, 0, 1900579, 536870922, 0, 1900580, 536870922, 0, 1900581, 536870922, 0, 1900582, 536870922, 0, 1900583, 536870922, 0, 1900584, 536870922, 0, 1900585, 536870922, 0, 1900586, 536870922, 0, 1900588, 0, 0, 1900589, 0, 0, 1900590, 0, 0, 1900591, 0, 0, 1900592, 0, 0, 1900593, 0, 0, 1900594, 0, 0, 1900595, 0, 0, 1900596, 536870916, 0, 1900597, 536870922, 0, 1900598, 536870922, 0, 1900599, 536870922, 0, 1900600, 536870922, 0, 1900601, 536870922, 0, 1900602, 536870922, 0, 1900603, 536870922, 0, 1900604, 536870922, 0, 1900605, 536870922, 0, 1900606, 536870922, 0, 1900607, 536870922, 0, 1900608, 536870922, 0, 1900609, 536870922, 0, 1900610, 536870922, 0, 1900611, 536870922, 0, 1900612, 536870922, 0, 1900613, 536870922, 0, 1966108, 536870914, 0, 1966109, 536870922, 0, 1966110, 536870922, 0, 1966111, 536870922, 0, 1966112, 536870922, 0, 1966113, 536870922, 0, 1966114, 536870922, 0, 1966115, 536870922, 0, 1966116, 536870922, 0, 1966117, 536870922, 0, 1966118, 536870922, 0, 1966119, 536870922, 0, 1966120, 536870922, 0, 1966121, 536870922, 0, 1966122, 536870922, 0, 1966123, 536870922, 0, 1966124, 536870922, 0, 1966125, 536870922, 0, 1966126, 536870922, 0, 1966127, 536870922, 0, 1966128, 536870922, 0, 1966129, 536870922, 0, 1966130, 536870922, 0, 1966131, 536870922, 0, 1966132, 536870922, 0, 1966133, 536870922, 0, 1966134, 536870922, 0, 1966135, 536870922, 0, 1966136, 536870922, 0, 1966137, 536870922, 0, 1966138, 536870922, 0, 1966139, 536870922, 0, 1966140, 536870922, 0, 1966141, 536870922, 0, 1966142, 536870922, 0, 1966143, 536870922, 0, 1966144, 536870922, 0, 1966145, 536870922, 0, 1966146, 536870922, 0, 1966147, 536870922, 0, 1966148, 536870922, 0, 1966149, 536870922, 0, 2031644, 536870914, 0, 2031645, 536870922, 0, 2031646, 536870922, 0, 2031647, 536870922, 0, 2031648, 536870922, 0, 2031649, 536870922, 0, 2031650, 536870922, 0, 2031651, 536870922, 0, 2031652, 536870922, 0, 2031653, 536870922, 0, 2031654, 536870922, 0, 2031655, 536870922, 0, 2031656, 536870922, 0, 2031657, 536870922, 0, 2031658, 536870922, 0, 2031659, 536870922, 0, 2031660, 536870922, 0, 2031661, 536870922, 0, 2031662, 536870922, 0, 2031663, 536870922, 0, 2031664, 536870922, 0, 2031665, 536870922, 0, 2031666, 536870922, 0, 2031667, 536870922, 0, 2031668, 536870922, 0, 2031669, 536870922, 0, 2031670, 536870922, 0, 2031671, 536870922, 0, 2031672, 536870922, 0, 2031673, 536870922, 0, 2031674, 536870922, 0, 2031675, 536870922, 0, 2031676, 536870922, 0, 2031677, 536870922, 0, 2031678, 536870922, 0, 2031679, 536870922, 0, 2031680, 536870922, 0, 2031681, 536870922, 0, 2031682, 536870922, 0, 2031683, 536870922, 0, 2031684, 536870922, 0, 2031685, 536870922, 0, 2097180, 536870914, 0, 2097181, 536870922, 0, 2097182, 536870922, 0, 2097183, 536870922, 0, 2097184, 536870922, 0, 2097185, 536870922, 0, 2097186, 536870922, 0, 2097187, 536870922, 0, 2097188, 536870922, 0, 2097189, 536870922, 0, 2097190, 536870922, 0, 2097191, 536870922, 0, 2097192, 536870922, 0, 2097193, 536870922, 0, 2097194, 536870922, 0, 2097195, 536870922, 0, 2097196, 536870922, 0, 2097197, 536870922, 0, 2097198, 536870922, 0, 2097199, 536870922, 0, 2097200, 536870922, 0, 2097201, 536870922, 0, 2097202, 536870922, 0, 2097203, 536870922, 0, 2097204, 536870922, 0, 2097205, 536870922, 0, 2097206, 536870922, 0, 2097207, 536870922, 0, 2097208, 536870922, 0, 2097209, 536870922, 0, 2097210, 536870922, 0, 2097211, 536870922, 0, 2097212, 536870922, 0, 2097213, 536870922, 0, 2097214, 536870922, 0, 2097215, 536870922, 0, 2097216, 536870922, 0, 2097217, 536870922, 0, 2097218, 536870922, 0, 2097219, 536870922, 0, 2097220, 536870922, 0, 2097221, 536870922, 0, 2162716, 536870914, 0, 2162717, 536870922, 0, 2162718, 536870922, 0, 2162719, 536870922, 0, 2162720, 536870922, 0, 2162721, 536870922, 0, 2162722, 536870922, 0, 2162723, 536870922, 0, 2162724, 536870922, 0, 2162725, 536870922, 0, 2162726, 536870922, 0, 2162727, 536870922, 0, 2162728, 536870922, 0, 2162729, 536870922, 0, 2162730, 536870922, 0, 2162731, 536870922, 0, 2162732, 536870922, 0, 2162733, 536870922, 0, 2162734, 536870922, 0, 2162735, 536870922, 0, 2162736, 536870922, 0, 2162737, 536870922, 0, 2162738, 536870922, 0, 2162739, 536870922, 0, 2162740, 536870922, 0, 2162741, 536870922, 0, 2162742, 536870922, 0, 2162743, 536870922, 0, 2162744, 536870922, 0, 2162745, 536870922, 0, 2162746, 536870922, 0, 2162747, 536870922, 0, 2162748, 536870922, 0, 2162749, 536870922, 0, 2162750, 536870922, 0, 2162751, 536870922, 0, 2162752, 536870922, 0, 2162753, 536870922, 0, 2162754, 536870922, 0, 2162755, 536870922, 0, 2162756, 536870922, 0, 2162757, 536870922, 0, 2228252, 536870914, 0, 2228253, 536870922, 0, 2228254, 536870922, 0, 2228255, 536870922, 0, 2228256, 536870922, 0, 2228257, 536870922, 0, 2228258, 536870922, 0, 2228259, 536870922, 0, 2228260, 536870922, 0, 2228261, 536870922, 0, 2228262, 536870922, 0, 2228263, 536870922, 0, 2228264, 536870922, 0, 2228265, 536870922, 0, 2228266, 536870922, 0, 2228267, 536870922, 0, 2228268, 536870922, 0, 2228269, 536870922, 0, 2228270, 536870922, 0, 2228271, 536870922, 0, 2228272, 536870922, 0, 2228273, 536870922, 0, 2228274, 536870922, 0, 2228275, 536870922, 0, 2228276, 536870922, 0, 2228277, 536870922, 0, 2228278, 536870922, 0, 2228279, 536870922, 0, 2228280, 536870922, 0, 2228281, 536870922, 0, 2228282, 536870922, 0, 2228283, 536870922, 0, 2228284, 536870922, 0, 2228285, 536870922, 0, 2228286, 536870922, 0, 2228287, 536870922, 0, 2228288, 536870922, 0, 2228289, 536870922, 0, 2228290, 536870922, 0, 2228291, 536870922, 0, 2228292, 536870922, 0, 2228293, 536870922, 0, 2293788, 536870914, 0, 2293789, 536870922, 0, 2293790, 536870922, 0, 2293791, 536870922, 0, 2293792, 536870922, 0, 2293793, 536870922, 0, 2293794, 536870922, 0, 2293795, 536870922, 0, 2293796, 536870922, 0, 2293797, 536870922, 0, 2293798, 536870922, 0, 2293799, 536870922, 0, 2293800, 536870922, 0, 2293801, 536870922, 0, 2293802, 536870922, 0, 2293803, 536870922, 0, 2293804, 536870922, 0, 2293805, 536870922, 0, 2293806, 536870922, 0, 2293807, 536870922, 0, 2293808, 536870922, 0, 2293809, 536870922, 0, 2293810, 536870922, 0, 2293811, 536870922, 0, 2293812, 536870922, 0, 2293813, 536870922, 0, 2293814, 536870922, 0, 2293815, 536870922, 0, 2293816, 536870922, 0, 2293817, 536870922, 0, 2293818, 536870922, 0, 2293819, 536870922, 0, 2293820, 536870922, 0, 2293821, 536870922, 0, 2293822, 536870922, 0, 2293823, 536870922, 0, 2293824, 536870922, 0, 2293825, 536870922, 0, 2293826, 536870922, 0, 2293827, 536870922, 0, 2293828, 536870922, 0, 2293829, 536870922, 0, 2293830, 536870922, 0, 2359324, 536870914, 0, 2359325, 536870922, 0, 2359326, 536870922, 0, 2359327, 536870922, 0, 2359328, 536870922, 0, 2359329, 536870922, 0, 2359330, 536870922, 0, 2359331, 536870922, 0, 2359332, 536870922, 0, 2359333, 536870922, 0, 2359334, 536870922, 0, 2359335, 536870922, 0, 2359336, 536870922, 0, 2359337, 536870922, 0, 2359338, 536870922, 0, 2359339, 536870922, 0, 2359340, 536870922, 0, 2359341, 536870922, 0, 2359342, 536870922, 0, 2359343, 536870922, 0, 2359344, 536870922, 0, 2359345, 536870922, 0, 2359346, 536870922, 0, 2359347, 536870922, 0, 2359348, 536870922, 0, 2359349, 536870922, 0, 2359350, 536870922, 0, 2359351, 536870922, 0, 2359352, 536870922, 0, 2359353, 536870922, 0, 2359354, 536870922, 0, 2359355, 536870922, 0, 2359356, 536870922, 0, 2359357, 536870922, 0, 2359358, 536870922, 0, 2359359, 536870922, 0, 2359360, 536870922, 0, 2359361, 536870922, 0, 2359362, 536870922, 0, 2359363, 536870922, 0, 2359364, 536870922, 0, 2359365, 536870922, 0, 2359366, 536870922, 0, 2424860, 536870914, 0, 2424861, 536870922, 0, 2424862, 536870922, 0, 2424863, 536870922, 0, 2424864, 536870922, 0, 2424865, 536870922, 0, 2424866, 536870922, 0, 2424867, 536870922, 0, 2424868, 536870922, 0, 2424869, 536870922, 0, 2424870, 536870922, 0, 2424871, 536870922, 0, 2424872, 536870922, 0, 2424873, 536870922, 0, 2424874, 536870922, 0, 2424875, 536870922, 0, 2424876, 536870922, 0, 2424877, 536870922, 0, 2424878, 536870922, 0, 2424879, 536870922, 0, 2424880, 536870922, 0, 2424881, 536870922, 0, 2424882, 536870922, 0, 2424883, 536870922, 0, 2424884, 536870922, 0, 2424885, 536870922, 0, 2424886, 536870922, 0, 2424887, 536870922, 0, 2424888, 536870922, 0, 2424889, 536870922, 0, 2424890, 536870922, 0, 2424891, 536870922, 0, 2424892, 536870922, 0, 2424893, 536870922, 0, 2424894, 536870922, 0, 2424895, 536870922, 0, 2424896, 536870922, 0, 2424897, 536870922, 0, 2424898, 536870922, 0, 2424899, 536870922, 0, 2424900, 536870922, 0, 2424901, 536870922, 0, 2424902, 536870922, 0, 2490397, 536870922, 0, 2490398, 536870922, 0, 2490399, 536870922, 0, 2490400, 536870922, 0, 2490401, 536870922, 0, 2490402, 536870922, 0, 2490403, 536870922, 0, 2490404, 536870922, 0, 2490405, 536870922, 0, 2490406, 536870922, 0, 2490407, 536870922, 0, 2490408, 536870922, 0, 2490409, 536870922, 0, 2490410, 536870922, 0, 2490411, 536870922, 0, 2490412, 536870922, 0, 2490413, 536870922, 0, 2490414, 536870922, 0, 2490415, 536870922, 0, 2490416, 536870922, 0, 2490417, 536870922, 0, 2490418, 536870922, 0, 2490419, 536870922, 0, 2490420, 536870922, 0, 2490421, 536870922, 0, 2490422, 536870922, 0, 2490423, 536870922, 0, 2490424, 536870922, 0, 2490425, 536870922, 0, 2490426, 536870922, 0, 2490427, 536870922, 0, 2490428, 536870922, 0, 2490429, 536870922, 0, 2490430, 536870922, 0, 2490431, 536870922, 0, 2490432, 536870922, 0, 2490433, 536870922, 0, 2490434, 536870922, 0, 2490435, 536870922, 0, 2490436, 536870922, 0, 2490437, 536870922, 0, 2555933, 536870922, 0, 2555934, 536870922, 0, 2555935, 536870922, 0, 2555936, 536870922, 0, 2555937, 536870922, 0, 2555938, 536870922, 0, 2555939, 536870922, 0, 2555940, 536870922, 0, 2555941, 536870922, 0, 2555942, 536870922, 0, 2555943, 536870922, 0, 2555944, 536870922, 0, 2555945, 536870922, 0, 2555946, 536870922, 0, 2555947, 536870922, 0, 2555948, 536870922, 0, 2555949, 536870922, 0, 2555950, 536870922, 0, 2555951, 536870922, 0, 2555952, 536870922, 0, 2555953, 536870922, 0, 2555954, 536870922, 0, 2555955, 536870922, 0, 2555956, 536870922, 0, 2555957, 536870922, 0, 2555958, 536870922, 0, 2555959, 536870922, 0, 2555960, 536870922, 0, 2555961, 536870922, 0, 2555962, 536870922, 0, 2555963, 536870922, 0, 2555964, 536870922, 0, 2555965, 536870922, 0, 2555966, 536870922, 0, 2555967, 536870922, 0, 2555968, 536870922, 0, 2555969, 536870922, 0, 2555970, 536870922, 0, 2555971, 536870922, 0, 2555972, 536870922, 0, 2555973, 536870922, 0, 2621469, 536870922, 0, 2621470, 536870922, 0, 2621471, 536870922, 0, 2621472, 536870922, 0, 2621473, 536870922, 0, 2621474, 536870922, 0, 2621475, 536870922, 0, 2621476, 536870922, 0, 2621477, 536870922, 0, 2621478, 536870922, 0, 2621479, 536870922, 0, 2621480, 536870922, 0, 2621481, 536870922, 0, 2621482, 536870922, 0, 2621483, 536870922, 0, 2621484, 536870922, 0, 2621485, 536870922, 0, 2621486, 536870922, 0, 2621487, 536870922, 0, 2621488, 536870922, 0, 2621489, 536870922, 0, 2621490, 536870922, 0, 2621491, 536870922, 0, 2621492, 536870922, 0, 2621493, 536870922, 0, 2621494, 536870922, 0, 2621495, 536870922, 0, 2621496, 536870922, 0, 2621497, 536870922, 0, 2621498, 536870922, 0, 2621499, 536870922, 0, 2621500, 536870922, 0, 2621501, 536870922, 0, 2621502, 536870922, 0, 2621503, 536870922, 0, 2621504, 536870922, 0, 2621505, 536870922, 0, 2621506, 536870922, 0, 2621507, 536870922, 0, 2621508, 536870922, 0, 2687006, 536870922, 0, 2687007, 536870922, 0, 2687008, 536870922, 0, 2687009, 536870922, 0, 2687010, 536870922, 0, 2687011, 536870922, 0, 2687012, 536870922, 0, 2687013, 536870922, 0, 2687014, 536870922, 0, 2687015, 536870922, 0, 2687016, 536870922, 0, 2687017, 536870922, 0, 2687018, 536870922, 0, 2687019, 536870922, 0, 2687020, 536870922, 0, 2687021, 536870922, 0, 2687022, 536870922, 0, 2687023, 536870922, 0, 2687024, 536870922, 0, 2687025, 536870922, 0, 2687026, 536870922, 0, 2687027, 536870922, 0, 2687028, 536870922, 0, 2687029, 536870922, 0, 2687030, 536870922, 0, 2687031, 536870922, 0, 2687032, 536870922, 0, 2687033, 536870922, 0, 2687034, 536870922, 0, 2687035, 536870922, 0, 2687036, 536870922, 0, 2687037, 536870922, 0, 2687038, 536870922, 0, 2687039, 536870922, 0, 2687040, 536870922, 0, 2687041, 536870922, 0, 2687042, 536870922, 0, 2687043, 536870922, 0, 2687044, 536870922, 0, 2752543, 536870922, 0, 2752544, 536870922, 0, 2752545, 536870922, 0, 2752546, 536870922, 0, 2752547, 536870922, 0, 2752548, 536870922, 0, 2752549, 536870922, 0, 2752550, 536870922, 0, 2752551, 536870922, 0, 2752552, 536870922, 0, 2752553, 536870922, 0, 2752554, 536870922, 0, 2752555, 536870922, 0, 2752556, 536870922, 0, 2752557, 536870922, 0, 2752558, 536870922, 0, 2752559, 536870922, 0, 2752560, 536870922, 0, 2752561, 536870922, 0, 2752562, 536870922, 0, 2752563, 536870922, 0, 2752564, 536870922, 0, 2752565, 536870922, 0, 2752566, 536870922, 0, 2752567, 536870922, 0, 2752568, 536870922, 0, 2752569, 536870922, 0, 2752570, 536870922, 0, 2752571, 536870922, 0, 2752572, 536870922, 0, 2752573, 536870922, 0, 2752574, 536870922, 0, 2752575, 536870922, 0, 2752576, 536870922, 0, 2752577, 536870922, 0, 2752578, 536870922, 0, 2752579, 536870922, 0, 2818083, 536870922, 0, 2818084, 536870922, 0, 2818085, 536870922, 0, 2818086, 536870922, 0, 2818087, 536870922, 0, 2818088, 536870922, 0, 2818089, 536870922, 0, 2818090, 536870922, 0, 2818091, 536870922, 0, 2818092, 536870922, 0, 2818093, 536870922, 0, 2818094, 536870922, 0, 2818095, 536870922, 0, 2818096, 536870922, 0, 2818097, 536870922, 0, 2818098, 536870922, 0, 2818099, 536870922, 0, 2818100, 536870922, 0, 2818101, 536870922, 0, 2818102, 536870922, 0, 2818103, 536870922, 0, 2818104, 536870922, 0, 2818105, 536870922, 0, 2818106, 536870922, 0, 2818107, 536870922, 0, 2818108, 536870922, 0, 2818109, 536870922, 0, 2818110, 536870922, 0, 2818111, 536870922, 0, 2818112, 536870922, 0, 2818113, 536870922, 0 ) -__meta__ = { -"_edit_lock_": true -} - -[node name="Coins" type="Node" parent="."] - -[node name="Coin1" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 672, 1179 ) - -[node name="Coin2" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 704, 1179 ) - -[node name="Coin3" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 736, 1179 ) - -[node name="Coin4" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1120, 992 ) - -[node name="Coin5" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1152, 992 ) - -[node name="Coin6" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1184, 992 ) - -[node name="Coin7" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1216, 992 ) - -[node name="Coin8" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1248, 992 ) - -[node name="Coin9" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1568, 864 ) - -[node name="Coin10" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1632, 864 ) - -[node name="Coin11" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1169.44, 677.369 ) - -[node name="Coin12" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1233.44, 677.369 ) - -[node name="Coin13" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 924.453, 566.264 ) - -[node name="Coin14" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 988.453, 566.264 ) - -[node name="Coin15" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 983.872, 336.653 ) - -[node name="Coin16" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1047.87, 336.653 ) - -[node name="Coin17" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1111.87, 336.653 ) - -[node name="Coin18" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1111.87, 272.653 ) - -[node name="Coin19" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 1047.87, 272.653 ) - -[node name="Coin20" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 983.872, 272.653 ) - -[node name="Coin21" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 3726.65, 1102.79 ) - -[node name="Coin22" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 89.5989, 481.217 ) - -[node name="Coin23" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 3735.94, 1095.49 ) - -[node name="Coin24" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 3743.9, 1084.22 ) - -[node name="Coin25" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 3745.23, 1072.28 ) - -[node name="Coin26" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 3733.95, 1063.65 ) - -[node name="Coin27" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 3725.99, 1072.94 ) - -[node name="Coin28" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 88.272, 448.71 ) - -[node name="Coin29" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 79.6476, 457.334 ) - -[node name="Coin30" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 82.9647, 468.612 ) - -[node name="Coin31" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 2159.07, 1356.49 ) - -[node name="Coin32" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 2223.07, 1356.49 ) - -[node name="Coin33" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 2287.07, 1356.49 ) - -[node name="Coin34" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 2287.07, 1292.49 ) - -[node name="Coin35" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 2223.07, 1292.49 ) - -[node name="Coin36" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 2159.07, 1292.49 ) - -[node name="Coin37" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 4172.75, 605.058 ) - -[node name="Coin38" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 4236.75, 605.058 ) - -[node name="Coin39" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 4300.75, 605.058 ) - -[node name="Coin40" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 4300.75, 541.058 ) - -[node name="Coin41" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 4236.75, 541.058 ) - -[node name="Coin42" parent="Coins" instance=ExtResource( 2 )] -position = Vector2( 4172.75, 541.058 ) - -[node name="Props" type="Node" parent="."] - -[node name="MovingPlatform" parent="Props" instance=ExtResource( 3 )] -position = Vector2( 1451.86, 742.969 ) - -[node name="MovingPlatform2" parent="Props" instance=ExtResource( 3 )] -position = Vector2( 719.199, 1123.81 ) -motion = Vector2( 100, 0 ) -cycle = 4.0 - -[node name="Still" parent="Props" instance=ExtResource( 3 )] -position = Vector2( 1231.37, 1105.18 ) -rotation = -0.163314 - -[node name="Still1" parent="Props" instance=ExtResource( 3 )] -position = Vector2( 1384.28, 1066.4 ) -rotation = -0.321902 - -[node name="Still2" parent="Props" instance=ExtResource( 3 )] -position = Vector2( 1552.7, 1032.05 ) -rotation = -0.0826906 - -[node name="Still3" parent="Props" instance=ExtResource( 3 )] -position = Vector2( 1700.06, 1066.92 ) -rotation = 0.547997 - -[node name="OneWayPlatform1" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 967.609, 836.547 ) - -[node name="OneWayPlatform2" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 1190.78, 754.282 ) - -[node name="OneWayPlatform3" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 953.762, 638.622 ) - -[node name="OneWayPlatform4" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 1256.76, 638.622 ) - -[node name="OneWayPlatform5" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 1039.29, 409.746 ) - -[node name="OneWayPlatform6" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 1192.93, 520.298 ) - -[node name="OneWayPlatform7" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 2784.9, 1655.71 ) - -[node name="OneWayPlatform8" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 2976.23, 1555 ) - -[node name="OneWayPlatform9" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 3122.25, 1469.41 ) - -[node name="OneWayPlatform10" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 3200.29, 1353.6 ) - -[node name="OneWayPlatform11" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 3200.29, 1237.8 ) - -[node name="OneWayPlatform12" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 1099.56, 940.804 ) - -[node name="OneWayPlatform13" parent="Props" instance=ExtResource( 4 )] -position = Vector2( 1339.63, 967.879 ) - -[node name="Player" parent="." instance=ExtResource( 7 )] -position = Vector2( 251.684, 1045.6 ) - -[node name="Enemies" type="Node" parent="."] - -[node name="Enemy1" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 734.693, 1064.22 ) - -[node name="Enemy2" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 707.665, 1225.05 ) - -[node name="Enemy3" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 1125.21, 1053.06 ) - -[node name="Enemy4" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 1292.11, 1059.24 ) - -[node name="Enemy5" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 968.927, 766.466 ) - -[node name="Enemy6" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 3080.34, 1807.61 ) - -[node name="Enemy7" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 1457.6, 688.741 ) - -[node name="Enemy8" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 1264.06, 571.713 ) - -[node name="Enemy9" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 3590.85, 1114.86 ) - -[node name="Enemy10" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 3546.2, 1356.19 ) - -[node name="Enemy11" parent="Enemies" instance=ExtResource( 5 )] -position = Vector2( 2215.3, 1429.39 ) - -[node name="ParallaxBg" parent="." instance=ExtResource( 6 )] - -[node name="Label" type="Label" parent="."] -margin_left = 12.0 -margin_top = -202.0 -margin_right = 358.0 -margin_bottom = -10.0 -size_flags_horizontal = 2 -size_flags_vertical = 0 -text = "This is a simple demo on how to make a platformer game with Godot.\"This version uses physics and the 2D physics engine for motion and collision.\"\"The demo also shows the benefits of using the scene system, where coins,\"enemies and the player are edited separatedly and instanced in the stage.\"\"To edit the base tiles for the tileset, open the tileset_edit.tscn file and follow \"instructions.\"" -autowrap = true - -[node name="Music" type="AudioStreamPlayer" parent="."] -stream = ExtResource( 8 ) -autoplay = true diff --git a/2d/platformer/TileSet.tres b/2d/platformer/TileSet.tres deleted file mode 100644 index 276213d1..00000000 --- a/2d/platformer/TileSet.tres +++ /dev/null @@ -1,243 +0,0 @@ -[gd_resource type="TileSet" load_steps=14 format=2] - -[ext_resource path="res://tiles_demo.png" type="Texture" id=1] - -[sub_resource type="ConvexPolygonShape2D" id=1] - -custom_solver_bias = 0.0 -points = PoolVector2Array( 32, -24, 32, 32, -32, 32, -32, -24 ) - -[sub_resource type="ConvexPolygonShape2D" id=2] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -24, 24, -24, 24, 32, -32, 32 ) - -[sub_resource type="ConvexPolygonShape2D" id=3] - -custom_solver_bias = 0.0 -points = PoolVector2Array( 32, -32, 32, 32, -32, 32, -32, -32 ) - -[sub_resource type="ConvexPolygonShape2D" id=4] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -56, 32, 8, 32, 64, -32, 64 ) - -[sub_resource type="ConvexPolygonShape2D" id=5] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 ) - -[sub_resource type="ConvexPolygonShape2D" id=6] - -custom_solver_bias = 0.0 -points = PoolVector2Array( 32, -24, 32, 24, -32, 24, -32, -24 ) - -[sub_resource type="ConvexPolygonShape2D" id=7] - -custom_solver_bias = 0.0 -points = PoolVector2Array( 24, -24, 24, 24, -32, 24, -32, -24 ) - -[sub_resource type="ConvexPolygonShape2D" id=8] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 ) - -[sub_resource type="ConvexPolygonShape2D" id=9] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -64, -32, -8, -32, -8, 32, -64, 32 ) - -[sub_resource type="ConvexPolygonShape2D" id=10] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -32, 24, -32, 32, -24, 32, 32, -32, 32 ) - -[sub_resource type="ConvexPolygonShape2D" id=11] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -24, 32, -24, 32, 32, -32, 32 ) - -[sub_resource type="ConvexPolygonShape2D" id=12] - -custom_solver_bias = 0.0 -points = PoolVector2Array( -32, -24, 32, -24, 32, 32, -32, 32 ) - -[resource] - -0/name = "floor" -0/texture = ExtResource( 1 ) -0/tex_offset = Vector2( 0, 0 ) -0/modulate = Color( 1, 1, 1, 1 ) -0/region = Rect2( 0, 0, 64, 64 ) -0/occluder_offset = Vector2( 32, 32 ) -0/navigation_offset = Vector2( 32, 32 ) -0/shapes = [ { -"one_way": false, -"shape": SubResource( 1 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -1/name = "edge" -1/texture = ExtResource( 1 ) -1/tex_offset = Vector2( 0, 0 ) -1/modulate = Color( 1, 1, 1, 1 ) -1/region = Rect2( 64, 0, 64, 64 ) -1/occluder_offset = Vector2( 32, 32 ) -1/navigation_offset = Vector2( 32, 32 ) -1/shapes = [ { -"one_way": false, -"shape": SubResource( 2 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -2/name = "wall" -2/texture = ExtResource( 1 ) -2/tex_offset = Vector2( 0, 0 ) -2/modulate = Color( 1, 1, 1, 1 ) -2/region = Rect2( 64, 64, 64, 64 ) -2/occluder_offset = Vector2( 32, 32 ) -2/navigation_offset = Vector2( 32, 32 ) -2/shapes = [ { -"one_way": false, -"shape": SubResource( 8 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -3/name = "wall_deco" -3/texture = ExtResource( 1 ) -3/tex_offset = Vector2( 0, 0 ) -3/modulate = Color( 1, 1, 1, 1 ) -3/region = Rect2( 320, 128, 128, 64 ) -3/occluder_offset = Vector2( 64, 32 ) -3/navigation_offset = Vector2( 64, 32 ) -3/shapes = [ { -"one_way": false, -"shape": SubResource( 9 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 64, 32 ) -} ] -4/name = "corner" -4/texture = ExtResource( 1 ) -4/tex_offset = Vector2( 0, 0 ) -4/modulate = Color( 1, 1, 1, 1 ) -4/region = Rect2( 64, 128, 64, 64 ) -4/occluder_offset = Vector2( 32, 32 ) -4/navigation_offset = Vector2( 32, 32 ) -4/shapes = [ { -"one_way": false, -"shape": SubResource( 10 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -5/name = "flowers" -5/texture = ExtResource( 1 ) -5/tex_offset = Vector2( 0, 0 ) -5/modulate = Color( 1, 1, 1, 1 ) -5/region = Rect2( 192, 192, 64, 64 ) -5/occluder_offset = Vector2( 32, 32 ) -5/navigation_offset = Vector2( 32, 32 ) -5/shapes = [ { -"one_way": false, -"shape": SubResource( 11 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -6/name = "tree_base" -6/texture = ExtResource( 1 ) -6/tex_offset = Vector2( 0, 0 ) -6/modulate = Color( 1, 1, 1, 1 ) -6/region = Rect2( 256, 192, 64, 64 ) -6/occluder_offset = Vector2( 32, 32 ) -6/navigation_offset = Vector2( 32, 32 ) -6/shapes = [ { -"one_way": false, -"shape": SubResource( 12 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -7/name = "tree_mid" -7/texture = ExtResource( 1 ) -7/tex_offset = Vector2( 0, 0 ) -7/modulate = Color( 1, 1, 1, 1 ) -7/region = Rect2( 256, 128, 64, 64 ) -7/occluder_offset = Vector2( 32, 32 ) -7/navigation_offset = Vector2( 32, 32 ) -7/shapes = [ ] -8/name = "tree_mid 2" -8/texture = ExtResource( 1 ) -8/tex_offset = Vector2( 0, 0 ) -8/modulate = Color( 1, 1, 1, 1 ) -8/region = Rect2( 256, 64, 64, 64 ) -8/occluder_offset = Vector2( 32, 32 ) -8/navigation_offset = Vector2( 32, 32 ) -8/shapes = [ ] -9/name = "tree_top" -9/texture = ExtResource( 1 ) -9/tex_offset = Vector2( 0, 0 ) -9/modulate = Color( 1, 1, 1, 1 ) -9/region = Rect2( 256, 0, 64, 64 ) -9/occluder_offset = Vector2( 32, 32 ) -9/navigation_offset = Vector2( 32, 32 ) -9/shapes = [ ] -10/name = "solid" -10/texture = ExtResource( 1 ) -10/tex_offset = Vector2( 0, 0 ) -10/modulate = Color( 1, 1, 1, 1 ) -10/region = Rect2( 0, 64, 64, 64 ) -10/occluder_offset = Vector2( 32, 32 ) -10/navigation_offset = Vector2( 32, 32 ) -10/shapes = [ ] -11/name = "ceiling" -11/texture = ExtResource( 1 ) -11/tex_offset = Vector2( 0, 0 ) -11/modulate = Color( 1, 1, 1, 1 ) -11/region = Rect2( 384, 64, 64, 64 ) -11/occluder_offset = Vector2( 32, 32 ) -11/navigation_offset = Vector2( 32, 32 ) -11/shapes = [ { -"one_way": false, -"shape": SubResource( 3 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -12/name = "ramp" -12/texture = ExtResource( 1 ) -12/tex_offset = Vector2( 0, 0 ) -12/modulate = Color( 1, 1, 1, 1 ) -12/region = Rect2( 128, 128, 64, 128 ) -12/occluder_offset = Vector2( 32, 64 ) -12/navigation_offset = Vector2( 32, 64 ) -12/shapes = [ { -"one_way": false, -"shape": SubResource( 4 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 64 ) -} ] -13/name = "ceiling2wall" -13/texture = ExtResource( 1 ) -13/tex_offset = Vector2( 0, 0 ) -13/modulate = Color( 1, 1, 1, 1 ) -13/region = Rect2( 448, 64, 64, 64 ) -13/occluder_offset = Vector2( 32, 32 ) -13/navigation_offset = Vector2( 32, 32 ) -13/shapes = [ { -"one_way": false, -"shape": SubResource( 5 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -14/name = "platform_floor" -14/texture = ExtResource( 1 ) -14/tex_offset = Vector2( 0, 0 ) -14/modulate = Color( 1, 1, 1, 1 ) -14/region = Rect2( 128, 0, 64, 64 ) -14/occluder_offset = Vector2( 32, 32 ) -14/navigation_offset = Vector2( 32, 32 ) -14/shapes = [ { -"one_way": false, -"shape": SubResource( 6 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] -15/name = "platform_edge" -15/texture = ExtResource( 1 ) -15/tex_offset = Vector2( 0, 0 ) -15/modulate = Color( 1, 1, 1, 1 ) -15/region = Rect2( 192, 0, 64, 64 ) -15/occluder_offset = Vector2( 32, 32 ) -15/navigation_offset = Vector2( 32, 32 ) -15/shapes = [ { -"one_way": false, -"shape": SubResource( 7 ), -"shape_transform": Transform2D( 1, 0, 0, 1, 32, 32 ) -} ] - diff --git a/2d/platformer/TilesetEdit.tscn b/2d/platformer/TilesetEdit.tscn deleted file mode 100644 index 7b0153a3..00000000 --- a/2d/platformer/TilesetEdit.tscn +++ /dev/null @@ -1,324 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://tiles_demo.png" type="Texture" id=1] - -[node name="Node" type="Node"] - -[node name="floor" type="Sprite" parent="."] - -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 0, 0, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="floor"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="floor/collision"] - -build_mode = 0 -polygon = PoolVector2Array( 32, -24, 32, 32, -32, 32, -32, -24 ) - -[node name="edge" type="Sprite" parent="."] - -position = Vector2( 64, 0 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 64, 0, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="edge"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="edge/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, -24, 24, -24, 24, 32, -32, 32 ) - -[node name="wall" type="Sprite" parent="."] - -position = Vector2( 64, 64 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 64, 64, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="wall"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="wall/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 ) - -[node name="wall_deco" type="Sprite" parent="."] - -position = Vector2( 96, 128 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 320, 128, 128, 64 ) - -[node name="collision" type="StaticBody2D" parent="wall_deco"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="wall_deco/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -64, -32, -8, -32, -8, 32, -64, 32 ) - -[node name="corner" type="Sprite" parent="."] - -position = Vector2( 64, 192 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 64, 128, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="corner"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="corner/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, -32, 24, -32, 32, -24, 32, 32, -32, 32 ) - -[node name="flowers" type="Sprite" parent="."] - -position = Vector2( 128, 192 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 192, 192, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="flowers"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="flowers/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 ) - -[node name="tree_base" type="Sprite" parent="."] - -position = Vector2( 192, 192 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 256, 192, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="tree_base"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="tree_base/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 ) - -[node name="tree_mid" type="Sprite" parent="."] - -position = Vector2( 192, 128 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 256, 128, 64, 64 ) - -[node name="tree_mid 2" type="Sprite" parent="."] - -position = Vector2( 192, 64 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 256, 64, 64, 64 ) - -[node name="tree_top" type="Sprite" parent="."] - -position = Vector2( 192, 0 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 256, 0, 64, 64 ) - -[node name="solid" type="Sprite" parent="."] - -position = Vector2( 0, 64 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 0, 64, 64, 64 ) - -[node name="ceiling" type="Sprite" parent="."] - -position = Vector2( 0, 128 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 384, 64, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="ceiling"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ceiling/collision"] - -build_mode = 0 -polygon = PoolVector2Array( 32, -32, 32, 32, -32, 32, -32, -32 ) - -[node name="ramp" type="Sprite" parent="."] - -position = Vector2( 256, 224 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 128, 128, 64, 128 ) - -[node name="collision" type="StaticBody2D" parent="ramp"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ramp/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, -56, 32, 8, 32, 64, -32, 64 ) - -[node name="ceiling2wall" type="Sprite" parent="."] - -position = Vector2( 0, 192 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 448, 64, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="ceiling2wall"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="ceiling2wall/collision"] - -build_mode = 0 -polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 ) - -[node name="platform_floor" type="Sprite" parent="."] - -position = Vector2( 0, 256 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 128, 0, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="platform_floor"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform_floor/collision"] - -build_mode = 0 -polygon = PoolVector2Array( 32, -24, 32, 24, -32, 24, -32, -24 ) - -[node name="platform_edge" type="Sprite" parent="."] - -position = Vector2( 64, 256 ) -texture = ExtResource( 1 ) -region_enabled = true -region_rect = Rect2( 192, 0, 64, 64 ) - -[node name="collision" type="StaticBody2D" parent="platform_edge"] - -input_pickable = false -collision_layer = 1 -collision_mask = 1 -constant_linear_velocity = Vector2( 0, 0 ) -constant_angular_velocity = 0.0 -friction = 1.0 -bounce = 0.0 - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="platform_edge/collision"] - -build_mode = 0 -polygon = PoolVector2Array( 24, -24, 24, 24, -32, 24, -32, -24 ) - -[node name="help" type="Label" parent="."] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 1.0 -margin_top = 331.0 -margin_right = 727.0 -margin_bottom = 422.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 2 -size_flags_horizontal = 2 -size_flags_vertical = 0 -text = "This scene serves as a tool for editing the tileset. -Nodes (sprites) and their respective collisionsare edited here. - -To create a tileset from this, a \"TileSet\" resoucre must be created. Use the helper in: Scene -> Convert To -> TileSet. -This will save a tileset. Saving over it will merge your changes. - -Finally, the saved tileset resource (tileset.tres in this case), can be opened to be used into a TileMap node for editing a tile map." -percent_visible = 1.0 -lines_skipped = 0 -max_lines_visible = -1 - - diff --git a/2d/platformer/background/scroll_bg_cloud_1.png b/2d/platformer/assets/art/background/cloud_1.png similarity index 100% rename from 2d/platformer/background/scroll_bg_cloud_1.png rename to 2d/platformer/assets/art/background/cloud_1.png diff --git a/2d/platformer/player/osb_fire.png.import b/2d/platformer/assets/art/background/cloud_1.png.import similarity index 69% rename from 2d/platformer/player/osb_fire.png.import rename to 2d/platformer/assets/art/background/cloud_1.png.import index 8dc16ac3..720169ee 100644 --- a/2d/platformer/player/osb_fire.png.import +++ b/2d/platformer/assets/art/background/cloud_1.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/osb_fire.png-67a49910acd764fd7c67429af0ad5cb8.stex" +path="res://.import/cloud_1.png-03c0ad8be397b731df0dd38fa3c87727.stex" metadata={ "vram_texture": false } [deps] -source_file="res://player/osb_fire.png" -dest_files=[ "res://.import/osb_fire.png-67a49910acd764fd7c67429af0ad5cb8.stex" ] +source_file="res://assets/art/background/cloud_1.png" +dest_files=[ "res://.import/cloud_1.png-03c0ad8be397b731df0dd38fa3c87727.stex" ] [params] diff --git a/2d/platformer/background/scroll_bg_cloud_2.png b/2d/platformer/assets/art/background/cloud_2.png similarity index 100% rename from 2d/platformer/background/scroll_bg_cloud_2.png rename to 2d/platformer/assets/art/background/cloud_2.png diff --git a/2d/platformer/player/osb_jump.png.import b/2d/platformer/assets/art/background/cloud_2.png.import similarity index 69% rename from 2d/platformer/player/osb_jump.png.import rename to 2d/platformer/assets/art/background/cloud_2.png.import index 14db95e3..7fa52aad 100644 --- a/2d/platformer/player/osb_jump.png.import +++ b/2d/platformer/assets/art/background/cloud_2.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/osb_jump.png-0d4d2b2d1a7d2c11e3e4fd800b8589ed.stex" +path="res://.import/cloud_2.png-4ddf8c5bceca4aa07a8bc86d7d788e02.stex" metadata={ "vram_texture": false } [deps] -source_file="res://player/osb_jump.png" -dest_files=[ "res://.import/osb_jump.png-0d4d2b2d1a7d2c11e3e4fd800b8589ed.stex" ] +source_file="res://assets/art/background/cloud_2.png" +dest_files=[ "res://.import/cloud_2.png-4ddf8c5bceca4aa07a8bc86d7d788e02.stex" ] [params] diff --git a/2d/platformer/background/scroll_bg_cloud_3.png b/2d/platformer/assets/art/background/cloud_3.png similarity index 100% rename from 2d/platformer/background/scroll_bg_cloud_3.png rename to 2d/platformer/assets/art/background/cloud_3.png diff --git a/2d/platformer/assets/art/background/cloud_3.png.import b/2d/platformer/assets/art/background/cloud_3.png.import new file mode 100644 index 00000000..67c7f71c --- /dev/null +++ b/2d/platformer/assets/art/background/cloud_3.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/cloud_3.png-a1b7dc71aa84bea9cb4f78f585dcc65d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/art/background/cloud_3.png" +dest_files=[ "res://.import/cloud_3.png-a1b7dc71aa84bea9cb4f78f585dcc65d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/2d/platformer/assets/art/background/distant_platforms_1.png b/2d/platformer/assets/art/background/distant_platforms_1.png new file mode 100644 index 00000000..3d78ae25 Binary files /dev/null and b/2d/platformer/assets/art/background/distant_platforms_1.png differ diff --git a/2d/platformer/background/scroll_bg_fg_2.png.import b/2d/platformer/assets/art/background/distant_platforms_1.png.import similarity index 65% rename from 2d/platformer/background/scroll_bg_fg_2.png.import rename to 2d/platformer/assets/art/background/distant_platforms_1.png.import index 1f681ad6..8abeb3a7 100644 --- a/2d/platformer/background/scroll_bg_fg_2.png.import +++ b/2d/platformer/assets/art/background/distant_platforms_1.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/scroll_bg_fg_2.png-2b54decd69e8aff2caa33640a336d1e9.stex" +path="res://.import/distant_platforms_1.png-7286fe6c8587b96abbbe0bc4a8cbc510.stex" metadata={ "vram_texture": false } [deps] -source_file="res://background/scroll_bg_fg_2.png" -dest_files=[ "res://.import/scroll_bg_fg_2.png-2b54decd69e8aff2caa33640a336d1e9.stex" ] +source_file="res://assets/art/background/distant_platforms_1.png" +dest_files=[ "res://.import/distant_platforms_1.png-7286fe6c8587b96abbbe0bc4a8cbc510.stex" ] [params] diff --git a/2d/platformer/assets/art/background/distant_platforms_2.png b/2d/platformer/assets/art/background/distant_platforms_2.png new file mode 100644 index 00000000..82d01b9f Binary files /dev/null and b/2d/platformer/assets/art/background/distant_platforms_2.png differ diff --git a/2d/platformer/background/scroll_bg_fg_1.png.import b/2d/platformer/assets/art/background/distant_platforms_2.png.import similarity index 65% rename from 2d/platformer/background/scroll_bg_fg_1.png.import rename to 2d/platformer/assets/art/background/distant_platforms_2.png.import index 08be05e9..35996cd4 100644 --- a/2d/platformer/background/scroll_bg_fg_1.png.import +++ b/2d/platformer/assets/art/background/distant_platforms_2.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/scroll_bg_fg_1.png-20c90ebded5095c6863cdf6b1b82882d.stex" +path="res://.import/distant_platforms_2.png-ba010b30987da6d74062ce964ab450ef.stex" metadata={ "vram_texture": false } [deps] -source_file="res://background/scroll_bg_fg_1.png" -dest_files=[ "res://.import/scroll_bg_fg_1.png-20c90ebded5095c6863cdf6b1b82882d.stex" ] +source_file="res://assets/art/background/distant_platforms_2.png" +dest_files=[ "res://.import/distant_platforms_2.png-ba010b30987da6d74062ce964ab450ef.stex" ] [params] diff --git a/2d/platformer/background/scroll_bg_sky.png b/2d/platformer/assets/art/background/sky.png similarity index 100% rename from 2d/platformer/background/scroll_bg_sky.png rename to 2d/platformer/assets/art/background/sky.png diff --git a/2d/platformer/assets/art/background/sky.png.import b/2d/platformer/assets/art/background/sky.png.import new file mode 100644 index 00000000..883b852b --- /dev/null +++ b/2d/platformer/assets/art/background/sky.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/sky.png-c175b712c46edc17f2b5fc55b9de3c49.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/art/background/sky.png" +dest_files=[ "res://.import/sky.png-c175b712c46edc17f2b5fc55b9de3c49.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=1 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/2d/platformer/coin/coin.png b/2d/platformer/assets/art/coin/coin.png similarity index 100% rename from 2d/platformer/coin/coin.png rename to 2d/platformer/assets/art/coin/coin.png diff --git a/2d/platformer/coin/coin.png.import b/2d/platformer/assets/art/coin/coin.png.import similarity index 71% rename from 2d/platformer/coin/coin.png.import rename to 2d/platformer/assets/art/coin/coin.png.import index d63f0ad6..6efc0524 100644 --- a/2d/platformer/coin/coin.png.import +++ b/2d/platformer/assets/art/coin/coin.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/coin.png-c9e5c2f51b2a10beb2d794afbbee004f.stex" +path="res://.import/coin.png-87689993f83db6056500d4fa153313d8.stex" metadata={ "vram_texture": false } [deps] -source_file="res://coin/coin.png" -dest_files=[ "res://.import/coin.png-c9e5c2f51b2a10beb2d794afbbee004f.stex" ] +source_file="res://assets/art/coin/coin.png" +dest_files=[ "res://.import/coin.png-87689993f83db6056500d4fa153313d8.stex" ] [params] diff --git a/2d/platformer/enemy/enemy.png b/2d/platformer/assets/art/enemy/enemy.png similarity index 100% rename from 2d/platformer/enemy/enemy.png rename to 2d/platformer/assets/art/enemy/enemy.png diff --git a/2d/platformer/enemy/enemy.png.import b/2d/platformer/assets/art/enemy/enemy.png.import similarity index 71% rename from 2d/platformer/enemy/enemy.png.import rename to 2d/platformer/assets/art/enemy/enemy.png.import index a7c3f0b9..e8eb575f 100644 --- a/2d/platformer/enemy/enemy.png.import +++ b/2d/platformer/assets/art/enemy/enemy.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/enemy.png-1891d9038eeed672a2459bc4e7db5910.stex" +path="res://.import/enemy.png-c2f48b2558d3b68a547452306041a310.stex" metadata={ "vram_texture": false } [deps] -source_file="res://enemy/enemy.png" -dest_files=[ "res://.import/enemy.png-1891d9038eeed672a2459bc4e7db5910.stex" ] +source_file="res://assets/art/enemy/enemy.png" +dest_files=[ "res://.import/enemy.png-c2f48b2558d3b68a547452306041a310.stex" ] [params] diff --git a/2d/platformer/assets/art/platforms/moving_platform.png b/2d/platformer/assets/art/platforms/moving_platform.png new file mode 100644 index 00000000..f3d7ce39 Binary files /dev/null and b/2d/platformer/assets/art/platforms/moving_platform.png differ diff --git a/2d/platformer/platform/moving_platform.png.import b/2d/platformer/assets/art/platforms/moving_platform.png.import similarity index 67% rename from 2d/platformer/platform/moving_platform.png.import rename to 2d/platformer/assets/art/platforms/moving_platform.png.import index a5175cf6..950a735e 100644 --- a/2d/platformer/platform/moving_platform.png.import +++ b/2d/platformer/assets/art/platforms/moving_platform.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/moving_platform.png-7e92061cd93e8b0235df711d3782cd8c.stex" +path="res://.import/moving_platform.png-479aa8f802d1a4964b138893ada8d372.stex" metadata={ "vram_texture": false } [deps] -source_file="res://platform/moving_platform.png" -dest_files=[ "res://.import/moving_platform.png-7e92061cd93e8b0235df711d3782cd8c.stex" ] +source_file="res://assets/art/platforms/moving_platform.png" +dest_files=[ "res://.import/moving_platform.png-479aa8f802d1a4964b138893ada8d372.stex" ] [params] diff --git a/2d/platformer/platform/one_way_platform.png b/2d/platformer/assets/art/platforms/one_way_platform.png similarity index 100% rename from 2d/platformer/platform/one_way_platform.png rename to 2d/platformer/assets/art/platforms/one_way_platform.png diff --git a/2d/platformer/platform/one_way_platform.png.import b/2d/platformer/assets/art/platforms/one_way_platform.png.import similarity index 66% rename from 2d/platformer/platform/one_way_platform.png.import rename to 2d/platformer/assets/art/platforms/one_way_platform.png.import index c71a2e0b..a9cc95bd 100644 --- a/2d/platformer/platform/one_way_platform.png.import +++ b/2d/platformer/assets/art/platforms/one_way_platform.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/one_way_platform.png-2865772e209813c1636a14aee8d019a3.stex" +path="res://.import/one_way_platform.png-aaf0179c7171228f27cb489e99e339bd.stex" metadata={ "vram_texture": false } [deps] -source_file="res://platform/one_way_platform.png" -dest_files=[ "res://.import/one_way_platform.png-2865772e209813c1636a14aee8d019a3.stex" ] +source_file="res://assets/art/platforms/one_way_platform.png" +dest_files=[ "res://.import/one_way_platform.png-aaf0179c7171228f27cb489e99e339bd.stex" ] [params] diff --git a/2d/platformer/player/bullet.png b/2d/platformer/assets/art/player/bullet/bullet.png similarity index 100% rename from 2d/platformer/player/bullet.png rename to 2d/platformer/assets/art/player/bullet/bullet.png diff --git a/2d/platformer/player/bullet.png.import b/2d/platformer/assets/art/player/bullet/bullet.png.import similarity index 70% rename from 2d/platformer/player/bullet.png.import rename to 2d/platformer/assets/art/player/bullet/bullet.png.import index fef2f363..892c6649 100644 --- a/2d/platformer/player/bullet.png.import +++ b/2d/platformer/assets/art/player/bullet/bullet.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/bullet.png-5615cb9904aab8db60fe6f48e996475f.stex" +path="res://.import/bullet.png-a148438922f3743d5615622ef8134c9f.stex" metadata={ "vram_texture": false } [deps] -source_file="res://player/bullet.png" -dest_files=[ "res://.import/bullet.png-5615cb9904aab8db60fe6f48e996475f.stex" ] +source_file="res://assets/art/player/bullet/bullet.png" +dest_files=[ "res://.import/bullet.png-a148438922f3743d5615622ef8134c9f.stex" ] [params] diff --git a/2d/platformer/player/robot_demo.png b/2d/platformer/assets/art/player/robot_demo.png similarity index 100% rename from 2d/platformer/player/robot_demo.png rename to 2d/platformer/assets/art/player/robot_demo.png diff --git a/2d/platformer/player/robot_demo.png.import b/2d/platformer/assets/art/player/robot_demo.png.import similarity index 68% rename from 2d/platformer/player/robot_demo.png.import rename to 2d/platformer/assets/art/player/robot_demo.png.import index 5b984fa0..ef857221 100644 --- a/2d/platformer/player/robot_demo.png.import +++ b/2d/platformer/assets/art/player/robot_demo.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/robot_demo.png-7165a8ae8f36b01883df6b585a93f592.stex" +path="res://.import/robot_demo.png-cd7cbcf6d0c47d4a233ea7ce93b142c2.stex" metadata={ "vram_texture": false } [deps] -source_file="res://player/robot_demo.png" -dest_files=[ "res://.import/robot_demo.png-7165a8ae8f36b01883df6b585a93f592.stex" ] +source_file="res://assets/art/player/robot_demo.png" +dest_files=[ "res://.import/robot_demo.png-cd7cbcf6d0c47d4a233ea7ce93b142c2.stex" ] [params] diff --git a/2d/platformer/assets/art/tileset/tiles_demo.png b/2d/platformer/assets/art/tileset/tiles_demo.png new file mode 100644 index 00000000..ec366881 Binary files /dev/null and b/2d/platformer/assets/art/tileset/tiles_demo.png differ diff --git a/2d/platformer/tiles_demo.png.import b/2d/platformer/assets/art/tileset/tiles_demo.png.import similarity index 68% rename from 2d/platformer/tiles_demo.png.import rename to 2d/platformer/assets/art/tileset/tiles_demo.png.import index 9c560d55..690a20c4 100644 --- a/2d/platformer/tiles_demo.png.import +++ b/2d/platformer/assets/art/tileset/tiles_demo.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/tiles_demo.png-7ca5c7c5c02ab8abe0d585a6a8f086bd.stex" +path="res://.import/tiles_demo.png-f720a7de2b60b01f690cfa3cb881996b.stex" metadata={ "vram_texture": false } [deps] -source_file="res://tiles_demo.png" -dest_files=[ "res://.import/tiles_demo.png-7ca5c7c5c02ab8abe0d585a6a8f086bd.stex" ] +source_file="res://assets/art/tileset/tiles_demo.png" +dest_files=[ "res://.import/tiles_demo.png-f720a7de2b60b01f690cfa3cb881996b.stex" ] [params] diff --git a/2d/platformer/assets/art/tileset/tileset.tres b/2d/platformer/assets/art/tileset/tileset.tres new file mode 100644 index 00000000..e96c2c78 --- /dev/null +++ b/2d/platformer/assets/art/tileset/tileset.tres @@ -0,0 +1,263 @@ +[gd_resource type="TileSet" load_steps=14 format=2] + +[ext_resource path="res://assets/art/tileset/tiles_demo.png" type="Texture" id=1] + +[sub_resource type="ConvexPolygonShape2D" id=1] +points = PoolVector2Array( 0, 12, 64, 12, 64, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=2] +points = PoolVector2Array( 0, 12, 56, 12, 56, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=3] +points = PoolVector2Array( 0, 0, 64, 0, 64, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=4] +points = PoolVector2Array( 0, 12, 64, 12, 64, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=5] +points = PoolVector2Array( 64, 76, 64, 128, 0, 128, 0, 12 ) + +[sub_resource type="ConvexPolygonShape2D" id=6] +points = PoolVector2Array( 0, 0, 56, 0, 56, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=7] +points = PoolVector2Array( 56, 12, 64, 12, 64, 64, 0, 64, 0, 0, 56, 0 ) + +[sub_resource type="ConvexPolygonShape2D" id=8] +points = PoolVector2Array( 0, 12, 64, 12, 64, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=9] +points = PoolVector2Array( 0, 12, 56, 12, 56, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=10] +points = PoolVector2Array( 0, 0, 64, 0, 64, 64, 0, 64 ) + +[sub_resource type="ConvexPolygonShape2D" id=11] +points = PoolVector2Array( 0, 0, 64, 0, 64, 48, 0, 48 ) + +[sub_resource type="ConvexPolygonShape2D" id=12] +points = PoolVector2Array( 0, 0, 56, 0, 56, 48, 0, 48 ) + +[resource] +0/name = "ground" +0/texture = ExtResource( 1 ) +0/tex_offset = Vector2( 0, 0 ) +0/modulate = Color( 1, 1, 1, 1 ) +0/region = Rect2( 0, 0, 64, 64 ) +0/tile_mode = 0 +0/occluder_offset = Vector2( 0, 0 ) +0/navigation_offset = Vector2( 0, 0 ) +0/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 1 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +0/z_index = 0 +1/name = "ground_end" +1/texture = ExtResource( 1 ) +1/tex_offset = Vector2( 0, 0 ) +1/modulate = Color( 1, 1, 1, 1 ) +1/region = Rect2( 64, 0, 64, 64 ) +1/tile_mode = 0 +1/occluder_offset = Vector2( 0, 0 ) +1/navigation_offset = Vector2( 0, 0 ) +1/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 2 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +1/z_index = 0 +2/name = "slope" +2/texture = ExtResource( 1 ) +2/tex_offset = Vector2( 0, 0 ) +2/modulate = Color( 1, 1, 1, 1 ) +2/region = Rect2( 128, 128, 64, 128 ) +2/tile_mode = 0 +2/occluder_offset = Vector2( 0, 0 ) +2/navigation_offset = Vector2( 0, 0 ) +2/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 5 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +2/z_index = 0 +3/name = "wall" +3/texture = ExtResource( 1 ) +3/tex_offset = Vector2( 0, 0 ) +3/modulate = Color( 1, 1, 1, 1 ) +3/region = Rect2( 64, 64, 64, 64 ) +3/tile_mode = 0 +3/occluder_offset = Vector2( 0, 0 ) +3/navigation_offset = Vector2( 0, 0 ) +3/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 6 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +3/z_index = 0 +4/name = "slope_top" +4/texture = ExtResource( 1 ) +4/tex_offset = Vector2( 0, 0 ) +4/modulate = Color( 1, 1, 1, 1 ) +4/region = Rect2( 64, 128, 64, 64 ) +4/tile_mode = 0 +4/occluder_offset = Vector2( 0, 0 ) +4/navigation_offset = Vector2( 0, 0 ) +4/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 7 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +4/z_index = 0 +5/name = "one_way" +5/texture = ExtResource( 1 ) +5/tex_offset = Vector2( 0, 0 ) +5/modulate = Color( 1, 1, 1, 1 ) +5/region = Rect2( 128, 0, 64, 64 ) +5/tile_mode = 0 +5/occluder_offset = Vector2( 0, 0 ) +5/navigation_offset = Vector2( 0, 0 ) +5/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": true, +"one_way_margin": 1.0, +"shape": SubResource( 8 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +5/z_index = 0 +6/name = "one_way_end" +6/texture = ExtResource( 1 ) +6/tex_offset = Vector2( 0, 0 ) +6/modulate = Color( 1, 1, 1, 1 ) +6/region = Rect2( 192, 0, 64, 64 ) +6/tile_mode = 0 +6/occluder_offset = Vector2( 0, 0 ) +6/navigation_offset = Vector2( 0, 0 ) +6/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": true, +"one_way_margin": 1.0, +"shape": SubResource( 9 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +6/z_index = 0 +7/name = "rock" +7/texture = ExtResource( 1 ) +7/tex_offset = Vector2( 0, 0 ) +7/modulate = Color( 1, 1, 1, 1 ) +7/region = Rect2( 0, 64, 64, 64 ) +7/tile_mode = 0 +7/occluder_offset = Vector2( 0, 0 ) +7/navigation_offset = Vector2( 0, 0 ) +7/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 10 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +7/z_index = 0 +8/name = "bottom" +8/texture = ExtResource( 1 ) +8/tex_offset = Vector2( 0, 0 ) +8/modulate = Color( 1, 1, 1, 1 ) +8/region = Rect2( 384, 64, 64, 64 ) +8/tile_mode = 0 +8/occluder_offset = Vector2( 0, 0 ) +8/navigation_offset = Vector2( 0, 0 ) +8/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 11 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +8/z_index = 0 +9/name = "bottom_end" +9/texture = ExtResource( 1 ) +9/tex_offset = Vector2( 0, 0 ) +9/modulate = Color( 1, 1, 1, 1 ) +9/region = Rect2( 448, 64, 64, 64 ) +9/tile_mode = 0 +9/occluder_offset = Vector2( 0, 0 ) +9/navigation_offset = Vector2( 0, 0 ) +9/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 12 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +9/z_index = 0 +10/name = "bottom_corner" +10/texture = ExtResource( 1 ) +10/tex_offset = Vector2( 0, 0 ) +10/modulate = Color( 1, 1, 1, 1 ) +10/region = Rect2( 320, 64, 64, 64 ) +10/tile_mode = 0 +10/occluder_offset = Vector2( 0, 0 ) +10/navigation_offset = Vector2( 0, 0 ) +10/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 3 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +10/z_index = 0 +11/name = "tree_trunk_0" +11/texture = ExtResource( 1 ) +11/tex_offset = Vector2( 0, 0 ) +11/modulate = Color( 1, 1, 1, 1 ) +11/region = Rect2( 256, 128, 64, 64 ) +11/tile_mode = 0 +11/occluder_offset = Vector2( 0, 0 ) +11/navigation_offset = Vector2( 0, 0 ) +11/shapes = [ ] +11/z_index = 0 +12/name = "tree_trunk_1" +12/texture = ExtResource( 1 ) +12/tex_offset = Vector2( 0, 0 ) +12/modulate = Color( 1, 1, 1, 1 ) +12/region = Rect2( 256, 64, 64, 64 ) +12/tile_mode = 0 +12/occluder_offset = Vector2( 0, 0 ) +12/navigation_offset = Vector2( 0, 0 ) +12/shapes = [ ] +12/z_index = 0 +13/name = "tree_base" +13/texture = ExtResource( 1 ) +13/tex_offset = Vector2( 0, 0 ) +13/modulate = Color( 1, 1, 1, 1 ) +13/region = Rect2( 256, 192, 64, 64 ) +13/tile_mode = 0 +13/occluder_offset = Vector2( 0, 0 ) +13/navigation_offset = Vector2( 0, 0 ) +13/shapes = [ { +"autotile_coord": Vector2( 0, 0 ), +"one_way": false, +"one_way_margin": 1.0, +"shape": SubResource( 4 ), +"shape_transform": Transform2D( 1, 0, 0, 1, 0, 0 ) +} ] +13/z_index = 0 +14/name = "tree_top" +14/texture = ExtResource( 1 ) +14/tex_offset = Vector2( 0, 0 ) +14/modulate = Color( 1, 1, 1, 1 ) +14/region = Rect2( 256, 0, 64, 64 ) +14/tile_mode = 0 +14/occluder_offset = Vector2( 0, 0 ) +14/navigation_offset = Vector2( 0, 0 ) +14/shapes = [ ] +14/z_index = 0 diff --git a/2d/platformer/player/osb_fire.png b/2d/platformer/assets/art/ui/touch_button_fire.png similarity index 100% rename from 2d/platformer/player/osb_fire.png rename to 2d/platformer/assets/art/ui/touch_button_fire.png diff --git a/2d/platformer/background/scroll_bg_cloud_1.png.import b/2d/platformer/assets/art/ui/touch_button_fire.png.import similarity index 67% rename from 2d/platformer/background/scroll_bg_cloud_1.png.import rename to 2d/platformer/assets/art/ui/touch_button_fire.png.import index e61037bb..b1faa251 100644 --- a/2d/platformer/background/scroll_bg_cloud_1.png.import +++ b/2d/platformer/assets/art/ui/touch_button_fire.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/scroll_bg_cloud_1.png-19f55c25a7e1985c92542faa0106888e.stex" +path="res://.import/touch_button_fire.png-8b72c42a8cb252207ce8948d4b623690.stex" metadata={ "vram_texture": false } [deps] -source_file="res://background/scroll_bg_cloud_1.png" -dest_files=[ "res://.import/scroll_bg_cloud_1.png-19f55c25a7e1985c92542faa0106888e.stex" ] +source_file="res://assets/art/ui/touch_button_fire.png" +dest_files=[ "res://.import/touch_button_fire.png-8b72c42a8cb252207ce8948d4b623690.stex" ] [params] diff --git a/2d/platformer/player/osb_jump.png b/2d/platformer/assets/art/ui/touch_button_jump.png similarity index 100% rename from 2d/platformer/player/osb_jump.png rename to 2d/platformer/assets/art/ui/touch_button_jump.png diff --git a/2d/platformer/background/scroll_bg_cloud_2.png.import b/2d/platformer/assets/art/ui/touch_button_jump.png.import similarity index 67% rename from 2d/platformer/background/scroll_bg_cloud_2.png.import rename to 2d/platformer/assets/art/ui/touch_button_jump.png.import index 5bd93491..cd9d6659 100644 --- a/2d/platformer/background/scroll_bg_cloud_2.png.import +++ b/2d/platformer/assets/art/ui/touch_button_jump.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/scroll_bg_cloud_2.png-869806dcc546591f3d754e3b845c61c9.stex" +path="res://.import/touch_button_jump.png-f72afeb370538aa951853dbc52052250.stex" metadata={ "vram_texture": false } [deps] -source_file="res://background/scroll_bg_cloud_2.png" -dest_files=[ "res://.import/scroll_bg_cloud_2.png-869806dcc546591f3d754e3b845c61c9.stex" ] +source_file="res://assets/art/ui/touch_button_jump.png" +dest_files=[ "res://.import/touch_button_jump.png-f72afeb370538aa951853dbc52052250.stex" ] [params] diff --git a/2d/platformer/player/osb_left.png b/2d/platformer/assets/art/ui/touch_button_left.png similarity index 100% rename from 2d/platformer/player/osb_left.png rename to 2d/platformer/assets/art/ui/touch_button_left.png diff --git a/2d/platformer/background/scroll_bg_cloud_3.png.import b/2d/platformer/assets/art/ui/touch_button_left.png.import similarity index 67% rename from 2d/platformer/background/scroll_bg_cloud_3.png.import rename to 2d/platformer/assets/art/ui/touch_button_left.png.import index 2316fd85..720a79db 100644 --- a/2d/platformer/background/scroll_bg_cloud_3.png.import +++ b/2d/platformer/assets/art/ui/touch_button_left.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/scroll_bg_cloud_3.png-831c6ed9fa8b4070081428a936bcc2f7.stex" +path="res://.import/touch_button_left.png-e48f16cfdaae98fdc92a21f20c157c53.stex" metadata={ "vram_texture": false } [deps] -source_file="res://background/scroll_bg_cloud_3.png" -dest_files=[ "res://.import/scroll_bg_cloud_3.png-831c6ed9fa8b4070081428a936bcc2f7.stex" ] +source_file="res://assets/art/ui/touch_button_left.png" +dest_files=[ "res://.import/touch_button_left.png-e48f16cfdaae98fdc92a21f20c157c53.stex" ] [params] diff --git a/2d/platformer/player/osb_right.png b/2d/platformer/assets/art/ui/touch_button_right.png similarity index 100% rename from 2d/platformer/player/osb_right.png rename to 2d/platformer/assets/art/ui/touch_button_right.png diff --git a/2d/platformer/background/scroll_bg_sky.png.import b/2d/platformer/assets/art/ui/touch_button_right.png.import similarity index 66% rename from 2d/platformer/background/scroll_bg_sky.png.import rename to 2d/platformer/assets/art/ui/touch_button_right.png.import index 024a110a..157b3001 100644 --- a/2d/platformer/background/scroll_bg_sky.png.import +++ b/2d/platformer/assets/art/ui/touch_button_right.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/scroll_bg_sky.png-377ea542199b2e23d7a822ed940ea99e.stex" +path="res://.import/touch_button_right.png-74bf87a3a0fa663fbb3574844de31372.stex" metadata={ "vram_texture": false } [deps] -source_file="res://background/scroll_bg_sky.png" -dest_files=[ "res://.import/scroll_bg_sky.png-377ea542199b2e23d7a822ed940ea99e.stex" ] +source_file="res://assets/art/ui/touch_button_right.png" +dest_files=[ "res://.import/touch_button_right.png-74bf87a3a0fa663fbb3574844de31372.stex" ] [params] diff --git a/2d/platformer/audio/music.ogg b/2d/platformer/assets/audio/music/music.ogg similarity index 100% rename from 2d/platformer/audio/music.ogg rename to 2d/platformer/assets/audio/music/music.ogg diff --git a/2d/platformer/assets/audio/music/music.ogg.import b/2d/platformer/assets/audio/music/music.ogg.import new file mode 100644 index 00000000..3d232d94 --- /dev/null +++ b/2d/platformer/assets/audio/music/music.ogg.import @@ -0,0 +1,15 @@ +[remap] + +importer="ogg_vorbis" +type="AudioStreamOGGVorbis" +path="res://.import/music.ogg-e27216112531ea490cdad574860a53a5.oggstr" + +[deps] + +source_file="res://assets/audio/music/music.ogg" +dest_files=[ "res://.import/music.ogg-e27216112531ea490cdad574860a53a5.oggstr" ] + +[params] + +loop=true +loop_offset=0 diff --git a/2d/platformer/audio/sound_coin.wav b/2d/platformer/assets/audio/sfx/coin_pickup.wav similarity index 100% rename from 2d/platformer/audio/sound_coin.wav rename to 2d/platformer/assets/audio/sfx/coin_pickup.wav diff --git a/2d/platformer/assets/audio/sfx/coin_pickup.wav.import b/2d/platformer/assets/audio/sfx/coin_pickup.wav.import new file mode 100644 index 00000000..63842c36 --- /dev/null +++ b/2d/platformer/assets/audio/sfx/coin_pickup.wav.import @@ -0,0 +1,21 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +path="res://.import/coin_pickup.wav-69d455f3063e30fd994846647c281aea.sample" + +[deps] + +source_file="res://assets/audio/sfx/coin_pickup.wav" +dest_files=[ "res://.import/coin_pickup.wav-69d455f3063e30fd994846647c281aea.sample" ] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=true +edit/normalize=true +edit/loop=false +compress/mode=0 diff --git a/2d/platformer/audio/sound_explode.wav b/2d/platformer/assets/audio/sfx/explode.wav similarity index 100% rename from 2d/platformer/audio/sound_explode.wav rename to 2d/platformer/assets/audio/sfx/explode.wav diff --git a/2d/platformer/audio/sound_shoot.wav.import b/2d/platformer/assets/audio/sfx/explode.wav.import similarity index 51% rename from 2d/platformer/audio/sound_shoot.wav.import rename to 2d/platformer/assets/audio/sfx/explode.wav.import index 34d93e79..34d82393 100644 --- a/2d/platformer/audio/sound_shoot.wav.import +++ b/2d/platformer/assets/audio/sfx/explode.wav.import @@ -2,12 +2,12 @@ importer="wav" type="AudioStreamSample" -path="res://.import/sound_shoot.wav-a37772efd1dbcd76c4fe35742f502bb7.sample" +path="res://.import/explode.wav-302a3de6d016432bf47477d337a4d553.sample" [deps] -source_file="res://audio/sound_shoot.wav" -dest_files=[ "res://.import/sound_shoot.wav-a37772efd1dbcd76c4fe35742f502bb7.sample" ] +source_file="res://assets/audio/sfx/explode.wav" +dest_files=[ "res://.import/explode.wav-302a3de6d016432bf47477d337a4d553.sample" ] [params] diff --git a/2d/platformer/audio/sound_hit.wav b/2d/platformer/assets/audio/sfx/hit.wav similarity index 100% rename from 2d/platformer/audio/sound_hit.wav rename to 2d/platformer/assets/audio/sfx/hit.wav diff --git a/2d/platformer/audio/sound_hit.wav.import b/2d/platformer/assets/audio/sfx/hit.wav.import similarity index 51% rename from 2d/platformer/audio/sound_hit.wav.import rename to 2d/platformer/assets/audio/sfx/hit.wav.import index cd0f653d..d40ca4f8 100644 --- a/2d/platformer/audio/sound_hit.wav.import +++ b/2d/platformer/assets/audio/sfx/hit.wav.import @@ -2,12 +2,12 @@ importer="wav" type="AudioStreamSample" -path="res://.import/sound_hit.wav-6c98c4eeb2c6ac3fc45dc4a7ebd8602f.sample" +path="res://.import/hit.wav-27e178036f6cee6545e9f025a3865a36.sample" [deps] -source_file="res://audio/sound_hit.wav" -dest_files=[ "res://.import/sound_hit.wav-6c98c4eeb2c6ac3fc45dc4a7ebd8602f.sample" ] +source_file="res://assets/audio/sfx/hit.wav" +dest_files=[ "res://.import/hit.wav-27e178036f6cee6545e9f025a3865a36.sample" ] [params] diff --git a/2d/platformer/audio/sound_jump.wav b/2d/platformer/assets/audio/sfx/jump.wav similarity index 100% rename from 2d/platformer/audio/sound_jump.wav rename to 2d/platformer/assets/audio/sfx/jump.wav diff --git a/2d/platformer/audio/sound_coin.wav.import b/2d/platformer/assets/audio/sfx/jump.wav.import similarity index 51% rename from 2d/platformer/audio/sound_coin.wav.import rename to 2d/platformer/assets/audio/sfx/jump.wav.import index 02be70ac..16d60015 100644 --- a/2d/platformer/audio/sound_coin.wav.import +++ b/2d/platformer/assets/audio/sfx/jump.wav.import @@ -2,12 +2,12 @@ importer="wav" type="AudioStreamSample" -path="res://.import/sound_coin.wav-e18cceeba8b7dc02bbb940b85bcad99a.sample" +path="res://.import/jump.wav-127418ac4fc0b61a7fed0684053202c7.sample" [deps] -source_file="res://audio/sound_coin.wav" -dest_files=[ "res://.import/sound_coin.wav-e18cceeba8b7dc02bbb940b85bcad99a.sample" ] +source_file="res://assets/audio/sfx/jump.wav" +dest_files=[ "res://.import/jump.wav-127418ac4fc0b61a7fed0684053202c7.sample" ] [params] diff --git a/2d/platformer/audio/sound_shoot.wav b/2d/platformer/assets/audio/sfx/shoot.wav similarity index 100% rename from 2d/platformer/audio/sound_shoot.wav rename to 2d/platformer/assets/audio/sfx/shoot.wav diff --git a/2d/platformer/audio/sound_jump.wav.import b/2d/platformer/assets/audio/sfx/shoot.wav.import similarity index 51% rename from 2d/platformer/audio/sound_jump.wav.import rename to 2d/platformer/assets/audio/sfx/shoot.wav.import index b0bb11e8..8a0eeb65 100644 --- a/2d/platformer/audio/sound_jump.wav.import +++ b/2d/platformer/assets/audio/sfx/shoot.wav.import @@ -2,12 +2,12 @@ importer="wav" type="AudioStreamSample" -path="res://.import/sound_jump.wav-7e05b84e4426c7461dd15838765e210b.sample" +path="res://.import/shoot.wav-f3ce9b4ae60220ecd3cf78df7278a10f.sample" [deps] -source_file="res://audio/sound_jump.wav" -dest_files=[ "res://.import/sound_jump.wav-7e05b84e4426c7461dd15838765e210b.sample" ] +source_file="res://assets/audio/sfx/shoot.wav" +dest_files=[ "res://.import/shoot.wav-f3ce9b4ae60220ecd3cf78df7278a10f.sample" ] [params] diff --git a/2d/platformer/assets/theme/fonts/kenney_mini_square.ttf b/2d/platformer/assets/theme/fonts/kenney_mini_square.ttf new file mode 100644 index 00000000..5f2c5bb0 Binary files /dev/null and b/2d/platformer/assets/theme/fonts/kenney_mini_square.ttf differ diff --git a/2d/platformer/assets/theme/user_interface.tres b/2d/platformer/assets/theme/user_interface.tres new file mode 100644 index 00000000..86de2dc0 --- /dev/null +++ b/2d/platformer/assets/theme/user_interface.tres @@ -0,0 +1,82 @@ +[gd_resource type="Theme" load_steps=8 format=2] + +[ext_resource path="res://assets/theme/fonts/kenney_mini_square.ttf" type="DynamicFontData" id=1] + +[sub_resource type="StyleBoxFlat" id=1] +content_margin_left = 6.0 +content_margin_right = 6.0 +content_margin_top = 4.0 +content_margin_bottom = 4.0 +bg_color = Color( 0.18, 0.207, 0.279, 1 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 0.14, 0.161, 0.217, 1 ) + +[sub_resource type="StyleBoxFlat" id=2] +content_margin_left = 6.0 +content_margin_right = 6.0 +content_margin_top = 4.0 +content_margin_bottom = 4.0 +bg_color = Color( 0.15, 0.1725, 0.2325, 1 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 0.41, 0.61, 0.91, 1 ) + +[sub_resource type="StyleBoxFlat" id=3] +content_margin_left = 6.0 +content_margin_right = 6.0 +content_margin_top = 4.0 +content_margin_bottom = 4.0 +bg_color = Color( 0.15, 0.1725, 0.2325, 1 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 0.4, 0.4225, 0.4825, 1 ) + +[sub_resource type="StyleBoxFlat" id=4] +content_margin_left = 6.0 +content_margin_right = 6.0 +content_margin_top = 4.0 +content_margin_bottom = 4.0 +bg_color = Color( 0.15, 0.1725, 0.2325, 1 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 0.125, 0.14375, 0.19375, 1 ) + +[sub_resource type="StyleBoxFlat" id=5] +content_margin_left = 6.0 +content_margin_right = 6.0 +content_margin_top = 4.0 +content_margin_bottom = 4.0 +bg_color = Color( 0.15, 0.1725, 0.2325, 1 ) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color( 0.41, 0.61, 0.91, 1 ) + +[sub_resource type="DynamicFont" id=6] +font_data = ExtResource( 1 ) + +[resource] +default_font = SubResource( 6 ) +Button/colors/font_color = Color( 0.8, 0.8075, 0.8275, 1 ) +Button/colors/font_color_disabled = Color( 1, 1, 1, 0.3 ) +Button/colors/font_color_hover = Color( 0.88, 0.8845, 0.8965, 1 ) +Button/colors/font_color_pressed = Color( 0.41, 0.61, 0.91, 1 ) +Button/colors/icon_color_hover = Color( 1.15, 1.15, 1.15, 1 ) +Button/colors/icon_color_pressed = Color( 0.4715, 0.7015, 1.0465, 1 ) +Button/constants/hseparation = 2 +Button/fonts/font = null +Button/styles/disabled = SubResource( 1 ) +Button/styles/focus = SubResource( 2 ) +Button/styles/hover = SubResource( 3 ) +Button/styles/normal = SubResource( 4 ) +Button/styles/pressed = SubResource( 5 ) diff --git a/2d/platformer/audio/music.ogg.import b/2d/platformer/audio/music.ogg.import deleted file mode 100644 index 0a99e952..00000000 --- a/2d/platformer/audio/music.ogg.import +++ /dev/null @@ -1,15 +0,0 @@ -[remap] - -importer="ogg_vorbis" -type="AudioStreamOGGVorbis" -path="res://.import/music.ogg-552a37c4bfe46d894cb8004cf1c345ad.oggstr" - -[deps] - -source_file="res://audio/music.ogg" -dest_files=[ "res://.import/music.ogg-552a37c4bfe46d894cb8004cf1c345ad.oggstr" ] - -[params] - -loop=true -loop_offset=0 diff --git a/2d/platformer/audio/sound_explode.wav.import b/2d/platformer/audio/sound_explode.wav.import deleted file mode 100644 index 52a56ab9..00000000 --- a/2d/platformer/audio/sound_explode.wav.import +++ /dev/null @@ -1,21 +0,0 @@ -[remap] - -importer="wav" -type="AudioStreamSample" -path="res://.import/sound_explode.wav-536668d880bfb277b9e5253774598e9e.sample" - -[deps] - -source_file="res://audio/sound_explode.wav" -dest_files=[ "res://.import/sound_explode.wav-536668d880bfb277b9e5253774598e9e.sample" ] - -[params] - -force/8_bit=false -force/mono=false -force/max_rate=false -force/max_rate_hz=44100 -edit/trim=true -edit/normalize=true -edit/loop=false -compress/mode=0 diff --git a/2d/platformer/background/ParallaxBg.tscn b/2d/platformer/background/ParallaxBg.tscn deleted file mode 100644 index 8d1c7256..00000000 --- a/2d/platformer/background/ParallaxBg.tscn +++ /dev/null @@ -1,71 +0,0 @@ -[gd_scene load_steps=7 format=2] - -[ext_resource path="res://background/scroll_bg_sky.png" type="Texture" id=1] -[ext_resource path="res://background/scroll_bg_cloud_1.png" type="Texture" id=2] -[ext_resource path="res://background/scroll_bg_cloud_2.png" type="Texture" id=3] -[ext_resource path="res://background/scroll_bg_cloud_3.png" type="Texture" id=4] -[ext_resource path="res://background/scroll_bg_fg_2.png" type="Texture" id=5] -[ext_resource path="res://background/scroll_bg_fg_1.png" type="Texture" id=6] - -[node name="ParallaxBg" type="ParallaxBackground"] -scroll_base_scale = Vector2( 0.7, 0 ) - -[node name="Sky" type="ParallaxLayer" parent="."] -motion_mirroring = Vector2( 800, 0 ) - -[node name="Sprite" type="Sprite" parent="Sky"] -scale = Vector2( 128, 0.94 ) -texture = ExtResource( 1 ) -centered = false - -[node name="Clouds" type="ParallaxLayer" parent="."] -motion_scale = Vector2( 0.1, 1 ) -motion_mirroring = Vector2( 800, 0 ) - -[node name="Sprite1" type="Sprite" parent="Clouds"] -position = Vector2( 28, 127 ) -texture = ExtResource( 2 ) -centered = false - -[node name="Sprite2" type="Sprite" parent="Clouds"] -position = Vector2( 404, 24 ) -texture = ExtResource( 2 ) -centered = false - -[node name="Sprite3" type="Sprite" parent="Clouds"] -position = Vector2( 154, 46 ) -texture = ExtResource( 3 ) -centered = false - -[node name="Sprite4" type="Sprite" parent="Clouds"] -position = Vector2( 525, 130 ) -texture = ExtResource( 3 ) -centered = false - -[node name="Sprite5" type="Sprite" parent="Clouds"] -position = Vector2( 255, 158 ) -texture = ExtResource( 4 ) -centered = false - -[node name="Sprite6" type="Sprite" parent="Clouds"] -position = Vector2( 674, 70 ) -texture = ExtResource( 4 ) -centered = false - -[node name="Mount2" type="ParallaxLayer" parent="."] -motion_scale = Vector2( 0.2, 1 ) - -[node name="Sprite" type="Sprite" parent="Mount2"] -position = Vector2( 0, 353 ) -texture = ExtResource( 5 ) -region_enabled = true -region_rect = Rect2( 0, 0, 4096, 256 ) - -[node name="Mount1" type="ParallaxLayer" parent="."] -motion_scale = Vector2( 0.4, 1 ) - -[node name="Sprite" type="Sprite" parent="Mount1"] -position = Vector2( 0, 353 ) -texture = ExtResource( 6 ) -region_enabled = true -region_rect = Rect2( 0, 0, 4096, 256 ) diff --git a/2d/platformer/background/scroll_bg_fg_1.png b/2d/platformer/background/scroll_bg_fg_1.png deleted file mode 100644 index 4c8e192c..00000000 Binary files a/2d/platformer/background/scroll_bg_fg_1.png and /dev/null differ diff --git a/2d/platformer/background/scroll_bg_fg_2.png b/2d/platformer/background/scroll_bg_fg_2.png deleted file mode 100644 index d1e7480f..00000000 Binary files a/2d/platformer/background/scroll_bg_fg_2.png and /dev/null differ diff --git a/2d/platformer/coin/Coin.tscn b/2d/platformer/coin/Coin.tscn deleted file mode 100644 index 38d4a977..00000000 --- a/2d/platformer/coin/Coin.tscn +++ /dev/null @@ -1,140 +0,0 @@ -[gd_scene load_steps=11 format=2] - -[ext_resource path="res://coin/coin.gd" type="Script" id=1] -[ext_resource path="res://coin/coin.png" type="Texture" id=2] -[ext_resource path="res://audio/sound_coin.wav" type="AudioStream" id=3] -[ext_resource path="res://player/bullet.png" type="Texture" id=4] - -[sub_resource type="Animation" id=1] -resource_name = "spin" -length = 1.5 -loop = true -step = 0.25 -tracks/0/type = "value" -tracks/0/path = NodePath("Sprite:frame") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ), -"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), -"update": 1, -"values": [ 0, 1, 2, 3, 2, 1, 0 ] -} - -[sub_resource type="Animation" id=2] -length = 8.0 -step = 0.0 -tracks/0/type = "value" -tracks/0/path = NodePath("Sprite:frame") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0 ), -"transitions": PoolRealArray( 1 ), -"update": 0, -"values": [ 0 ] -} -tracks/1/type = "method" -tracks/1/path = NodePath(".") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/keys = { -"times": PoolRealArray( 2.7 ), -"transitions": PoolRealArray( 1 ), -"values": [ { -"args": [ ], -"method": "queue_free" -} ] -} -tracks/2/type = "value" -tracks/2/path = NodePath("Particles:emitting") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { -"times": PoolRealArray( 0, 0.98 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 1, -"values": [ true, false ] -} -tracks/3/type = "value" -tracks/3/path = NodePath("Sprite:self_modulate") -tracks/3/interp = 1 -tracks/3/loop_wrap = true -tracks/3/imported = false -tracks/3/enabled = true -tracks/3/keys = { -"times": PoolRealArray( 0, 0.33 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] -} -tracks/4/type = "value" -tracks/4/path = NodePath("Sound:playing") -tracks/4/interp = 1 -tracks/4/loop_wrap = true -tracks/4/imported = false -tracks/4/enabled = true -tracks/4/keys = { -"times": PoolRealArray( 0.01 ), -"transitions": PoolRealArray( 1 ), -"update": 1, -"values": [ true ] -} - -[sub_resource type="CircleShape2D" id=3] - -[sub_resource type="CanvasItemMaterial" id=4] -blend_mode = 1 - -[sub_resource type="GradientTexture" id=5] - -[sub_resource type="ParticlesMaterial" id=6] -emission_shape = 1 -emission_sphere_radius = 10.0 -flag_disable_z = true -gravity = Vector3( 0, 90, 0 ) -initial_velocity = 121.98 -angular_velocity = -2.49891e+38 -orbit_velocity = 0.0 -orbit_velocity_random = 0.0 -scale = 0.2 -color_ramp = SubResource( 5 ) - -[node name="Coin" type="Area2D"] -script = ExtResource( 1 ) - -[node name="Sprite" type="Sprite" parent="."] -texture = ExtResource( 2 ) -hframes = 4 - -[node name="Anim" type="AnimationPlayer" parent="."] -autoplay = "spin" -anims/spin = SubResource( 1 ) -anims/taken = SubResource( 2 ) - -[node name="Collision" type="CollisionShape2D" parent="."] -shape = SubResource( 3 ) - -[node name="Sound" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource( 3 ) - -[node name="Particles" type="Particles2D" parent="."] -material = SubResource( 4 ) -emitting = false -lifetime = 2.0 -explosiveness = 1.0 -process_material = SubResource( 6 ) -texture = ExtResource( 4 ) - -[node name="Enabler" type="VisibilityEnabler2D" parent="."] -pause_particles = false - -[connection signal="body_entered" from="." to="." method="_on_coin_body_enter"] diff --git a/2d/platformer/coin/coin.gd b/2d/platformer/coin/coin.gd deleted file mode 100644 index 0c929a33..00000000 --- a/2d/platformer/coin/coin.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends Area2D - -class_name Coin - - -var taken = false - -func _on_coin_body_enter(body): - if not taken and body is Player: - ($Anim as AnimationPlayer).play("taken") - taken = true diff --git a/2d/platformer/enemy/enemy.gd b/2d/platformer/enemy/enemy.gd deleted file mode 100644 index 05d2916d..00000000 --- a/2d/platformer/enemy/enemy.gd +++ /dev/null @@ -1,50 +0,0 @@ -extends KinematicBody2D - -class_name Enemy - - -const GRAVITY_VEC = Vector2(0, 900) -const FLOOR_NORMAL = Vector2(0, -1) - -const STATE_WALKING = 0 -const STATE_KILLED = 1 -const WALK_SPEED = 70 - -var linear_velocity = Vector2() -var direction = -1 -var anim = "" - -# state machine -var state = STATE_WALKING - -onready var DetectFloorLeft = $DetectFloorLeft -onready var DetectWallLeft = $DetectWallLeft -onready var DetectFloorRight = $DetectFloorRight -onready var DetectWallRight = $DetectWallRight -onready var sprite = $Sprite - -func _physics_process(delta): - var new_anim = "idle" - - if state == STATE_WALKING: - linear_velocity += GRAVITY_VEC * delta - linear_velocity.x = direction * WALK_SPEED - linear_velocity = move_and_slide(linear_velocity, FLOOR_NORMAL) - - if not DetectFloorLeft.is_colliding() or DetectWallLeft.is_colliding(): - direction = 1.0 - - if not DetectFloorRight.is_colliding() or DetectWallRight.is_colliding(): - direction = -1.0 - - sprite.scale = Vector2(direction, 1.0) - new_anim = "walk" - else: - new_anim = "explode" - - if anim != new_anim: - anim = new_anim - ($Anim as AnimationPlayer).play(anim) - -func hit_by_bullet(): - state = STATE_KILLED diff --git a/2d/platformer/platform/MovingPlatform.tscn b/2d/platformer/platform/MovingPlatform.tscn deleted file mode 100644 index 55ecf8b7..00000000 --- a/2d/platformer/platform/MovingPlatform.tscn +++ /dev/null @@ -1,16 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://platform/moving_platform.gd" type="Script" id=1] -[ext_resource path="res://platform/moving_platform.png" type="Texture" id=2] - -[node name="MovingPlatform" type="Node2D"] -script = ExtResource( 1 ) - -[node name="Platform" type="KinematicBody2D" parent="."] - -[node name="Sprite" type="Sprite" parent="Platform"] -texture = ExtResource( 2 ) - -[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Platform"] -polygon = PoolVector2Array( -88, -24, 88, -24, 88, 24, -88, 24 ) - diff --git a/2d/platformer/platform/OneWayPlatform.tscn b/2d/platformer/platform/OneWayPlatform.tscn deleted file mode 100644 index 268d3671..00000000 --- a/2d/platformer/platform/OneWayPlatform.tscn +++ /dev/null @@ -1,17 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://platform/one_way_platform.png" type="Texture" id=1] - -[sub_resource type="RectangleShape2D" id=1] -extents = Vector2( 100, 10 ) - -[node name="OneWayPlatform" type="StaticBody2D"] - -[node name="Sprite" type="Sprite" parent="."] -texture = ExtResource( 1 ) - -[node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 1.46304, -13.1672 ) -shape = SubResource( 1 ) -one_way_collision = true - diff --git a/2d/platformer/platform/moving_platform.gd b/2d/platformer/platform/moving_platform.gd deleted file mode 100644 index efc0adc2..00000000 --- a/2d/platformer/platform/moving_platform.gd +++ /dev/null @@ -1,17 +0,0 @@ -extends Node2D - -class_name MovingPlatform - - -# Member variables -export var motion = Vector2() -export var cycle = 1.0 -var accum = 0.0 - -func _physics_process(delta): - accum += delta * (1.0 / cycle) * PI * 2.0 - accum = fmod(accum, PI * 2.0) - var d = sin(accum) - var xf = Transform2D() - xf[2] = motion * d - ($Platform as KinematicBody2D).transform = xf diff --git a/2d/platformer/platform/moving_platform.png b/2d/platformer/platform/moving_platform.png deleted file mode 100644 index db98b43d..00000000 Binary files a/2d/platformer/platform/moving_platform.png and /dev/null differ diff --git a/2d/platformer/player/bullet.gd b/2d/platformer/player/bullet.gd deleted file mode 100644 index 49708fbc..00000000 --- a/2d/platformer/player/bullet.gd +++ /dev/null @@ -1,11 +0,0 @@ -extends RigidBody2D - -class_name Bullet - - -func _on_bullet_body_enter(body): - if body.has_method("hit_by_bullet"): - body.call("hit_by_bullet") - -func _on_Timer_timeout(): - ($Anim as AnimationPlayer).play("shutdown") diff --git a/2d/platformer/player/osb_left.png.import b/2d/platformer/player/osb_left.png.import deleted file mode 100644 index 02a50bd1..00000000 --- a/2d/platformer/player/osb_left.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/osb_left.png-95ec3a371455889d592aa8cae0a755bc.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://player/osb_left.png" -dest_files=[ "res://.import/osb_left.png-95ec3a371455889d592aa8cae0a755bc.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=false -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/2d/platformer/player/osb_right.png.import b/2d/platformer/player/osb_right.png.import deleted file mode 100644 index 35a3522c..00000000 --- a/2d/platformer/player/osb_right.png.import +++ /dev/null @@ -1,34 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/osb_right.png-db9bb4651315f3d42b87bd17a86cce76.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://player/osb_right.png" -dest_files=[ "res://.import/osb_right.png-db9bb4651315f3d42b87bd17a86cce76.stex" ] - -[params] - -compress/mode=0 -compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 -compress/normal_map=0 -flags/repeat=0 -flags/filter=false -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 -process/fix_alpha_border=true -process/premult_alpha=false -process/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=false -svg/scale=1.0 diff --git a/2d/platformer/player/player.gd b/2d/platformer/player/player.gd deleted file mode 100644 index 681f6573..00000000 --- a/2d/platformer/player/player.gd +++ /dev/null @@ -1,97 +0,0 @@ -extends KinematicBody2D - -class_name Player - - -const GRAVITY_VEC = Vector2(0, 900) -const FLOOR_NORMAL = Vector2(0, -1) -const SLOPE_SLIDE_STOP = 25.0 -const WALK_SPEED = 250 # pixels/sec -const JUMP_SPEED = 480 -const SIDING_CHANGE_SPEED = 10 -const BULLET_VELOCITY = 1000 -const SHOOT_TIME_SHOW_WEAPON = 0.2 - -var linear_vel = Vector2() -var shoot_time = 99999 # time since last shot - -var anim = "" - -# cache the sprite here for fast access (we will set scale to flip it often) -onready var sprite = $Sprite -# cache bullet for fast access -var Bullet = preload("res://player/Bullet.tscn") - - -func _physics_process(delta): - # Increment counters - shoot_time += delta - - ### MOVEMENT ### - - # Apply gravity - linear_vel += delta * GRAVITY_VEC - # Move and slide - linear_vel = move_and_slide(linear_vel, FLOOR_NORMAL, SLOPE_SLIDE_STOP) - # Detect if we are on floor - only works if called *after* move_and_slide - var on_floor = is_on_floor() - - ### CONTROL ### - - # Horizontal movement - var target_speed = 0 - if Input.is_action_pressed("move_left"): - target_speed -= 1 - if Input.is_action_pressed("move_right"): - target_speed += 1 - - target_speed *= WALK_SPEED - linear_vel.x = lerp(linear_vel.x, target_speed, 0.1) - - # Jumping - if on_floor and Input.is_action_just_pressed("jump"): - linear_vel.y = -JUMP_SPEED - ($SoundJump as AudioStreamPlayer2D).play() - - # Shooting - if Input.is_action_just_pressed("shoot"): - var bullet = Bullet.instance() - bullet.position = ($Sprite/BulletShoot as Position2D).global_position # use node for shoot position - bullet.linear_velocity = Vector2(sprite.scale.x * BULLET_VELOCITY, 0) - bullet.add_collision_exception_with(self) # don't want player to collide with bullet - get_parent().add_child(bullet) # don't want bullet to move with me, so add it as child of parent - ($SoundShoot as AudioStreamPlayer2D).play() - shoot_time = 0 - - ### ANIMATION ### - - var new_anim = "idle" - - if on_floor: - if linear_vel.x < -SIDING_CHANGE_SPEED: - sprite.scale.x = -1 - new_anim = "run" - - if linear_vel.x > SIDING_CHANGE_SPEED: - sprite.scale.x = 1 - new_anim = "run" - else: - # We want the character to immediately change facing side when the player - # tries to change direction, during air control. - # This allows for example the player to shoot quickly left then right. - if Input.is_action_pressed("move_left") and not Input.is_action_pressed("move_right"): - sprite.scale.x = -1 - if Input.is_action_pressed("move_right") and not Input.is_action_pressed("move_left"): - sprite.scale.x = 1 - - if linear_vel.y < 0: - new_anim = "jumping" - else: - new_anim = "falling" - - if shoot_time < SHOOT_TIME_SHOW_WEAPON: - new_anim += "_weapon" - - if new_anim != anim: - anim = new_anim - ($Anim as AnimationPlayer).play(anim) diff --git a/2d/platformer/project.godot b/2d/platformer/project.godot index bbd89f03..71d88db2 100644 --- a/2d/platformer/project.godot +++ b/2d/platformer/project.godot @@ -9,43 +9,49 @@ config_version=4 _global_script_classes=[ { +"base": "KinematicBody2D", +"class": "Actor", +"language": "GDScript", +"path": "res://src/Actors/Actor.gd" +}, { "base": "RigidBody2D", "class": "Bullet", "language": "GDScript", -"path": "res://player/bullet.gd" +"path": "res://src/Objects/Bullet.gd" }, { "base": "Area2D", "class": "Coin", "language": "GDScript", -"path": "res://coin/coin.gd" +"path": "res://src/Objects/Coin.gd" }, { -"base": "KinematicBody2D", +"base": "Actor", "class": "Enemy", "language": "GDScript", -"path": "res://enemy/enemy.gd" +"path": "res://src/Actors/Enemy.gd" }, { -"base": "Node2D", -"class": "MovingPlatform", +"base": "Position2D", +"class": "Gun", "language": "GDScript", -"path": "res://platform/moving_platform.gd" +"path": "res://src/Actors/Gun.gd" }, { -"base": "KinematicBody2D", +"base": "Actor", "class": "Player", "language": "GDScript", -"path": "res://player/player.gd" +"path": "res://src/Actors/Player.gd" } ] _global_script_class_icons={ +"Actor": "", "Bullet": "", "Coin": "", "Enemy": "", -"MovingPlatform": "", +"Gun": "", "Player": "" } [application] config/name="Platformer 2D" -run/main_scene="res://Stage.tscn" +run/main_scene="res://src/Main/Game.tscn" config/icon="res://icon.png" target_fps="60" @@ -61,6 +67,7 @@ gdscript/warnings/unsafe_call_argument=true window/size/width=800 window/size/height=480 +window/dpi/allow_hidpi=true window/stretch/mode="2d" window/stretch/aspect="keep_height" stretch/aspect="keep_height" @@ -80,18 +87,23 @@ jump={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":0,"pressure":0.0,"pressed":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) ] } move_left={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null) ] } move_right={ "deadzone": 0.5, "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":15,"pressure":0.0,"pressed":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) +, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null) ] } shoot={ @@ -99,18 +111,33 @@ shoot={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":2,"pressure":0.0,"pressed":false,"script":null) , Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null) +, Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null) ] } -spawn={ +toggle_fullscreen={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777244,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"unicode":0,"echo":false,"script":null) + ] +} +toggle_pause={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777217,"unicode":0,"echo":false,"script":null) , Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null) ] } +[layer_names] + +2d_physics/layer_1="player" +2d_physics/layer_2="enemies" +2d_physics/layer_3="coins" +2d_physics/layer_4="platforms" +2d_physics/layer_5="ground" + [physics] 2d/default_gravity=700 +2d/gravity_default=1800.0 [rasterizer] @@ -124,9 +151,9 @@ mipmap_policy=1 quality/intended_usage/framebuffer_allocation=0 quality/intended_usage/framebuffer_allocation.mobile=1 +quality/2d/use_pixel_snap=true quality/filters/anisotropic_filter_level=2 quality/filters/use_nearest_mipmap_filter=true -quality/voxel_cone_tracing/high_quality=false quality/depth/hdr=false [texture_import] diff --git a/2d/platformer/screenshots/.gdignore b/2d/platformer/screenshots/.gdignore new file mode 100644 index 00000000..e69de29b diff --git a/2d/platformer/screenshots/layout.png b/2d/platformer/screenshots/layout.png new file mode 100644 index 00000000..5df82475 Binary files /dev/null and b/2d/platformer/screenshots/layout.png differ diff --git a/2d/platformer/screenshots/shoot.png b/2d/platformer/screenshots/shoot.png new file mode 100644 index 00000000..cbdd5f44 Binary files /dev/null and b/2d/platformer/screenshots/shoot.png differ diff --git a/2d/platformer/src/Actors/Actor.gd b/2d/platformer/src/Actors/Actor.gd new file mode 100644 index 00000000..0dc5ce74 --- /dev/null +++ b/2d/platformer/src/Actors/Actor.gd @@ -0,0 +1,18 @@ +class_name Actor +extends KinematicBody2D + +# Both the Player and Enemy inherit this scene as they have shared behaviours +# such as speed and are affected by gravity. + + +export var speed = Vector2(400.0, 500.0) +export(float) var gravity = ProjectSettings.get("physics/2d/gravity_default") + +const FLOOR_NORMAL = Vector2.UP + +var _velocity = Vector2.ZERO + +# _physics_process is called after the inherited _physics_process function. +# This allows the Player and Enemy scenes to be affected by gravity. +func _physics_process(delta): + _velocity.y += gravity * delta diff --git a/2d/platformer/src/Actors/Enemy.gd b/2d/platformer/src/Actors/Enemy.gd new file mode 100644 index 00000000..0ed30b5b --- /dev/null +++ b/2d/platformer/src/Actors/Enemy.gd @@ -0,0 +1,79 @@ +class_name Enemy +extends Actor + + +enum State { + WALKING, + DEAD +} + +var _state = State.WALKING + +onready var platform_detector = $PlatformDetector +onready var floor_detector_left = $FloorDetectorLeft +onready var floor_detector_right = $FloorDetectorRight +onready var sprite = $Sprite +onready var animation_player = $AnimationPlayer + +# This function is called when the scene enters the scene tree. +# We can initialize variables here. +func _ready(): + _velocity.x = speed.x + +# Physics process is a built-in loop in Godot. +# If you define _physics_process on a node, Godot will call it every frame. + +# At a glance, you can see that the physics process loop: +# 1. Calculates the move velocity. +# 2. Moves the character. +# 3. Updates the sprite direction. +# 4. Updates the animation. + +# Splitting the physics process logic into functions not only makes it +# easier to read, it help to change or improve the code later on: +# - If you need to change a calculation, you can use Go To -> Function +# (Ctrl Alt F) to quickly jump to the corresponding function. +# - If you split the character into a state machine or more advanced pattern, +# you can easily move individual functions. +func _physics_process(_delta): + _velocity = calculate_move_velocity(_velocity) + + # We only update the y value of _velocity as we want to handle the horizontal movement ourselves. + _velocity.y = move_and_slide(_velocity, FLOOR_NORMAL).y + + # We flip the Sprite depending on which way the enemy is moving. + sprite.scale.x = 1 if _velocity.x > 0 else -1 + + var animation = get_new_animation() + if animation != animation_player.current_animation: + animation_player.play(animation) + + +# This function calculates a new velocity whenever you need it. +# If the enemy encounters a wall or an edge, the horizontal velocity is flipped. +func calculate_move_velocity(linear_velocity): + var velocity = linear_velocity + + if not floor_detector_left.is_colliding(): + velocity.x = speed.x + elif not floor_detector_right.is_colliding(): + velocity.x = -speed.x + + if is_on_wall(): + velocity.x *= -1 + + return velocity + + +func destroy(): + _state = State.DEAD + _velocity = Vector2.ZERO + + +func get_new_animation(): + var animation_new = "" + if _state == State.WALKING: + animation_new = "walk" if abs(_velocity.x) > 0 else "idle" + else: + animation_new = "destroy" + return animation_new diff --git a/2d/platformer/enemy/Enemy.tscn b/2d/platformer/src/Actors/Enemy.tscn similarity index 52% rename from 2d/platformer/enemy/Enemy.tscn rename to 2d/platformer/src/Actors/Enemy.tscn index 501f08dc..ae55902c 100644 --- a/2d/platformer/enemy/Enemy.tscn +++ b/2d/platformer/src/Actors/Enemy.tscn @@ -1,15 +1,16 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=15 format=2] -[ext_resource path="res://enemy/enemy.gd" type="Script" id=1] -[ext_resource path="res://enemy/enemy.png" type="Texture" id=2] -[ext_resource path="res://player/bullet.png" type="Texture" id=3] -[ext_resource path="res://audio/sound_hit.wav" type="AudioStream" id=4] -[ext_resource path="res://audio/sound_explode.wav" type="AudioStream" id=5] +[ext_resource path="res://assets/art/player/bullet/bullet.png" type="Texture" id=1] +[ext_resource path="res://assets/audio/sfx/explode.wav" type="AudioStream" id=2] +[ext_resource path="res://assets/audio/sfx/hit.wav" type="AudioStream" id=3] +[ext_resource path="res://assets/art/enemy/enemy.png" type="Texture" id=4] +[ext_resource path="res://src/Actors/Enemy.gd" type="Script" id=5] -[sub_resource type="Animation" id=1] -resource_name = "explode" -length = 5.0 -step = 0.0 +[sub_resource type="CanvasItemMaterial" id=1] + +[sub_resource type="Animation" id=2] +resource_name = "destroy" +length = 1.5 tracks/0/type = "value" tracks/0/path = NodePath("Sprite:frame") tracks/0/interp = 1 @@ -20,7 +21,7 @@ tracks/0/keys = { "times": PoolRealArray( 0 ), "transitions": PoolRealArray( 1 ), "update": 0, -"values": [ 0 ] +"values": [ 7 ] } tracks/1/type = "value" tracks/1/path = NodePath("Sprite:rotation_degrees") @@ -29,8 +30,8 @@ tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 3.2 ), -"transitions": PoolRealArray( 0.5, 1 ), +"times": PoolRealArray( 0, 0.8 ), +"transitions": PoolRealArray( 0.0796601, 1 ), "update": 0, "values": [ 0.0, 180.0 ] } @@ -41,10 +42,10 @@ tracks/2/loop_wrap = true tracks/2/imported = false tracks/2/enabled = true tracks/2/keys = { -"times": PoolRealArray( 2.6, 3.4 ), -"transitions": PoolRealArray( 1, 1 ), +"times": PoolRealArray( 0, 0.3, 0.9 ), +"transitions": PoolRealArray( 1, 1, 1 ), "update": 0, -"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] +"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] } tracks/3/type = "value" tracks/3/path = NodePath("Explosion:emitting") @@ -53,7 +54,7 @@ tracks/3/loop_wrap = true tracks/3/imported = false tracks/3/enabled = true tracks/3/keys = { -"times": PoolRealArray( 0, 2.8 ), +"times": PoolRealArray( 0, 0.8 ), "transitions": PoolRealArray( 1, 1 ), "update": 1, "values": [ false, true ] @@ -65,13 +66,13 @@ tracks/4/loop_wrap = true tracks/4/imported = false tracks/4/enabled = true tracks/4/keys = { -"times": PoolRealArray( 2.8, 3.4 ), +"times": PoolRealArray( 0.4, 0.8 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, "values": [ 1.0, 4.0 ] } tracks/5/type = "value" -tracks/5/path = NodePath("SoundHit:playing") +tracks/5/path = NodePath("Hit:playing") tracks/5/interp = 1 tracks/5/loop_wrap = true tracks/5/imported = false @@ -83,13 +84,13 @@ tracks/5/keys = { "values": [ true ] } tracks/6/type = "value" -tracks/6/path = NodePath("SoundExplode:playing") +tracks/6/path = NodePath("Explode:playing") tracks/6/interp = 1 tracks/6/loop_wrap = true tracks/6/imported = false tracks/6/enabled = true tracks/6/keys = { -"times": PoolRealArray( 2.9 ), +"times": PoolRealArray( 0.6 ), "transitions": PoolRealArray( 1 ), "update": 1, "values": [ true ] @@ -101,15 +102,39 @@ tracks/7/loop_wrap = true tracks/7/imported = false tracks/7/enabled = true tracks/7/keys = { -"times": PoolRealArray( 4.2 ), +"times": PoolRealArray( 1.5 ), "transitions": PoolRealArray( 1 ), "values": [ { "args": [ ], "method": "queue_free" } ] } +tracks/8/type = "value" +tracks/8/path = NodePath(".:collision_layer") +tracks/8/interp = 1 +tracks/8/loop_wrap = true +tracks/8/imported = false +tracks/8/enabled = true +tracks/8/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ 0 ] +} +tracks/9/type = "value" +tracks/9/path = NodePath("Sprite:position") +tracks/9/interp = 1 +tracks/9/loop_wrap = true +tracks/9/imported = false +tracks/9/enabled = true +tracks/9/keys = { +"times": PoolRealArray( 0, 0.2, 0.4 ), +"transitions": PoolRealArray( 2.2974, 0.183011, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 0, -32 ), Vector2( 0, 0 ) ] +} -[sub_resource type="Animation" id=2] +[sub_resource type="Animation" id=3] length = 6.75 loop = true step = 0.25 @@ -126,8 +151,7 @@ tracks/0/keys = { "values": [ 5, 6, 5, 6, 5, 6, 7, 6, 7, 5 ] } -[sub_resource type="Animation" id=3] -resource_name = "walk" +[sub_resource type="Animation" id=4] length = 1.25 loop = true step = 0.25 @@ -144,8 +168,6 @@ tracks/0/keys = { "values": [ 0, 1, 2, 3, 4, 0 ] } -[sub_resource type="CanvasItemMaterial" id=4] - [sub_resource type="CapsuleShape2D" id=5] radius = 13.4556 height = 14.2002 @@ -153,58 +175,73 @@ height = 14.2002 [sub_resource type="CanvasItemMaterial" id=6] blend_mode = 1 -[sub_resource type="ParticlesMaterial" id=7] +[sub_resource type="Gradient" id=7] +offsets = PoolRealArray( 0.562963, 1 ) +colors = PoolColorArray( 1, 1, 1, 1, 0, 0, 0, 1 ) + +[sub_resource type="GradientTexture" id=8] +gradient = SubResource( 7 ) +width = 256 + +[sub_resource type="ParticlesMaterial" id=9] +emission_shape = 1 +emission_sphere_radius = 8.0 flag_disable_z = true -gravity = Vector3( 0, 98, 0 ) +spread = 180.0 +gravity = Vector3( 0, 250, 0 ) +initial_velocity = 120.0 +initial_velocity_random = 0.5 orbit_velocity = 0.0 orbit_velocity_random = 0.0 +angle = 720.0 +angle_random = 1.0 +scale = 0.4 +scale_random = 1.0 +color_ramp = SubResource( 8 ) +hue_variation = 0.05 +hue_variation_random = 0.46 [node name="Enemy" type="KinematicBody2D"] -script = ExtResource( 1 ) +collision_layer = 2 +collision_mask = 24 +script = ExtResource( 5 ) +speed = Vector2( 150, 500 ) +gravity = 1800.0 -[node name="Enabler" type="VisibilityEnabler2D" parent="."] -position = Vector2( 16.2569, 11.0034 ) -scale = Vector2( 23.5056, 10.8629 ) -pause_particles = false +[node name="PlatformDetector" type="RayCast2D" parent="."] +position = Vector2( 0, 12 ) +enabled = true +cast_to = Vector2( 0, 8 ) +collision_mask = 8 -[node name="Anim" type="AnimationPlayer" parent="."] -anims/explode = SubResource( 1 ) -anims/idle = SubResource( 2 ) -anims/walk = SubResource( 3 ) +[node name="FloorDetectorLeft" type="RayCast2D" parent="."] +position = Vector2( -30, -8 ) +enabled = true +cast_to = Vector2( 0, 70 ) +collision_mask = 24 + +[node name="FloorDetectorRight" type="RayCast2D" parent="."] +position = Vector2( 31.16, -8 ) +enabled = true +cast_to = Vector2( 0, 70 ) +collision_mask = 24 [node name="Sprite" type="Sprite" parent="."] -material = SubResource( 4 ) -texture = ExtResource( 2 ) +material = SubResource( 1 ) +texture = ExtResource( 4 ) flip_h = true hframes = 8 +frame = 5 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/destroy = SubResource( 2 ) +anims/idle = SubResource( 3 ) +anims/walk = SubResource( 4 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( -0.00525069, -0.727495 ) rotation = -1.5708 shape = SubResource( 5 ) -[node name="DetectFloorLeft" type="RayCast2D" parent="."] -position = Vector2( -33.2868, -9.34363 ) -enabled = true -cast_to = Vector2( 0, 45 ) - -[node name="DetectWallLeft" type="RayCast2D" parent="."] -position = Vector2( -12.1361, -0.739977 ) -rotation = 1.5708 -enabled = true -cast_to = Vector2( 0, 20 ) - -[node name="DetectWallRight" type="RayCast2D" parent="."] -position = Vector2( 3.2788, -0.381488 ) -rotation = -1.5708 -enabled = true -cast_to = Vector2( 0, 20 ) - -[node name="DetectFloorRight" type="RayCast2D" parent="."] -position = Vector2( 29.1987, -9.34363 ) -enabled = true -cast_to = Vector2( 0, 45 ) - [node name="Explosion" type="Particles2D" parent="."] self_modulate = Color( 1, 1, 1, 0.12 ) material = SubResource( 6 ) @@ -213,13 +250,13 @@ amount = 32 lifetime = 0.5 one_shot = true speed_scale = 1.2 -explosiveness = 0.1 -process_material = SubResource( 7 ) -texture = ExtResource( 3 ) +explosiveness = 0.76 +draw_order = 215832976 +process_material = SubResource( 9 ) +texture = ExtResource( 1 ) -[node name="SoundHit" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource( 4 ) - -[node name="SoundExplode" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource( 5 ) +[node name="Hit" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource( 3 ) +[node name="Explode" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource( 2 ) diff --git a/2d/platformer/src/Actors/Gun.gd b/2d/platformer/src/Actors/Gun.gd new file mode 100644 index 00000000..f13b3afc --- /dev/null +++ b/2d/platformer/src/Actors/Gun.gd @@ -0,0 +1,24 @@ +class_name Gun +extends Position2D +# Represents a weapon that spawns and shoots bullets. +# The Cooldown timer controls the cooldown duration between shots. + + +const BULLET_VELOCITY = 1000.0 +const Bullet = preload("res://src/Objects/Bullet.tscn") + +onready var sound_shoot = $Shoot +onready var timer = $Cooldown + + +func shoot(direction = 1): + if not timer.is_stopped(): + return false + var bullet = Bullet.instance() + bullet.global_position = global_position + bullet.linear_velocity = Vector2(direction * BULLET_VELOCITY, 0) + + bullet.set_as_toplevel(true) + add_child(bullet) + sound_shoot.play() + return true diff --git a/2d/platformer/src/Actors/Player.gd b/2d/platformer/src/Actors/Player.gd new file mode 100644 index 00000000..4e68b8e1 --- /dev/null +++ b/2d/platformer/src/Actors/Player.gd @@ -0,0 +1,96 @@ +class_name Player +extends Actor + + +const FLOOR_DETECT_DISTANCE = 40.0 + +onready var platform_detector = $PlatformDetector +onready var sprite = $Sprite +onready var animation_player = $AnimationPlayer +onready var shoot_timer = $ShootAnimation +onready var gun = $Sprite/Gun + + +# Physics process is a built-in loop in Godot. +# If you define _physics_process on a node, Godot will call it every frame. + +# We use separate functions to calculate the direction and velocity to make this one easier to read. +# At a glance, you can see that the physics process loop: +# 1. Calculates the move direction. +# 2. Calculates the move velocity. +# 3. Moves the character. +# 4. Updates the sprite direction. +# 5. Shoots bullets. +# 6. Updates the animation. + +# Splitting the physics process logic into functions not only makes it +# easier to read, it help to change or improve the code later on: +# - If you need to change a calculation, you can use Go To -> Function +# (Ctrl Alt F) to quickly jump to the corresponding function. +# - If you split the character into a state machine or more advanced pattern, +# you can easily move individual functions. +func _physics_process(_delta): + var direction = get_direction() + + var is_jump_interrupted = Input.is_action_just_released("jump") and _velocity.y < 0.0 + _velocity = calculate_move_velocity(_velocity, direction, speed, is_jump_interrupted) + + var snap_vector = Vector2.DOWN * FLOOR_DETECT_DISTANCE if direction.y == 0.0 else Vector2.ZERO + var is_on_platform = platform_detector.is_colliding() + _velocity = move_and_slide_with_snap( + _velocity, snap_vector, FLOOR_NORMAL, not is_on_platform, 4, 0.9, false + ) + + # When the character’s direction changes, we want to to scale the Sprite accordingly to flip it. + # This will make Robi face left or right depending on the direction you move. + if direction.x != 0: + sprite.scale.x = direction.x + + # We use the sprite's scale to store Robi’s look direction which allows us to shoot + # bullets forward. + # There are many situations like these where you can reuse existing properties instead of + # creating new variables. + var is_shooting = false + if Input.is_action_just_pressed("shoot"): + is_shooting = gun.shoot(sprite.scale.x) + + var animation = get_new_animation(is_shooting) + if animation != animation_player.current_animation and shoot_timer.is_stopped(): + if is_shooting: + shoot_timer.start() + animation_player.play(animation) + + +func get_direction(): + return Vector2( + Input.get_action_strength("move_right") - Input.get_action_strength("move_left"), + -Input.get_action_strength("jump") if is_on_floor() and Input.is_action_just_pressed("jump") else 0.0 + ) + + +# This function calculates a new velocity whenever you need it. +# It allows you to interrupt jumps. +func calculate_move_velocity( + linear_velocity, + direction, + speed, + is_jump_interrupted + ): + var velocity = linear_velocity + velocity.x = speed.x * direction.x + if direction.y != 0.0: + velocity.y = speed.y * direction.y + if is_jump_interrupted: + velocity.y = 0.0 + return velocity + + +func get_new_animation(is_shooting = false): + var animation_new = "" + if is_on_floor(): + animation_new = "run" if abs(_velocity.x) > 0.1 else "idle" + else: + animation_new = "falling" if _velocity.y > 0 else "jumping" + if is_shooting: + animation_new += "_weapon" + return animation_new diff --git a/2d/platformer/player/Player.tscn b/2d/platformer/src/Actors/Player.tscn similarity index 74% rename from 2d/platformer/player/Player.tscn rename to 2d/platformer/src/Actors/Player.tscn index aacabf25..234d976d 100644 --- a/2d/platformer/player/Player.tscn +++ b/2d/platformer/src/Actors/Player.tscn @@ -1,13 +1,14 @@ -[gd_scene load_steps=20 format=2] +[gd_scene load_steps=21 format=2] -[ext_resource path="res://player/player.gd" type="Script" id=1] -[ext_resource path="res://player/robot_demo.png" type="Texture" id=2] -[ext_resource path="res://audio/sound_jump.wav" type="AudioStream" id=3] -[ext_resource path="res://audio/sound_shoot.wav" type="AudioStream" id=4] -[ext_resource path="res://player/osb_left.png" type="Texture" id=5] -[ext_resource path="res://player/osb_right.png" type="Texture" id=6] -[ext_resource path="res://player/osb_jump.png" type="Texture" id=7] -[ext_resource path="res://player/osb_fire.png" type="Texture" id=8] +[ext_resource path="res://src/Actors/Player.gd" type="Script" id=1] +[ext_resource path="res://assets/art/player/robot_demo.png" type="Texture" id=2] +[ext_resource path="res://assets/audio/sfx/jump.wav" type="AudioStream" id=3] +[ext_resource path="res://assets/audio/sfx/shoot.wav" type="AudioStream" id=4] +[ext_resource path="res://assets/art/ui/touch_button_left.png" type="Texture" id=5] +[ext_resource path="res://assets/art/ui/touch_button_right.png" type="Texture" id=6] +[ext_resource path="res://assets/art/ui/touch_button_jump.png" type="Texture" id=7] +[ext_resource path="res://assets/art/ui/touch_button_fire.png" type="Texture" id=8] +[ext_resource path="res://src/Actors/Gun.gd" type="Script" id=9] [sub_resource type="Animation" id=1] resource_name = "crouch" @@ -182,26 +183,47 @@ tracks/0/keys = { "values": [ 10, 11, 12, 13, 14, 5 ] } -[sub_resource type="CapsuleShape2D" id=11] -height = 44.4787 +[sub_resource type="RectangleShape2D" id=11] +extents = Vector2( 10, 27 ) [node name="Player" type="KinematicBody2D"] +collision_mask = 30 script = ExtResource( 1 ) +speed = Vector2( 300, 700 ) +gravity = 1800.0 + +[node name="ShootAnimation" type="Timer" parent="."] +process_mode = 0 +wait_time = 0.2 +one_shot = true + +[node name="PlatformDetector" type="RayCast2D" parent="."] +enabled = true +cast_to = Vector2( 0, 6 ) +collision_mask = 8 [node name="Sprite" type="Sprite" parent="."] +position = Vector2( 0, -28 ) texture = ExtResource( 2 ) vframes = 2 hframes = 16 -frame = 22 +frame = 16 -[node name="Smoke" type="Node2D" parent="Sprite"] -position = Vector2( 20.7312, 3.21187 ) -rotation = -1.45648 - -[node name="BulletShoot" type="Position2D" parent="Sprite"] +[node name="Gun" type="Position2D" parent="Sprite"] position = Vector2( 30.6589, 6.13176 ) +script = ExtResource( 9 ) -[node name="Anim" type="AnimationPlayer" parent="."] +[node name="Shoot" type="AudioStreamPlayer2D" parent="Sprite/Gun"] +position = Vector2( -30.6589, -6.13176 ) +stream = ExtResource( 4 ) + +[node name="Cooldown" type="Timer" parent="Sprite/Gun"] +process_mode = 0 +wait_time = 0.3 +one_shot = true + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +playback_speed = 2.6 anims/crouch = SubResource( 1 ) anims/falling = SubResource( 2 ) anims/falling_weapon = SubResource( 3 ) @@ -214,20 +236,17 @@ anims/run_weapon = SubResource( 9 ) anims/standing_weapon_ready = SubResource( 10 ) [node name="Camera" type="Camera2D" parent="."] +position = Vector2( 0, -28 ) current = true -limit_left = 0 -limit_top = 0 +process_mode = 0 [node name="CollisionShape2D" type="CollisionShape2D" parent="."] -position = Vector2( 0.291992, -0.835023 ) +position = Vector2( 0, -27 ) shape = SubResource( 11 ) -[node name="SoundJump" type="AudioStreamPlayer2D" parent="."] +[node name="Jump" type="AudioStreamPlayer2D" parent="."] stream = ExtResource( 3 ) -[node name="SoundShoot" type="AudioStreamPlayer2D" parent="."] -stream = ExtResource( 4 ) - [node name="UI" type="CanvasLayer" parent="."] layer = 0 @@ -247,23 +266,15 @@ passby_press = true action = "move_right" visibility_mode = 1 -[node name="BottomRightAnchor" type="Control" parent="UI"] -anchor_left = 1.0 -anchor_top = 1.0 -anchor_right = 1.0 -anchor_bottom = 1.0 -margin_left = -40.0 -margin_top = -40.0 - -[node name="Jump" type="TouchScreenButton" parent="UI/BottomRightAnchor"] -position = Vector2( -98.151, -83.768 ) +[node name="Jump" type="TouchScreenButton" parent="UI"] +position = Vector2( 666.224, 359.02 ) scale = Vector2( 1.49157, 1.46265 ) normal = ExtResource( 7 ) action = "jump" visibility_mode = 1 -[node name="Fire" type="TouchScreenButton" parent="UI/BottomRightAnchor"] -position = Vector2( -96.302, -180 ) +[node name="Fire" type="TouchScreenButton" parent="UI"] +position = Vector2( 668.073, 262.788 ) scale = Vector2( 1.49157, 1.46265 ) normal = ExtResource( 8 ) action = "shoot" diff --git a/2d/platformer/src/Level/Level.tscn b/2d/platformer/src/Level/Level.tscn new file mode 100644 index 00000000..7d335e7f --- /dev/null +++ b/2d/platformer/src/Level/Level.tscn @@ -0,0 +1,275 @@ +[gd_scene load_steps=11 format=2] + +[ext_resource path="res://assets/art/tileset/tileset.tres" type="TileSet" id=1] +[ext_resource path="res://src/Actors/Enemy.tscn" type="PackedScene" id=2] +[ext_resource path="res://src/Platforms/Platform.tscn" type="PackedScene" id=3] +[ext_resource path="res://src/Objects/Coin.tscn" type="PackedScene" id=4] +[ext_resource path="res://src/Actors/Player.tscn" type="PackedScene" id=5] +[ext_resource path="res://assets/art/platforms/moving_platform.png" type="Texture" id=6] +[ext_resource path="res://src/Level/ParallaxBackground.tscn" type="PackedScene" id=7] +[ext_resource path="res://assets/audio/music/music.ogg" type="AudioStream" id=8] + +[sub_resource type="Animation" id=1] +resource_name = "move" +length = 4.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 2 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 1414.49, 799.663 ), Vector2( 1131.8, 607.41 ) ] +} + +[sub_resource type="Animation" id=2] +length = 8.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath(".:position") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 4 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( -93.4945, 159.269 ), Vector2( -93.4945, 814.766 ) ] +} + +[node name="Level" type="Node2D"] +pause_mode = 1 + +[node name="TileMap" type="TileMap" parent="."] +tile_set = ExtResource( 1 ) +collision_layer = 16 +collision_mask = 0 +format = 1 +tile_data = PoolIntArray( -65546, 536870913, 0, -65545, 1, 0, -131044, 536870913, 0, -131043, 1, 0, -10, 536870915, 0, -9, 3, 0, -65508, 536870915, 0, -65507, 3, 0, 65526, 536870915, 0, 65527, 3, 0, 28, 536870915, 0, 29, 3, 0, 131062, 536870915, 0, 131063, 3, 0, 131069, 536870918, 0, 131070, 5, 0, 131071, 5, 0, 65536, 5, 0, 65537, 5, 0, 65538, 5, 0, 65539, 5, 0, 65540, 6, 0, 65564, 536870915, 0, 65565, 3, 0, 196598, 536870915, 0, 196599, 3, 0, 131080, 536870913, 0, 131081, 0, 0, 131082, 0, 0, 131083, 0, 0, 131084, 0, 0, 131085, 1, 0, 131100, 536870915, 0, 131101, 3, 0, 262134, 536870915, 0, 262135, 3, 0, 196616, 536870921, 0, 196617, 8, 0, 196618, 8, 0, 196619, 8, 0, 196620, 8, 0, 196621, 9, 0, 196626, 536870913, 0, 196627, 0, 0, 196628, 0, 0, 196629, 0, 0, 196630, 0, 0, 196631, 0, 0, 196632, 0, 0, 196633, 0, 0, 196634, 0, 0, 196635, 0, 0, 196636, 536870916, 0, 196637, 3, 0, 327670, 536870915, 0, 327671, 3, 0, 262149, 536870918, 0, 262150, 6, 0, 262162, 536870921, 0, 262163, 536870920, 0, 262164, 536870920, 0, 262165, 536870920, 0, 262166, 536870920, 0, 262167, 536870922, 0, 262168, 7, 0, 262169, 7, 0, 262170, 7, 0, 262171, 7, 0, 262172, 7, 0, 262173, 3, 0, 393206, 536870915, 0, 393207, 3, 0, 327682, 536870918, 0, 327683, 6, 0, 327703, 536870921, 0, 327704, 536870920, 0, 327705, 536870922, 0, 327706, 7, 0, 327707, 7, 0, 327708, 7, 0, 327709, 3, 0, 458742, 536870915, 0, 458743, 4, 0, 458744, 0, 0, 458745, 0, 0, 458746, 1, 0, 393241, 536870921, 0, 393242, 536870920, 0, 393243, 536870920, 0, 393244, 536870922, 0, 393245, 3, 0, 524278, 536870915, 0, 524279, 536870919, 0, 524280, 536870919, 0, 524281, 536870919, 0, 524282, 3, 0, 458754, 536870913, 0, 458755, 0, 0, 458756, 0, 0, 458757, 2, 0, 458764, 536870913, 0, 458765, 1, 0, 458780, 536870915, 0, 458781, 3, 0, 589814, 536870915, 0, 589815, 536870919, 0, 589816, 536870919, 0, 589817, 536870919, 0, 589818, 3, 0, 524290, 536870915, 0, 524291, 7, 0, 524292, 7, 0, 524294, 536870912, 0, 524295, 536870912, 0, 524296, 536870912, 0, 524297, 536870912, 0, 524298, 536870912, 0, 524299, 536870912, 0, 524300, 536870916, 0, 524301, 3, 0, 524316, 536870915, 0, 524317, 3, 0, 655350, 536870915, 0, 655351, 536870919, 0, 655352, 536870919, 0, 655353, 536870919, 0, 655354, 3, 0, 589826, 536870915, 0, 589827, 7, 0, 589828, 7, 0, 589829, 7, 0, 589830, 7, 0, 589831, 7, 0, 589832, 7, 0, 589833, 7, 0, 589834, 7, 0, 589835, 7, 0, 589836, 7, 0, 589837, 4, 0, 589838, 0, 0, 589839, 1, 0, 589852, 536870915, 0, 589853, 3, 0, 720886, 536870915, 0, 720887, 536870919, 0, 720888, 536870919, 0, 720889, 536870919, 0, 720890, 3, 0, 655362, 536870921, 0, 655363, 536870920, 0, 655364, 536870920, 0, 655365, 536870920, 0, 655366, 536870920, 0, 655367, 536870920, 0, 655368, 536870920, 0, 655369, 536870920, 0, 655370, 536870920, 0, 655371, 536870920, 0, 655372, 536870920, 0, 655373, 536870920, 0, 655374, 536870920, 0, 655375, 9, 0, 655388, 536870915, 0, 655389, 3, 0, 786422, 536870915, 0, 786423, 536870919, 0, 786424, 536870919, 0, 786425, 536870919, 0, 786426, 3, 0, 720924, 536870915, 0, 720925, 3, 0, 851958, 536870915, 0, 851959, 536870919, 0, 851960, 536870919, 0, 851961, 536870919, 0, 851962, 3, 0, 786456, 536870918, 0, 786457, 536870917, 0, 786458, 6, 0, 786460, 536870915, 0, 786461, 3, 0, 917494, 536870915, 0, 917495, 536870919, 0, 917496, 536870919, 0, 917497, 536870919, 0, 917498, 4, 0, 917499, 0, 0, 917500, 0, 0, 917501, 0, 0, 917502, 0, 0, 917503, 0, 0, 851968, 0, 0, 851969, 1, 0, 851996, 536870915, 0, 851997, 3, 0, 983030, 536870915, 0, 983031, 536870919, 0, 983032, 536870919, 0, 983033, 536870919, 0, 983034, 536870919, 0, 983035, 536870919, 0, 983036, 536870919, 0, 983037, 536870919, 0, 983038, 536870919, 0, 983039, 536870919, 0, 917504, 536870919, 0, 917505, 3, 0, 917526, 536870913, 0, 917527, 536870912, 0, 917528, 536870912, 0, 917529, 0, 0, 917530, 536870912, 0, 917531, 536870912, 0, 917532, 536870916, 0, 917533, 3, 0, 1048566, 536870915, 0, 1048567, 536870919, 0, 1048568, 536870919, 0, 1048569, 536870919, 0, 1048570, 536870919, 0, 1048571, 536870919, 0, 1048572, 536870919, 0, 1048573, 536870919, 0, 1048574, 536870919, 0, 1048575, 536870919, 0, 983040, 536870919, 0, 983041, 3, 0, 983057, 536870918, 0, 983058, 5, 0, 983059, 6, 0, 983062, 536870915, 0, 983063, 7, 0, 983064, 7, 0, 983065, 7, 0, 983066, 7, 0, 983067, 7, 0, 983068, 7, 0, 983069, 3, 0, 1114102, 536870915, 0, 1114103, 536870919, 0, 1114104, 536870919, 0, 1114105, 536870919, 0, 1114106, 536870919, 0, 1114107, 536870919, 0, 1114108, 536870919, 0, 1114109, 536870919, 0, 1114110, 536870919, 0, 1114111, 536870919, 0, 1048576, 536870919, 0, 1048577, 3, 0, 1048579, 536870926, 0, 1048598, 536870915, 0, 1048599, 7, 0, 1048600, 7, 0, 1048601, 7, 0, 1048602, 7, 0, 1048603, 7, 0, 1048604, 7, 0, 1048605, 3, 0, 1179638, 536870915, 0, 1179639, 536870919, 0, 1179640, 536870919, 0, 1179641, 536870919, 0, 1179642, 536870919, 0, 1179643, 536870919, 0, 1179644, 536870919, 0, 1179645, 536870919, 0, 1179646, 536870919, 0, 1179647, 536870919, 0, 1114112, 536870919, 0, 1114113, 4, 0, 1114114, 0, 0, 1114115, 536870925, 0, 1114116, 0, 0, 1114117, 2, 0, 1114123, 536870926, 0, 1114126, 536870918, 0, 1114127, 5, 0, 1114128, 6, 0, 1114133, 536870914, 0, 1114134, 536870916, 0, 1114135, 7, 0, 1114136, 7, 0, 1114137, 7, 0, 1114138, 7, 0, 1114139, 7, 0, 1114140, 7, 0, 1114141, 3, 0, 1245174, 536870915, 0, 1245175, 536870919, 0, 1245176, 536870919, 0, 1245177, 536870919, 0, 1245178, 536870919, 0, 1245179, 536870919, 0, 1245180, 536870919, 0, 1245181, 536870919, 0, 1245182, 536870919, 0, 1245183, 536870919, 0, 1179648, 536870919, 0, 1179649, 536870919, 0, 1179650, 536870919, 0, 1179651, 536870919, 0, 1179652, 536870922, 0, 1179654, 2, 0, 1179658, 536870913, 0, 1179659, 536870925, 0, 1179660, 1, 0, 1179668, 536870914, 0, 1179670, 7, 0, 1179671, 7, 0, 1179672, 7, 0, 1179673, 7, 0, 1179674, 7, 0, 1179675, 7, 0, 1179676, 7, 0, 1179677, 3, 0, 1310710, 536870915, 0, 1310711, 536870919, 0, 1310712, 536870919, 0, 1310713, 536870919, 0, 1310714, 536870919, 0, 1310715, 536870919, 0, 1310716, 536870919, 0, 1310717, 536870919, 0, 1310718, 536870919, 0, 1310719, 536870919, 0, 1245184, 536870919, 0, 1245185, 536870919, 0, 1245186, 536870919, 0, 1245187, 536870919, 0, 1245188, 536870919, 0, 1245189, 536870922, 0, 1245191, 2, 0, 1245194, 536870915, 0, 1245195, 7, 0, 1245196, 3, 0, 1245203, 536870914, 0, 1245205, 7, 0, 1245206, 7, 0, 1245207, 7, 0, 1245208, 7, 0, 1245209, 7, 0, 1245210, 7, 0, 1245211, 7, 0, 1245212, 7, 0, 1245213, 3, 0, 1376246, 536870915, 0, 1376247, 536870919, 0, 1376248, 536870919, 0, 1376249, 536870919, 0, 1376250, 536870919, 0, 1376251, 536870919, 0, 1376252, 536870919, 0, 1376253, 536870919, 0, 1376254, 536870919, 0, 1376255, 536870919, 0, 1310720, 536870919, 0, 1310721, 536870919, 0, 1310722, 536870919, 0, 1310723, 536870919, 0, 1310724, 536870919, 0, 1310725, 536870919, 0, 1310726, 536870922, 0, 1310728, 536870912, 0, 1310729, 536870912, 0, 1310730, 536870916, 0, 1310731, 7, 0, 1310732, 4, 0, 1310733, 0, 0, 1310734, 0, 0, 1310735, 0, 0, 1310736, 0, 0, 1310737, 0, 0, 1310738, 536870912, 0, 1310740, 7, 0, 1310741, 7, 0, 1310742, 7, 0, 1310743, 7, 0, 1310744, 7, 0, 1310745, 7, 0, 1310746, 7, 0, 1310747, 7, 0, 1310748, 7, 0, 1310749, 3, 0, 1441782, 536870921, 0, 1441783, 536870920, 0, 1441784, 536870920, 0, 1441785, 536870920, 0, 1441786, 536870920, 0, 1441787, 536870920, 0, 1441788, 536870920, 0, 1441789, 536870920, 0, 1441790, 536870920, 0, 1441791, 536870920, 0, 1376256, 536870920, 0, 1376257, 536870920, 0, 1376258, 536870920, 0, 1376259, 536870920, 0, 1376260, 536870920, 0, 1376261, 536870920, 0, 1376262, 536870920, 0, 1376263, 536870920, 0, 1376264, 536870920, 0, 1376265, 536870920, 0, 1376266, 536870920, 0, 1376267, 536870920, 0, 1376268, 536870920, 0, 1376269, 536870920, 0, 1376270, 536870920, 0, 1376271, 536870920, 0, 1376272, 536870920, 0, 1376273, 536870920, 0, 1376274, 536870920, 0, 1376275, 536870920, 0, 1376276, 536870920, 0, 1376277, 536870920, 0, 1376278, 536870920, 0, 1376279, 536870920, 0, 1376280, 536870920, 0, 1376281, 536870920, 0, 1376282, 536870920, 0, 1376283, 536870920, 0, 1376284, 8, 0, 1376285, 9, 0 ) + +[node name="Coins" type="Node" parent="."] + +[node name="CoinsArc" type="Node2D" parent="Coins"] +position = Vector2( 539.755, 1147.54 ) + +[node name="Coin" parent="Coins/CoinsArc" instance=ExtResource( 4 )] +position = Vector2( -29.4628, 59.9619 ) + +[node name="Coin2" parent="Coins/CoinsArc" instance=ExtResource( 4 )] +position = Vector2( 0.171143, 0.141846 ) + +[node name="Coin3" parent="Coins/CoinsArc" instance=ExtResource( 4 )] +position = Vector2( 62.5472, -35.7081 ) + +[node name="CoinsVertical" type="Node2D" parent="Coins"] +position = Vector2( 732.045, 1037.88 ) + +[node name="Coin" parent="Coins/CoinsVertical" instance=ExtResource( 4 )] +position = Vector2( -0.110291, 31.8701 ) + +[node name="Coin2" parent="Coins/CoinsVertical" instance=ExtResource( 4 )] +position = Vector2( -0.110291, -0.129883 ) + +[node name="Coin3" parent="Coins/CoinsVertical" instance=ExtResource( 4 )] +position = Vector2( -0.110291, -32.1299 ) + +[node name="CoinsVertical2" type="Node2D" parent="Coins"] +position = Vector2( 1018.11, -17.9731 ) + +[node name="Coin" parent="Coins/CoinsVertical2" instance=ExtResource( 4 )] +position = Vector2( -0.110291, 31.8701 ) + +[node name="Coin2" parent="Coins/CoinsVertical2" instance=ExtResource( 4 )] +position = Vector2( -0.110291, -0.129883 ) + +[node name="Coin3" parent="Coins/CoinsVertical2" instance=ExtResource( 4 )] +position = Vector2( -0.110291, -32.1299 ) + +[node name="CoinsSquare" type="Node2D" parent="Coins"] +position = Vector2( -429.669, 323.199 ) + +[node name="Coin" parent="Coins/CoinsSquare" instance=ExtResource( 4 )] +position = Vector2( -32, -32 ) + +[node name="Coin2" parent="Coins/CoinsSquare" instance=ExtResource( 4 )] +position = Vector2( 32, -32 ) + +[node name="Coin3" parent="Coins/CoinsSquare" instance=ExtResource( 4 )] +position = Vector2( -32, 32 ) + +[node name="Coin4" parent="Coins/CoinsSquare" instance=ExtResource( 4 )] +position = Vector2( 32, 32 ) + +[node name="CoinsSquare2" type="Node2D" parent="Coins"] +position = Vector2( 695.105, 66.9483 ) + +[node name="Coin" parent="Coins/CoinsSquare2" instance=ExtResource( 4 )] +position = Vector2( -32, -32 ) + +[node name="Coin2" parent="Coins/CoinsSquare2" instance=ExtResource( 4 )] +position = Vector2( 32, -32 ) + +[node name="Coin3" parent="Coins/CoinsSquare2" instance=ExtResource( 4 )] +position = Vector2( -32, 32 ) + +[node name="Coin4" parent="Coins/CoinsSquare2" instance=ExtResource( 4 )] +position = Vector2( 32, 32 ) + +[node name="CoinsSquare3" type="Node2D" parent="Coins"] +position = Vector2( 1353.17, 117.285 ) + +[node name="Coin" parent="Coins/CoinsSquare3" instance=ExtResource( 4 )] +position = Vector2( -32, -32 ) + +[node name="Coin2" parent="Coins/CoinsSquare3" instance=ExtResource( 4 )] +position = Vector2( 32, -32 ) + +[node name="Coin3" parent="Coins/CoinsSquare3" instance=ExtResource( 4 )] +position = Vector2( -32, 32 ) + +[node name="Coin4" parent="Coins/CoinsSquare3" instance=ExtResource( 4 )] +position = Vector2( 32, 32 ) + +[node name="CoinsSquare4" type="Node2D" parent="Coins"] +position = Vector2( 1592.58, 117.285 ) + +[node name="Coin" parent="Coins/CoinsSquare4" instance=ExtResource( 4 )] +position = Vector2( -32, -32 ) + +[node name="Coin2" parent="Coins/CoinsSquare4" instance=ExtResource( 4 )] +position = Vector2( 32, -32 ) + +[node name="Coin3" parent="Coins/CoinsSquare4" instance=ExtResource( 4 )] +position = Vector2( -32, 32 ) + +[node name="Coin4" parent="Coins/CoinsSquare4" instance=ExtResource( 4 )] +position = Vector2( 32, 32 ) + +[node name="CoinsHorizontal" type="Node2D" parent="Coins"] +position = Vector2( 73.2408, 805.983 ) + +[node name="Coin" parent="Coins/CoinsHorizontal" instance=ExtResource( 4 )] +position = Vector2( -32, 0 ) + +[node name="Coin2" parent="Coins/CoinsHorizontal" instance=ExtResource( 4 )] + +[node name="Coin3" parent="Coins/CoinsHorizontal" instance=ExtResource( 4 )] +position = Vector2( 32, 0 ) + +[node name="CoinsHorizontal2" type="Node2D" parent="Coins"] +position = Vector2( 1337.21, 863.089 ) + +[node name="Coin" parent="Coins/CoinsHorizontal2" instance=ExtResource( 4 )] +position = Vector2( -32, 0 ) + +[node name="Coin2" parent="Coins/CoinsHorizontal2" instance=ExtResource( 4 )] + +[node name="Coin3" parent="Coins/CoinsHorizontal2" instance=ExtResource( 4 )] +position = Vector2( 32, 0 ) + +[node name="CoinsHorizontal3" type="Node2D" parent="Coins"] +position = Vector2( 671.17, 311.745 ) + +[node name="Coin" parent="Coins/CoinsHorizontal3" instance=ExtResource( 4 )] +position = Vector2( -32, 0 ) + +[node name="Coin2" parent="Coins/CoinsHorizontal3" instance=ExtResource( 4 )] + +[node name="Coin3" parent="Coins/CoinsHorizontal3" instance=ExtResource( 4 )] +position = Vector2( 32, 0 ) + +[node name="CoinsHorizontal4" type="Node2D" parent="Coins"] +position = Vector2( -126.888, 41.1804 ) + +[node name="Coin" parent="Coins/CoinsHorizontal4" instance=ExtResource( 4 )] +position = Vector2( -32, 0 ) + +[node name="Coin2" parent="Coins/CoinsHorizontal4" instance=ExtResource( 4 )] + +[node name="Coin3" parent="Coins/CoinsHorizontal4" instance=ExtResource( 4 )] +position = Vector2( 32, 0 ) + +[node name="CoinsHorizontal5" type="Node2D" parent="Coins"] +position = Vector2( 255.215, 41.1804 ) + +[node name="Coin" parent="Coins/CoinsHorizontal5" instance=ExtResource( 4 )] +position = Vector2( -32, 0 ) + +[node name="Coin2" parent="Coins/CoinsHorizontal5" instance=ExtResource( 4 )] + +[node name="Coin3" parent="Coins/CoinsHorizontal5" instance=ExtResource( 4 )] +position = Vector2( 32, 0 ) + +[node name="Platforms" type="Node" parent="."] + +[node name="Platform" parent="Platforms" instance=ExtResource( 3 )] +position = Vector2( 1414.49, 799.663 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Platforms/Platform"] +autoplay = "move" +playback_process_mode = 0 +anims/move = SubResource( 1 ) + +[node name="Platform2" parent="Platforms" instance=ExtResource( 3 )] +position = Vector2( -93.4945, 700.054 ) + +[node name="AnimationPlayer" type="AnimationPlayer" parent="Platforms/Platform2"] +autoplay = "move" +playback_process_mode = 0 +anims/move = SubResource( 2 ) + +[node name="PlatformStatic" type="StaticBody2D" parent="Platforms"] +position = Vector2( 1139.87, 211.754 ) +rotation = 0.355618 +z_index = -1 +collision_layer = 16 +collision_mask = 0 + +[node name="Sprite2" type="Sprite" parent="Platforms/PlatformStatic"] +position = Vector2( -177.384, 21.0007 ) +rotation = -0.246293 +texture = ExtResource( 6 ) + +[node name="Sprite" type="Sprite" parent="Platforms/PlatformStatic"] +texture = ExtResource( 6 ) + +[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Platforms/PlatformStatic"] +polygon = PoolVector2Array( -261.093, 20.4292, -94.1774, -21.2967, 16.1709, -14.2775, 20.3489, -3.02834, -93.7491, -8.65489, -257.264, 30.7409 ) + +[node name="Enemies" type="Node" parent="."] + +[node name="Enemy" parent="Enemies" instance=ExtResource( 2 )] +position = Vector2( 542.081, 491.279 ) + +[node name="Enemy2" parent="Enemies" instance=ExtResource( 2 )] +position = Vector2( 692.218, 97.1263 ) + +[node name="Enemy3" parent="Enemies" instance=ExtResource( 2 )] +position = Vector2( 1265.45, 157.109 ) + +[node name="Enemy4" parent="Enemies" instance=ExtResource( 2 )] +position = Vector2( 1657.03, 154.524 ) + +[node name="Player" parent="." instance=ExtResource( 5 )] +position = Vector2( 173.294, 1093.02 ) + +[node name="Camera" parent="Player" index="4"] +limit_left = -626 +limit_top = -780 +limit_right = 1905 +limit_bottom = 1384 +limit_smoothed = true +editor_draw_limits = true + +[node name="ParallaxBackground" parent="." instance=ExtResource( 7 )] + +[node name="Music" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 8 ) +autoplay = true + +[editable path="Player"] diff --git a/2d/platformer/src/Level/ParallaxBackground.tscn b/2d/platformer/src/Level/ParallaxBackground.tscn new file mode 100644 index 00000000..8b34be08 --- /dev/null +++ b/2d/platformer/src/Level/ParallaxBackground.tscn @@ -0,0 +1,174 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/art/background/distant_platforms_2.png" type="Texture" id=1] +[ext_resource path="res://assets/art/background/sky.png" type="Texture" id=2] +[ext_resource path="res://assets/art/background/cloud_1.png" type="Texture" id=3] +[ext_resource path="res://assets/art/background/cloud_2.png" type="Texture" id=4] +[ext_resource path="res://assets/art/background/cloud_3.png" type="Texture" id=5] +[ext_resource path="res://assets/art/background/distant_platforms_1.png" type="Texture" id=6] + +[node name="ParallaxBackground" type="ParallaxBackground"] +scroll_base_scale = Vector2( 0.4, 0 ) + +[node name="Sky" type="ParallaxLayer" parent="."] +motion_mirroring = Vector2( 800, 0 ) + +[node name="Sprite" type="Sprite" parent="Sky"] +scale = Vector2( 128, 0.94 ) +texture = ExtResource( 2 ) +centered = false + +[node name="Clouds" type="ParallaxLayer" parent="."] +motion_scale = Vector2( 0.1, 1 ) +motion_offset = Vector2( -550, 0 ) + +[node name="CloudGroup1" type="Node2D" parent="Clouds"] +position = Vector2( -780, 0 ) + +[node name="Sprite1" type="Sprite" parent="Clouds/CloudGroup1"] +position = Vector2( -200, 120 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite2" type="Sprite" parent="Clouds/CloudGroup1"] +position = Vector2( 200, 20 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite3" type="Sprite" parent="Clouds/CloudGroup1"] +position = Vector2( -60, 40 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite4" type="Sprite" parent="Clouds/CloudGroup1"] +position = Vector2( 300, 130 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite5" type="Sprite" parent="Clouds/CloudGroup1"] +position = Vector2( 30, 150 ) +texture = ExtResource( 5 ) +centered = false + +[node name="Sprite6" type="Sprite" parent="Clouds/CloudGroup1"] +position = Vector2( 450, 70 ) +texture = ExtResource( 5 ) +centered = false + +[node name="CloudGroup2" type="Node2D" parent="Clouds"] + +[node name="Sprite1" type="Sprite" parent="Clouds/CloudGroup2"] +position = Vector2( -200, 120 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite2" type="Sprite" parent="Clouds/CloudGroup2"] +position = Vector2( 200, 20 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite3" type="Sprite" parent="Clouds/CloudGroup2"] +position = Vector2( -60, 40 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite4" type="Sprite" parent="Clouds/CloudGroup2"] +position = Vector2( 300, 130 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite5" type="Sprite" parent="Clouds/CloudGroup2"] +position = Vector2( 30, 150 ) +texture = ExtResource( 5 ) +centered = false + +[node name="Sprite6" type="Sprite" parent="Clouds/CloudGroup2"] +position = Vector2( 450, 70 ) +texture = ExtResource( 5 ) +centered = false + +[node name="CloudGroup3" type="Node2D" parent="Clouds"] +position = Vector2( 780, 0 ) + +[node name="Sprite1" type="Sprite" parent="Clouds/CloudGroup3"] +position = Vector2( -200, 120 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite2" type="Sprite" parent="Clouds/CloudGroup3"] +position = Vector2( 200, 20 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite3" type="Sprite" parent="Clouds/CloudGroup3"] +position = Vector2( -60, 40 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite4" type="Sprite" parent="Clouds/CloudGroup3"] +position = Vector2( 300, 130 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite5" type="Sprite" parent="Clouds/CloudGroup3"] +position = Vector2( 30, 150 ) +texture = ExtResource( 5 ) +centered = false + +[node name="Sprite6" type="Sprite" parent="Clouds/CloudGroup3"] +position = Vector2( 450, 70 ) +texture = ExtResource( 5 ) +centered = false + +[node name="CloudGroup4" type="Node2D" parent="Clouds"] +position = Vector2( 1560, 0 ) + +[node name="Sprite1" type="Sprite" parent="Clouds/CloudGroup4"] +position = Vector2( -200, 120 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite2" type="Sprite" parent="Clouds/CloudGroup4"] +position = Vector2( 200, 20 ) +texture = ExtResource( 3 ) +centered = false + +[node name="Sprite3" type="Sprite" parent="Clouds/CloudGroup4"] +position = Vector2( -60, 40 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite4" type="Sprite" parent="Clouds/CloudGroup4"] +position = Vector2( 300, 130 ) +texture = ExtResource( 4 ) +centered = false + +[node name="Sprite5" type="Sprite" parent="Clouds/CloudGroup4"] +position = Vector2( 30, 150 ) +texture = ExtResource( 5 ) +centered = false + +[node name="Sprite6" type="Sprite" parent="Clouds/CloudGroup4"] +position = Vector2( 450, 70 ) +texture = ExtResource( 5 ) +centered = false + +[node name="Mountains2" type="ParallaxLayer" parent="."] +position = Vector2( 0, 481 ) +motion_scale = Vector2( 0.2, 1 ) + +[node name="Sprite" type="Sprite" parent="Mountains2"] +position = Vector2( 0, -120 ) +texture = ExtResource( 1 ) +region_enabled = true +region_rect = Rect2( 0, 0, 4096, 256 ) + +[node name="Mountains1" type="ParallaxLayer" parent="."] +position = Vector2( 0, 481 ) +motion_scale = Vector2( 0.4, 1 ) + +[node name="Sprite" type="Sprite" parent="Mountains1"] +position = Vector2( 0, -100 ) +texture = ExtResource( 6 ) +region_enabled = true +region_rect = Rect2( 0, 0, 4096, 256 ) diff --git a/2d/platformer/src/Main/Game.gd b/2d/platformer/src/Main/Game.gd new file mode 100644 index 00000000..568fe27d --- /dev/null +++ b/2d/platformer/src/Main/Game.gd @@ -0,0 +1,31 @@ +extends Node +# This class contains controls that should always be accessible, like pausing +# the game or toggling the window full-screen. + + +# The "_" prefix is a convention to indicate that variables are private, +# that is to say, another node or script should not access them. +onready var _pause_menu = $InterfaceLayer/PauseMenu + + +func _init(): + OS.min_window_size = OS.window_size + OS.max_window_size = OS.get_screen_size() + + +func _input(event): + if event.is_action_pressed("toggle_fullscreen"): + OS.window_fullscreen = not OS.window_fullscreen + get_tree().set_input_as_handled() + # The GlobalControls node, in the Stage scene, is set to process even + # when the game is paused, so this code keeps running. + # To see that, select GlobalControls, and scroll down to the Pause category + # in the inspector. + elif event.is_action_pressed("toggle_pause"): + var tree = get_tree() + tree.paused = not tree.paused + if tree.paused: + _pause_menu.open() + else: + _pause_menu.close() + get_tree().set_input_as_handled() diff --git a/2d/platformer/src/Main/Game.tscn b/2d/platformer/src/Main/Game.tscn new file mode 100644 index 00000000..e3157ca5 --- /dev/null +++ b/2d/platformer/src/Main/Game.tscn @@ -0,0 +1,16 @@ +[gd_scene load_steps=4 format=2] + +[ext_resource path="res://src/UserInterface/PauseMenu.tscn" type="PackedScene" id=1] +[ext_resource path="res://src/Main/Game.gd" type="Script" id=2] +[ext_resource path="res://src/Level/Level.tscn" type="PackedScene" id=3] + +[node name="Game" type="Node"] +pause_mode = 2 +script = ExtResource( 2 ) + +[node name="Level" parent="." instance=ExtResource( 3 )] + +[node name="InterfaceLayer" type="CanvasLayer" parent="."] +layer = 100 + +[node name="PauseMenu" parent="InterfaceLayer" instance=ExtResource( 1 )] diff --git a/2d/platformer/src/Objects/Bullet.gd b/2d/platformer/src/Objects/Bullet.gd new file mode 100644 index 00000000..08d57b19 --- /dev/null +++ b/2d/platformer/src/Objects/Bullet.gd @@ -0,0 +1,14 @@ +class_name Bullet +extends RigidBody2D + + +onready var animation_player = $AnimationPlayer + + +func destroy(): + animation_player.play("destroy") + + +func _on_body_entered(body): + if body is Enemy: + body.destroy() diff --git a/2d/platformer/player/Bullet.tscn b/2d/platformer/src/Objects/Bullet.tscn similarity index 74% rename from 2d/platformer/player/Bullet.tscn rename to 2d/platformer/src/Objects/Bullet.tscn index 06413a6f..93a585f5 100644 --- a/2d/platformer/player/Bullet.tscn +++ b/2d/platformer/src/Objects/Bullet.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=9 format=2] -[ext_resource path="res://player/bullet.gd" type="Script" id=1] -[ext_resource path="res://player/bullet.png" type="Texture" id=2] +[ext_resource path="res://assets/art/player/bullet/bullet.png" type="Texture" id=1] +[ext_resource path="res://src/Objects/Bullet.gd" type="Script" id=2] [sub_resource type="CanvasItemMaterial" id=1] @@ -22,7 +22,8 @@ color = Color( 1, 1, 1, 0.705882 ) [sub_resource type="CircleShape2D" id=5] [sub_resource type="Animation" id=6] -length = 1.5 +resource_name = "destroy" +length = 0.3 tracks/0/type = "method" tracks/0/path = NodePath(".") tracks/0/interp = 1 @@ -30,7 +31,7 @@ tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 1.31 ), +"times": PoolRealArray( 0.3 ), "transitions": PoolRealArray( 1 ), "values": [ { "args": [ ], @@ -44,7 +45,7 @@ tracks/1/loop_wrap = true tracks/1/imported = false tracks/1/enabled = true tracks/1/keys = { -"times": PoolRealArray( 0, 1 ), +"times": PoolRealArray( 0, 0.3 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] @@ -56,7 +57,7 @@ tracks/2/loop_wrap = true tracks/2/imported = false tracks/2/enabled = true tracks/2/keys = { -"times": PoolRealArray( 0, 0.5 ), +"times": PoolRealArray( 0, 0.3 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, "values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] @@ -64,10 +65,12 @@ tracks/2/keys = { [node name="Bullet" type="RigidBody2D"] material = SubResource( 1 ) +collision_layer = 0 +collision_mask = 26 continuous_cd = 2 contacts_reported = 1 contact_monitor = true -script = ExtResource( 1 ) +script = ExtResource( 2 ) [node name="Particles2D" type="Particles2D" parent="."] material = SubResource( 2 ) @@ -75,11 +78,11 @@ lifetime = 0.3 speed_scale = 3.0 local_coords = false process_material = SubResource( 3 ) -texture = ExtResource( 2 ) +texture = ExtResource( 1 ) [node name="Sprite" type="Sprite" parent="."] material = SubResource( 4 ) -texture = ExtResource( 2 ) +texture = ExtResource( 1 ) [node name="CollisionShape2D" type="CollisionShape2D" parent="."] shape = SubResource( 5 ) @@ -88,8 +91,7 @@ shape = SubResource( 5 ) one_shot = true autostart = true -[node name="Anim" type="AnimationPlayer" parent="."] -anims/shutdown = SubResource( 6 ) - -[connection signal="body_entered" from="." to="." method="_on_bullet_body_enter"] -[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"] +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +anims/destroy = SubResource( 6 ) +[connection signal="body_entered" from="." to="." method="_on_body_entered"] +[connection signal="timeout" from="Timer" to="." method="destroy"] diff --git a/2d/platformer/src/Objects/Coin.gd b/2d/platformer/src/Objects/Coin.gd new file mode 100644 index 00000000..7cd6eb32 --- /dev/null +++ b/2d/platformer/src/Objects/Coin.gd @@ -0,0 +1,15 @@ +class_name Coin +extends Area2D +# Collectible that disappears when the player touches it. + +onready var animation_player = $AnimationPlayer + +# The Coins only detects collisions with the Player thanks to its collision mask. +# This prevents other characters such as enemies from picking up coins. + +# When the player collides with a coin, the coin plays its 'picked' animation. +# The animation takes cares of making the coin disappear, but also deactivates its +# collisions and frees it from memory, saving us from writing more complex code. +# Click the AnimationPlayer node to see the animation timeline. +func _on_body_entered(_body): + animation_player.play("picked") diff --git a/2d/platformer/src/Objects/Coin.tscn b/2d/platformer/src/Objects/Coin.tscn new file mode 100644 index 00000000..a240096e --- /dev/null +++ b/2d/platformer/src/Objects/Coin.tscn @@ -0,0 +1,161 @@ +[gd_scene load_steps=7 format=2] + +[ext_resource path="res://assets/art/coin/coin.png" type="Texture" id=2] +[ext_resource path="res://assets/audio/sfx/coin_pickup.wav" type="AudioStream" id=3] +[ext_resource path="res://src/Objects/Coin.gd" type="Script" id=4] + +[sub_resource type="Animation" id=1] +resource_name = "picked" +length = 1.5 +step = 0.25 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 0, +"values": [ 0 ] +} +tracks/1/type = "method" +tracks/1/path = NodePath(".") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 1 ), +"transitions": PoolRealArray( 1 ), +"values": [ { +"args": [ ], +"method": "queue_free" +} ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite:self_modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0.25, 1.25 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] +} +tracks/3/type = "value" +tracks/3/path = NodePath("Pickup:playing") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 2, +"values": [ true ] +} +tracks/4/type = "value" +tracks/4/path = NodePath(".:monitoring") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 1, +"values": [ false ] +} +tracks/5/type = "value" +tracks/5/path = NodePath("Sprite:position") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/keys = { +"times": PoolRealArray( 0, 1.5 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector2( 0, 0 ), Vector2( 0, -42 ) ] +} + +[sub_resource type="Animation" id=2] +length = 1.5 +loop = true +step = 0.25 +tracks/0/type = "value" +tracks/0/path = NodePath("Sprite:frame") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 0.25, 0.5, 0.75, 1, 1.25, 1.5 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1 ), +"update": 1, +"values": [ 0, 1, 2, 3, 2, 1, 0 ] +} +tracks/1/type = "value" +tracks/1/path = NodePath("Sprite:position") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 2, +"values": [ Vector2( 0, 0 ) ] +} +tracks/2/type = "value" +tracks/2/path = NodePath("Sprite:self_modulate") +tracks/2/interp = 1 +tracks/2/loop_wrap = true +tracks/2/imported = false +tracks/2/enabled = true +tracks/2/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 2, +"values": [ Color( 1, 1, 1, 1 ) ] +} +tracks/3/type = "value" +tracks/3/path = NodePath(".:monitoring") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/keys = { +"times": PoolRealArray( 0 ), +"transitions": PoolRealArray( 1 ), +"update": 2, +"values": [ true ] +} + +[sub_resource type="CircleShape2D" id=3] + +[node name="Coin" type="Area2D"] +monitorable = false +collision_layer = 0 +script = ExtResource( 4 ) + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 2 ) +hframes = 4 + +[node name="AnimationPlayer" type="AnimationPlayer" parent="."] +autoplay = "spinning" +playback_speed = 1.5 +anims/picked = SubResource( 1 ) +anims/spinning = SubResource( 2 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +shape = SubResource( 3 ) + +[node name="Pickup" type="AudioStreamPlayer2D" parent="."] +stream = ExtResource( 3 ) +[connection signal="body_entered" from="." to="." method="_on_body_entered"] diff --git a/2d/platformer/src/Platforms/Platform.tscn b/2d/platformer/src/Platforms/Platform.tscn new file mode 100644 index 00000000..1564b262 --- /dev/null +++ b/2d/platformer/src/Platforms/Platform.tscn @@ -0,0 +1,21 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://assets/art/platforms/moving_platform.png" type="Texture" id=2] + +[sub_resource type="RectangleShape2D" id=1] +extents = Vector2( 94, 12 ) + +[node name="Platform" type="KinematicBody2D"] +z_index = -1 +collision_layer = 8 +collision_mask = 0 +collision/safe_margin = 0.12 +motion/sync_to_physics = true + +[node name="Sprite" type="Sprite" parent="."] +texture = ExtResource( 2 ) + +[node name="CollisionShape2D" type="CollisionShape2D" parent="."] +position = Vector2( 0, -8 ) +shape = SubResource( 1 ) +one_way_collision = true diff --git a/2d/platformer/src/UserInterface/PauseMenu.gd b/2d/platformer/src/UserInterface/PauseMenu.gd new file mode 100644 index 00000000..f8e98dad --- /dev/null +++ b/2d/platformer/src/UserInterface/PauseMenu.gd @@ -0,0 +1,26 @@ +extends Control + + +onready var resume_button = $VBoxContainer/ResumeButton + + +func _ready(): + visible = false + + +func close(): + visible = false + + +func open(): + visible = true + resume_button.grab_focus() + + +func _on_ResumeButton_pressed(): + get_tree().paused = false + visible = false + + +func _on_QuitButton_pressed(): + get_tree().quit() diff --git a/2d/platformer/src/UserInterface/PauseMenu.tscn b/2d/platformer/src/UserInterface/PauseMenu.tscn new file mode 100644 index 00000000..5db54b7e --- /dev/null +++ b/2d/platformer/src/UserInterface/PauseMenu.tscn @@ -0,0 +1,56 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://assets/theme/user_interface.tres" type="Theme" id=1] +[ext_resource path="res://src/UserInterface/PauseMenu.gd" type="Script" id=2] + +[node name="PauseMenu" type="Control"] +pause_mode = 2 +anchor_right = 1.0 +anchor_bottom = 1.0 +theme = ExtResource( 1 ) +script = ExtResource( 2 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="ColorRect" type="ColorRect" parent="."] +anchor_right = 1.0 +anchor_bottom = 1.0 +color = Color( 0, 0, 0, 0.211765 ) + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +margin_left = -87.0 +margin_top = -125.0 +margin_right = 87.0 +margin_bottom = 126.0 +alignment = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Label" type="Label" parent="VBoxContainer"] +margin_top = 71.0 +margin_right = 174.0 +margin_bottom = 91.0 +text = "Game Paused" +align = 1 + +[node name="ResumeButton" type="Button" parent="VBoxContainer"] +margin_top = 95.0 +margin_right = 174.0 +margin_bottom = 135.0 +rect_min_size = Vector2( 0, 40 ) +text = "Resume" + +[node name="QuitButton" type="Button" parent="VBoxContainer"] +margin_top = 139.0 +margin_right = 174.0 +margin_bottom = 179.0 +rect_min_size = Vector2( 0, 40 ) +text = "Quit" +[connection signal="pressed" from="VBoxContainer/ResumeButton" to="." method="_on_ResumeButton_pressed"] +[connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_QuitButton_pressed"] diff --git a/2d/platformer/tiles_demo.png b/2d/platformer/tiles_demo.png deleted file mode 100644 index a216b689..00000000 Binary files a/2d/platformer/tiles_demo.png and /dev/null differ