-
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
315: Add AssetLoaded event r=pathunstrom a=astronouth7303 Fire an event when an asset finishes loading and becomes available. Depends on #306, #316 328: Manual Testing r=pathunstrom a=astronouth7303 Initial version of manual/visual tests. Co-authored-by: Jamie Bliss <jamie@ivyleav.es>
- Loading branch information
Showing
13 changed files
with
159 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import ppb.eventlib as eventlib | ||
from ppb import eventlib | ||
|
||
|
||
class System(eventlib.EventMixin): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Visual Tests | ||
============ | ||
|
||
This is a test suite of manual tests, meant to help with the difficulty of | ||
thorough automated testing of graphical software. | ||
|
||
Run with `python -m viztests` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import ast | ||
from pathlib import Path | ||
import subprocess | ||
import sys | ||
|
||
|
||
def get_docstring(path): | ||
tree = ast.parse(path.read_text(), path.name, mode='exec') | ||
|
||
return ast.get_docstring(tree) | ||
|
||
|
||
for script in Path(__file__).resolve().parent.glob('*.py'): | ||
if script.name.startswith('_'): | ||
continue | ||
ds = get_docstring(script) | ||
print("=" * len(script.name)) | ||
print(script.name) | ||
print("=" * len(script.name)) | ||
print("") | ||
if ds is not None: | ||
print(ds) | ||
print("") | ||
subprocess.run([sys.executable, str(script)], check=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
""" | ||
Tests rotation vs Vector angles | ||
The center sprite should always face the orbiting sprite | ||
""" | ||
import ppb | ||
|
||
ROTATION_RATE = 90 | ||
|
||
|
||
class CenterSprite(ppb.BaseSprite): | ||
image = ppb.Image('player.png') | ||
|
||
def on_update(self, event, signal): | ||
self.rotation += ROTATION_RATE * event.time_delta | ||
|
||
|
||
class OrbitSprite(ppb.BaseSprite): | ||
position = ppb.Vector(0, -2) | ||
image = ppb.Image('target.png') | ||
|
||
def on_update(self, event, signal): | ||
self.position = self.position.rotate(ROTATION_RATE * event.time_delta) | ||
|
||
|
||
def setup(scene): | ||
scene.add(CenterSprite()) | ||
scene.add(OrbitSprite()) | ||
|
||
|
||
ppb.run(setup) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.