Skip to content

Commit 2fb8098

Browse files
testdotcomakien-mga
authored andcommitted
2d/physics_platformer works flawlessly on Godot 3.1 beta 8 (#312)
* 2d/physics_platformer works flawlessly on Godot 3.1 beta 8 * fix warnings for inferred node type * every script has a class_name * formatted code for better clarity * each files has its own subfolder * bullet collisions and shooting have to be executed from call_deferred * PascalCase naming for nodes
1 parent 81441c4 commit 2fb8098

File tree

85 files changed

+1471
-2069
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+1471
-2069
lines changed

2d/physics_platformer/Stage.tscn

Lines changed: 279 additions & 0 deletions
Large diffs are not rendered by default.

2d/physics_platformer/Stage2.tscn

Lines changed: 35 additions & 0 deletions
Large diffs are not rendered by default.
File renamed without changes.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
[gd_scene load_steps=2 format=2]
2+
3+
[ext_resource path="res://tiles_demo.png" type="Texture" id=1]
4+
5+
[node name="Node" type="Node"]
6+
7+
[node name="Floor" type="Sprite" parent="."]
8+
texture = ExtResource( 1 )
9+
region_rect = Rect2( 0, 0, 64, 64 )
10+
11+
[node name="Collision" type="StaticBody2D" parent="Floor"]
12+
13+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Floor/Collision"]
14+
polygon = PoolVector2Array( 32, -24, 32, 32, -32, 32, -32, -24 )
15+
16+
[node name="Edge" type="Sprite" parent="."]
17+
position = Vector2( 64, 0 )
18+
texture = ExtResource( 1 )
19+
region_rect = Rect2( 64, 0, 64, 64 )
20+
21+
[node name="Collision" type="StaticBody2D" parent="Edge"]
22+
23+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Edge/Collision"]
24+
polygon = PoolVector2Array( -32, -24, 24, -24, 24, 32, -32, 32 )
25+
26+
[node name="Wall" type="Sprite" parent="."]
27+
position = Vector2( 64, 64 )
28+
texture = ExtResource( 1 )
29+
region_rect = Rect2( 64, 64, 64, 64 )
30+
31+
[node name="Collision" type="StaticBody2D" parent="Wall"]
32+
33+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Wall/Collision"]
34+
polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
35+
36+
[node name="WallDeco" type="Sprite" parent="."]
37+
position = Vector2( 96, 128 )
38+
texture = ExtResource( 1 )
39+
region_rect = Rect2( 320, 128, 128, 64 )
40+
41+
[node name="Collision" type="StaticBody2D" parent="WallDeco"]
42+
43+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="WallDeco/Collision"]
44+
polygon = PoolVector2Array( -64, -32, -8, -32, -8, 32, -64, 32 )
45+
46+
[node name="Corner" type="Sprite" parent="."]
47+
position = Vector2( 64, 192 )
48+
texture = ExtResource( 1 )
49+
region_rect = Rect2( 64, 128, 64, 64 )
50+
51+
[node name="Collision" type="StaticBody2D" parent="Corner"]
52+
53+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Corner/Collision"]
54+
polygon = PoolVector2Array( -32, -32, 24, -32, 32, -24, 32, 32, -32, 32 )
55+
56+
[node name="Flowers" type="Sprite" parent="."]
57+
position = Vector2( 128, 192 )
58+
texture = ExtResource( 1 )
59+
region_rect = Rect2( 192, 192, 64, 64 )
60+
61+
[node name="Collision" type="StaticBody2D" parent="Flowers"]
62+
63+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Flowers/Collision"]
64+
polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
65+
66+
[node name="TreeBase" type="Sprite" parent="."]
67+
position = Vector2( 192, 192 )
68+
texture = ExtResource( 1 )
69+
region_rect = Rect2( 256, 192, 64, 64 )
70+
71+
[node name="Collision" type="StaticBody2D" parent="TreeBase"]
72+
73+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="TreeBase/Collision"]
74+
polygon = PoolVector2Array( -32, 32, 32, 32, 32, -24, -32, -24 )
75+
76+
[node name="TreeMid" type="Sprite" parent="."]
77+
position = Vector2( 192, 128 )
78+
texture = ExtResource( 1 )
79+
region_rect = Rect2( 256, 128, 64, 64 )
80+
81+
[node name="TreeMid2" type="Sprite" parent="."]
82+
position = Vector2( 192, 64 )
83+
texture = ExtResource( 1 )
84+
region_rect = Rect2( 256, 64, 64, 64 )
85+
86+
[node name="TreeTop" type="Sprite" parent="."]
87+
position = Vector2( 192, 0 )
88+
texture = ExtResource( 1 )
89+
region_rect = Rect2( 256, 0, 64, 64 )
90+
91+
[node name="Solid" type="Sprite" parent="."]
92+
position = Vector2( 0, 64 )
93+
texture = ExtResource( 1 )
94+
region_rect = Rect2( 0, 64, 64, 64 )
95+
96+
[node name="Ceiling" type="Sprite" parent="."]
97+
position = Vector2( 0, 128 )
98+
texture = ExtResource( 1 )
99+
region_rect = Rect2( 384, 64, 64, 64 )
100+
101+
[node name="Collision" type="StaticBody2D" parent="Ceiling"]
102+
103+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Ceiling/Collision"]
104+
polygon = PoolVector2Array( 32, -32, 32, 32, -32, 32, -32, -32 )
105+
106+
[node name="Ramp" type="Sprite" parent="."]
107+
position = Vector2( 256, 224 )
108+
texture = ExtResource( 1 )
109+
region_rect = Rect2( 128, 128, 64, 128 )
110+
111+
[node name="Collision" type="StaticBody2D" parent="Ramp"]
112+
113+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Ramp/Collision"]
114+
polygon = PoolVector2Array( -32, -56, 32, 8, 32, 64, -32, 64 )
115+
116+
[node name="CeilingWall" type="Sprite" parent="."]
117+
position = Vector2( 0, 192 )
118+
texture = ExtResource( 1 )
119+
region_rect = Rect2( 448, 64, 64, 64 )
120+
121+
[node name="Collision" type="StaticBody2D" parent="CeilingWall"]
122+
123+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="CeilingWall/Collision"]
124+
polygon = PoolVector2Array( -32, -32, 24, -32, 24, 32, -32, 32 )
125+
126+
[node name="PlatformFloor" type="Sprite" parent="."]
127+
position = Vector2( 0, 256 )
128+
texture = ExtResource( 1 )
129+
region_rect = Rect2( 128, 0, 64, 64 )
130+
131+
[node name="Collision" type="StaticBody2D" parent="PlatformFloor"]
132+
133+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PlatformFloor/Collision"]
134+
polygon = PoolVector2Array( 32, -24, 32, 24, -32, 24, -32, -24 )
135+
136+
[node name="PlatformEdge" type="Sprite" parent="."]
137+
position = Vector2( 64, 256 )
138+
texture = ExtResource( 1 )
139+
region_rect = Rect2( 192, 0, 64, 64 )
140+
141+
[node name="Collision" type="StaticBody2D" parent="PlatformEdge"]
142+
143+
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="PlatformEdge/Collision"]
144+
polygon = PoolVector2Array( 24, -24, 24, 24, -32, 24, -32, -24 )
145+
146+
[node name="Help" type="Label" parent="."]
147+
margin_left = 1.0
148+
margin_top = 331.0
149+
margin_right = 727.0
150+
margin_bottom = 422.0
151+
size_flags_horizontal = 2
152+
text = "This scene serves as a tool for editing the tileset.
153+
Nodes (sprites) and their respective collisionsare edited here.
154+
155+
To create a tileset from this, a \"TileSet\" resoucre must be created. Use the helper in: Scene -> Convert To -> TileSet.
156+
This will save a tileset. Saving over it will merge your changes.
157+
158+
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."
159+
File renamed without changes.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[remap]
2+
3+
importer="ogg_vorbis"
4+
type="AudioStreamOGGVorbis"
5+
path="res://.import/music.ogg-552a37c4bfe46d894cb8004cf1c345ad.oggstr"
6+
7+
[deps]
8+
9+
source_file="res://audio/music.ogg"
10+
dest_files=[ "res://.import/music.ogg-552a37c4bfe46d894cb8004cf1c345ad.oggstr" ]
11+
12+
[params]
13+
14+
loop=true
15+
loop_offset=0
File renamed without changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[remap]
2+
3+
importer="wav"
4+
type="AudioStreamSample"
5+
path="res://.import/sound_coin.wav-e18cceeba8b7dc02bbb940b85bcad99a.sample"
6+
7+
[deps]
8+
9+
source_file="res://audio/sound_coin.wav"
10+
dest_files=[ "res://.import/sound_coin.wav-e18cceeba8b7dc02bbb940b85bcad99a.sample" ]
11+
12+
[params]
13+
14+
force/8_bit=false
15+
force/mono=false
16+
force/max_rate=false
17+
force/max_rate_hz=44100
18+
edit/trim=true
19+
edit/normalize=true
20+
edit/loop=false
21+
compress/mode=0
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[remap]
2+
3+
importer="wav"
4+
type="AudioStreamSample"
5+
path="res://.import/sound_explode.wav-536668d880bfb277b9e5253774598e9e.sample"
6+
7+
[deps]
8+
9+
source_file="res://audio/sound_explode.wav"
10+
dest_files=[ "res://.import/sound_explode.wav-536668d880bfb277b9e5253774598e9e.sample" ]
11+
12+
[params]
13+
14+
force/8_bit=false
15+
force/mono=false
16+
force/max_rate=false
17+
force/max_rate_hz=44100
18+
edit/trim=true
19+
edit/normalize=true
20+
edit/loop=false
21+
compress/mode=0

0 commit comments

Comments
 (0)