Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tgw3ff
2021-SP-CS4096-97-TDG
Commits
5847ade2
Commit
5847ade2
authored
Apr 25, 2021
by
Ethan Huneke
Browse files
Update Player.gd
parent
1b221393
Changes
1
Hide whitespace changes
Inline
Side-by-side
CS 4096-97 Top Down Game/actors/Player.gd
View file @
5847ade2
...
...
@@ -38,6 +38,12 @@ func move(dir: String):
else
:
print
(
"-Collision"
)
func
teleport
(
x
:
float
,
y
:
float
):
print
(
String
(
x
))
print
(
String
(
y
))
position
+=
Vector2
.
RIGHT
*
x
*
tile_size
position
+=
Vector2
.
UP
*
y
*
tile_size
func
harm
(
damage
:
float
):
health
-=
damage
print
(
">"
+
self
.
name
+
" took "
+
String
(
damage
)
+
" damage."
)
...
...
@@ -57,6 +63,8 @@ func _input(ev):
dashRange
=
2
else
:
dashRange
=
1
if
Input
.
is_key_pressed
(
KEY_T
):
teleport
(
3
,
3
)
func
_draw
():
var
label
=
Label
.
new
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment