Skip to content

Commit 5c81469

Browse files
Added spell sprites
1 parent 0e72be6 commit 5c81469

22 files changed

+317
-50
lines changed

Game.tscn

Lines changed: 29 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[gd_scene load_steps=18 format=2]
1+
[gd_scene load_steps=19 format=2]
22

33
[ext_resource path="res://Player.tscn" type="PackedScene" id=1]
44
[ext_resource path="res://EditorTileset.tres" type="TileSet" id=2]
@@ -7,6 +7,7 @@
77
[ext_resource path="res://dpcomic.ttf" type="DynamicFontData" id=5]
88
[ext_resource path="res://HUD.gd" type="Script" id=6]
99
[ext_resource path="res://Minimap.gd" type="Script" id=7]
10+
[ext_resource path="res://Sprites/Spells/Empty.png" type="Texture" id=8]
1011

1112
[sub_resource type="StyleBoxFlat" id=1]
1213
content_margin_top = 3.0
@@ -190,47 +191,46 @@ __meta__ = {
190191
"_edit_use_anchors_": false
191192
}
192193

193-
[node name="Slot1" type="Panel" parent="HUD/HUD/Spells"]
194-
modulate = Color( 0.47451, 0.345098, 0.529412, 1 )
194+
[node name="Slot1" type="TextureRect" parent="HUD/HUD/Spells"]
195195
margin_right = 16.0
196196
margin_bottom = 16.0
197197
rect_min_size = Vector2( 16, 16 )
198-
custom_styles/panel = SubResource( 3 )
198+
texture = ExtResource( 8 )
199199

200-
[node name="Slot2" type="Panel" parent="HUD/HUD/Spells"]
200+
[node name="Slot2" type="TextureRect" parent="HUD/HUD/Spells"]
201201
margin_left = 20.0
202202
margin_right = 36.0
203203
margin_bottom = 16.0
204204
rect_min_size = Vector2( 16, 16 )
205-
custom_styles/panel = SubResource( 3 )
205+
texture = ExtResource( 8 )
206206

207-
[node name="Slot3" type="Panel" parent="HUD/HUD/Spells"]
207+
[node name="Slot3" type="TextureRect" parent="HUD/HUD/Spells"]
208208
margin_left = 40.0
209209
margin_right = 56.0
210210
margin_bottom = 16.0
211211
rect_min_size = Vector2( 16, 16 )
212-
custom_styles/panel = SubResource( 3 )
212+
texture = ExtResource( 8 )
213213

214-
[node name="Slot4" type="Panel" parent="HUD/HUD/Spells"]
214+
[node name="Slot4" type="TextureRect" parent="HUD/HUD/Spells"]
215215
margin_left = 60.0
216216
margin_right = 76.0
217217
margin_bottom = 16.0
218218
rect_min_size = Vector2( 16, 16 )
219-
custom_styles/panel = SubResource( 3 )
219+
texture = ExtResource( 8 )
220220

221-
[node name="Slot5" type="Panel" parent="HUD/HUD/Spells"]
221+
[node name="Slot5" type="TextureRect" parent="HUD/HUD/Spells"]
222222
margin_left = 80.0
223223
margin_right = 96.0
224224
margin_bottom = 16.0
225225
rect_min_size = Vector2( 16, 16 )
226-
custom_styles/panel = SubResource( 3 )
226+
texture = ExtResource( 8 )
227227

228-
[node name="Slot6" type="Panel" parent="HUD/HUD/Spells"]
228+
[node name="Slot6" type="TextureRect" parent="HUD/HUD/Spells"]
229229
margin_left = 100.0
230230
margin_right = 116.0
231231
margin_bottom = 16.0
232232
rect_min_size = Vector2( 16, 16 )
233-
custom_styles/panel = SubResource( 3 )
233+
texture = ExtResource( 8 )
234234

235235
[node name="SpellBag" type="VBoxContainer" parent="HUD/HUD"]
236236
margin_left = 4.0
@@ -241,59 +241,55 @@ __meta__ = {
241241
"_edit_use_anchors_": false
242242
}
243243

244-
[node name="Slot1" type="Panel" parent="HUD/HUD/SpellBag"]
245-
modulate = Color( 0.47451, 0.345098, 0.529412, 1 )
244+
[node name="Slot1" type="TextureRect" parent="HUD/HUD/SpellBag"]
246245
margin_right = 16.0
247246
margin_bottom = 16.0
248247
rect_min_size = Vector2( 16, 16 )
249-
custom_styles/panel = SubResource( 3 )
248+
texture = ExtResource( 8 )
250249

251-
[node name="Slot2" type="Panel" parent="HUD/HUD/SpellBag"]
250+
[node name="Slot2" type="TextureRect" parent="HUD/HUD/SpellBag"]
252251
margin_top = 20.0
253252
margin_right = 16.0
254253
margin_bottom = 36.0
255254
rect_min_size = Vector2( 16, 16 )
256-
custom_styles/panel = SubResource( 3 )
255+
texture = ExtResource( 8 )
257256

258-
[node name="Slot3" type="Panel" parent="HUD/HUD/SpellBag"]
257+
[node name="Slot3" type="TextureRect" parent="HUD/HUD/SpellBag"]
259258
margin_top = 40.0
260259
margin_right = 16.0
261260
margin_bottom = 56.0
262261
rect_min_size = Vector2( 16, 16 )
263-
custom_styles/panel = SubResource( 3 )
262+
texture = ExtResource( 8 )
264263

265-
[node name="Slot4" type="Panel" parent="HUD/HUD/SpellBag"]
264+
[node name="Slot4" type="TextureRect" parent="HUD/HUD/SpellBag"]
266265
margin_top = 60.0
267266
margin_right = 16.0
268267
margin_bottom = 76.0
269268
rect_min_size = Vector2( 16, 16 )
270-
custom_styles/panel = SubResource( 3 )
269+
texture = ExtResource( 8 )
271270

272-
[node name="Slot5" type="Panel" parent="HUD/HUD/SpellBag"]
271+
[node name="Slot5" type="TextureRect" parent="HUD/HUD/SpellBag"]
273272
margin_top = 80.0
274273
margin_right = 16.0
275274
margin_bottom = 96.0
276275
rect_min_size = Vector2( 16, 16 )
277-
custom_styles/panel = SubResource( 3 )
276+
texture = ExtResource( 8 )
278277

279-
[node name="Slot6" type="Panel" parent="HUD/HUD/SpellBag"]
278+
[node name="Slot6" type="TextureRect" parent="HUD/HUD/SpellBag"]
280279
margin_top = 100.0
281280
margin_right = 16.0
282281
margin_bottom = 116.0
283282
rect_min_size = Vector2( 16, 16 )
284-
custom_styles/panel = SubResource( 3 )
283+
texture = ExtResource( 8 )
285284

286-
[node name="MouseSlot" type="Panel" parent="HUD/HUD"]
285+
[node name="MouseSlot" type="TextureRect" parent="HUD/HUD"]
287286
visible = false
288287
margin_left = 4.0
289288
margin_top = 182.0
290289
margin_right = 20.0
291290
margin_bottom = 198.0
292291
rect_min_size = Vector2( 16, 16 )
293-
custom_styles/panel = SubResource( 3 )
294-
__meta__ = {
295-
"_edit_use_anchors_": false
296-
}
292+
texture = ExtResource( 8 )
297293

298294
[node name="Description" type="Panel" parent="HUD/HUD"]
299295
margin_left = 40.0
@@ -457,5 +453,5 @@ drag_margin_top = 0.4
457453
drag_margin_bottom = 0.4
458454

459455
[connection signal="player_died" from="Player" to="HUD" method="_on_player_died"]
460-
[connection signal="generated_world" from="World" to="Player" method="_on_generated_world"]
461456
[connection signal="generated_world" from="World" to="HUD" method="_on_generated_world"]
457+
[connection signal="generated_world" from="World" to="Player" method="_on_generated_world"]

HUD.gd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ func _process(delta):
6060

6161
for i in $HUD/SpellBag.get_child_count():
6262
if Items.player_spells[i] != null:
63-
$HUD/SpellBag.get_child(i).modulate = Items.player_spells[i].color
63+
$HUD/SpellBag.get_child(i).texture = Items.player_spells[i].texture
6464
else:
65-
$HUD/SpellBag.get_child(i).modulate = "2a2a2a"
65+
$HUD/SpellBag.get_child(i).texture = preload("res://Sprites/Spells/Empty.png")
6666

6767
for i in $HUD/Spells.get_child_count():
6868
if Items.player_wands[Items.selected_wand] != null:
@@ -71,9 +71,9 @@ func _process(delta):
7171
if i < wand.spell_capacity:
7272
$HUD/Spells.get_child(i).visible = true
7373
if wand.spells[i] != null:
74-
$HUD/Spells.get_child(i).modulate = wand.spells[i].color
74+
$HUD/Spells.get_child(i).texture = wand.spells[i].texture
7575
else:
76-
$HUD/Spells.get_child(i).modulate = "2a2a2a"
76+
$HUD/Spells.get_child(i).texture = preload("res://Sprites/Spells/Empty.png")
7777
else:
7878
$HUD/Spells.get_child(i).visible = false
7979
else:
@@ -164,7 +164,7 @@ func _process(delta):
164164
$HUD/MouseSlot.visible = mouse_spell != null
165165
$HUD/MouseSlot.rect_position = mouse + Vector2(-16,0)
166166
if mouse_spell != null:
167-
$HUD/MouseSlot.modulate = mouse_spell.color
167+
$HUD/MouseSlot.texture = mouse_spell.texture
168168

