Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Spieleprogrammieren
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Teckids
Projekt Hack-n-Fun
Material und Vorlagen
Spieleprogrammieren
Commits
cd3757c4
Commit
cd3757c4
authored
1 year ago
by
Robert Seimetz
Browse files
Options
Downloads
Patches
Plain Diff
Fix time() overriding library time
parent
90855fa3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gameparts/basics.py
+3
-3
3 additions, 3 deletions
gameparts/basics.py
gameparts/objects.py
+1
-1
1 addition, 1 deletion
gameparts/objects.py
with
4 additions
and
4 deletions
gameparts/basics.py
+
3
−
3
View file @
cd3757c4
...
...
@@ -132,8 +132,8 @@ class _AnimatedObject(pygame.sprite.Sprite):
self
.
image
=
get_image_from_Spritesheet
(
self
.
spritesheet
,
self
.
spritesize
,
self
.
current_frame
,
self
.
size
).
convert_alpha
()
def
update
(
self
):
if
(
time
()
-
self
.
time_lastframe
)
>
(
1
/
self
.
animationspeed
):
self
.
time_lastframe
=
time
()
if
(
time
r
()
-
self
.
time_lastframe
)
>
(
1
/
self
.
animationspeed
):
self
.
time_lastframe
=
time
r
()
self
.
current_frame
[
0
]
+=
1
if
self
.
current_frame
[
0
]
>=
self
.
maxframe
[
0
]:
...
...
@@ -304,7 +304,7 @@ def add_music(file, repeats):
pygame
.
mixer
.
music
.
load
(
"
./sound/
"
+
str
(
file
))
pygame
.
mixer
.
music
.
play
(
repeats
)
def
time
():
def
time
r
():
time_in_seconds
=
pygame
.
time
.
get_ticks
()
/
1000
return
time_in_seconds
...
...
This diff is collapsed.
Click to expand it.
gameparts/objects.py
+
1
−
1
View file @
cd3757c4
...
...
@@ -2,7 +2,7 @@ import pygame
import
math
from
settings
import
*
from
gameparts.basics
import
_Object
,
_AnimatedObject
,
time
,
get_image_from_Spritesheet
from
gameparts.basics
import
_Object
,
_AnimatedObject
,
time
r
,
get_image_from_Spritesheet
class
Coin
(
_Object
):
def
__init__
(
self
,
location
,
size
,
image
=
"
Golden.png
"
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment