FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
-python/data/components/collider.py at master · TobyfoxpurePython/-python · GitHub
TobyfoxpurePython
-python
Repository navigation
Code
Issues
1
(1)
Pull requests
2
(2)
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
-python
/
data
/
components
/
collider.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (14 loc) · 545 Bytes
Breadcrumbs
-python
/
data
/
components
/
collider.py
Copy path
File metadata and controls
17 lines (14 loc) · 545 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
__author__
=
'justinarmstrong'
import
pygame
as
pg
from
..
import
constants
as
c
class
Collider
(
pg
.
sprite
.
Sprite
):
"""Invisible sprites placed overtop background parts
that can be collided with (pipes, steps, ground, etc."""
def
__init__
(
self
,
x
,
y
,
width
,
height
,
name
=
'collider'
):
pg
.
sprite
.
Sprite
.
__init__
(
self
)
self
.
image
=
pg
.
Surface
((
width
,
height
)).
convert
()
#self.image.fill(c.RED)
self
.
rect
=
self
.
image
.
get_rect
()
self
.
rect
.
x
=
x
self
.
rect
.
y
=
y
self
.
state
=
None
Back
|
FazBrowse Home
|
New Git URL