Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cs1-25sp
project02
Commits
e8a1a636
Commit
e8a1a636
authored
2 months ago
by
Adam Blank
Browse files
Options
Download
Email Patches
Plain Diff
fix enemy ships
parent
4c801760
master
No related merge requests found
Pipeline
#118926
canceled with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
support/ship.py
+3
-1
support/ship.py
with
3 additions
and
1 deletion
+3
-1
support/ship.py
View file @
e8a1a636
...
@@ -8,6 +8,7 @@ WIDTH = 10
...
@@ -8,6 +8,7 @@ WIDTH = 10
class
ShipIMG
(
ImageViewer
):
class
ShipIMG
(
ImageViewer
):
def
__init__
(
self
,
path
,
len
,
id
=
None
,
dir
=
0
):
def
__init__
(
self
,
path
,
len
,
id
=
None
,
dir
=
0
):
super
().
__init__
(
path
,
id
=
id
,
zoom
=
False
)
super
().
__init__
(
path
,
id
=
id
,
zoom
=
False
)
self
.
path
=
path
self
.
drag_start
=
None
self
.
drag_start
=
None
self
.
start_offset
=
None
self
.
start_offset
=
None
self
.
x_offset
=
2
self
.
x_offset
=
2
...
@@ -21,12 +22,13 @@ class ShipIMG(ImageViewer):
...
@@ -21,12 +22,13 @@ class ShipIMG(ImageViewer):
def
rotate
(
self
):
def
rotate
(
self
):
self
.
dir
=
(
self
.
dir
+
1
)
%
2
self
.
dir
=
(
self
.
dir
+
1
)
%
2
self
.
change
(
"assets/"
+
str
(
self
.
len
)
+
"-"
+
(
"vertical"
if
self
.
dir
==
0
else
"horizontal"
)
+
".png"
)
if
self
.
dir
==
0
:
if
self
.
dir
==
0
:
self
.
change
(
self
.
path
.
replace
(
"horizontal"
,
"vertical"
))
self
.
styles
.
width
,
self
.
styles
.
height
=
WIDTH
,
self
.
len
*
HEIGHT
self
.
styles
.
width
,
self
.
styles
.
height
=
WIDTH
,
self
.
len
*
HEIGHT
self
.
x_offset
=
2
self
.
x_offset
=
2
self
.
y_offset
=
1
self
.
y_offset
=
1
else
:
else
:
self
.
change
(
self
.
path
.
replace
(
"vertical"
,
"horizontal"
))
self
.
styles
.
width
,
self
.
styles
.
height
=
self
.
len
*
WIDTH
,
HEIGHT
self
.
styles
.
width
,
self
.
styles
.
height
=
self
.
len
*
WIDTH
,
HEIGHT
self
.
x_offset
=
2
self
.
x_offset
=
2
self
.
y_offset
=
1
self
.
y_offset
=
1
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
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
Menu
Projects
Groups
Snippets
Help