169169

170170
$HUD/Description.rect_size = Vector2(144, 18+$HUD/Description/Description.rect_size.y+4)

Items/Items.gd

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ func _ready():
2828
register_item("wings", "Butterfly Wings", "Metamorphosis", preload("res://Sprites/Items/Wings.png"))
2929
register_item("gasolineblood", "Blood To Gasoline", "Your insides become volatile", preload("res://Sprites/Items/BloodToGasoline.png"))
3030
register_item("scraps", "Cloth Scraps", "Seal your wounds, somewhat", preload("res://Sprites/Items/Scraps.png"))
31-
register_spell("fuck you", "Fuck You", "Fuck everything in that particular direction", "#ffe2ff")
32-
register_spell("evilsight", "Evil Eye", "Look at things so fiercely you tear them apart", "#45ff80")
33-
register_spell("shatter", "Unstable Shattering", "Summon orbs that vibrate in frequencies that disturb souls", "#0faa68")
34-
register_spell("ray", "Generic Ray", "Pew pew!", "#00f3ff")
35-
register_spell("push", "Push", "Away, away...", "#ffffff")
36-
register_spell("pull", "Pull", "Together, together...", "#000055")
37-
register_spell("r", "Alveolar Trill", "RRRRRRRRRRRRRRRR", "#0025ab")
31+
register_spell("fuck you", "Fuck You", "Fuck everything in that particular direction", preload("res://Sprites/Spells/FuckYou.png"))
32+
register_spell("evilsight", "Evil Eye", "Look at things so fiercely you tear them apart", preload("res://Sprites/Spells/EvilEye.png"))
33+
register_spell("shatter", "Unstable Shattering", "Summon orbs that vibrate in frequencies that disturb souls", preload("res://Sprites/Spells/Unstable.png"))
34+
register_spell("ray", "Generic Ray", "Pew pew!", preload("res://Sprites/Spells/Ray.png"))
35+
register_spell("push", "Push", "Away, away...", preload("res://Sprites/Spells/Push.png"))
36+
register_spell("pull", "Pull", "Together, together...", preload("res://Sprites/Spells/Pull.png"))
37+
register_spell("r", "Alveolar Trill", "RRRRRRRRRRRRRRRR", preload("res://Sprites/Spells/R.png"))
3838

3939
if not get_tree().get_nodes_in_group("Player").empty():
4040
Player = get_tree().get_nodes_in_group("Player")[0]
@@ -54,12 +54,12 @@ func register_item(name_id:String, name:String, desc:String, texture:Texture):
5454
new.id = name_id
5555
items[name_id] = new
5656

57-
func register_spell(name_id:String, name:String, desc:String, color :Color):
57+
func register_spell(name_id:String, name:String, desc:String, texture :Texture):
5858
var new := Spell.new()
5959
new.name = name
6060
new.description = desc
6161
new.id = name_id
62-
new.color = color
62+
new.texture = texture
6363
spells[name_id] = new
6464

6565

Spell.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ class_name Spell
55
var name :String
66
var id :String
77
var description :String
8-
var color :Color
8+
var texture: Texture

Spells/EvilSight.tscn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ script = ExtResource( 1 )
99

1010
[node name="Line2D" type="Line2D" parent="."]
1111
width = 5.0
12-
default_color = Color( 0.270588, 1, 0.501961, 1 )
12+
default_color = Color( 1, 0.313726, 0.313726, 1 )

Sprites/Spells/Empty.png

161 Bytes
Loading

Sprites/Spells/Empty.png.import

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/Empty.png-dbb4cc344d0e292f2ef7f16e1db9bd7f.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://Sprites/Spells/Empty.png"
13+
dest_files=[ "res://.import/Empty.png-dbb4cc344d0e292f2ef7f16e1db9bd7f.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=false
34+
svg/scale=1.0

Sprites/Spells/EvilEye.png

198 Bytes
Loading

Sprites/Spells/EvilEye.png.import

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/EvilEye.png-dfa5ca90ed4e51d87ae5b1eca8bbe31b.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://Sprites/Spells/EvilEye.png"
13+
dest_files=[ "res://.import/EvilEye.png-dfa5ca90ed4e51d87ae5b1eca8bbe31b.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=false
34+
svg/scale=1.0

Sprites/Spells/FuckYou.png

-29 Bytes
Loading

0 commit comments

Comments
 (0)