Skip to content

Commit 2201c42

Browse files
committed
Fix sprite fencing for x
1 parent d20cd53 commit 2201c42

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
along with this program. If not, see <https://www.gnu.org/licenses/>.
2020
"""
2121

22-
__version__ = "v0.0.1"
22+
__version__ = "v0.0.3"
2323
__author__ = "Secret-chest"
2424

2525
import tkinter.simpledialog

targetSprite.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ def setXy(self, x, y):
6868
x = scratch.WIDTH / 2
6969
elif x < scratch.WIDTH / -2:
7070
x = scratch.WIDTH / -2
71+
else:
72+
if x > scratch.WIDTH / 2 + self.rect.width / 2 - 16:
73+
x = scratch.WIDTH / 2 + self.rect.width / 2 - 16
74+
elif x < scratch.WIDTH / -2 - self.rect.width / 2 + 16:
75+
x = scratch.WIDTH / -2 - self.rect.width / 2 + 16
76+
7177
if self.rect.height <= 32:
7278
if y > scratch.HEIGHT / 2:
7379
y = scratch.HEIGHT / 2

0 commit comments

Comments
 (0)