forked from Chukobyte/seika-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added ability to create entities through python scripting (instead of just defining in scenes). * Update logic for parent child relationship within a scene. * Added CollisionShape2D node type for collision handling. * Added Rect2 in math module. * Updated docs
- Loading branch information
Showing
21 changed files
with
630 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import roll_engine_api | ||
|
||
from roll.node import CollisionShape2D | ||
|
||
|
||
class HitBox(CollisionShape2D): | ||
# TODO: Investigate way to make child not have to implement | ||
@classmethod | ||
def new(cls): | ||
return roll_engine_api.node_new( | ||
class_path=f"{__name__}", | ||
class_name=f"{cls.__name__}", | ||
node_type=f"{cls.extract_valid_inheritance_node()}", | ||
) | ||
|
||
def _start(self) -> None: | ||
pass |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import roll_engine_api | ||
from roll.math import Rect2 | ||
from roll.node import CollisionShape2D | ||
|
||
|
||
class Test(CollisionShape2D): | ||
@classmethod | ||
def new(cls): | ||
return roll_engine_api.node_new( | ||
class_path=f"{__name__}", | ||
class_name=f"{__class__.__name__}", | ||
node_type=f"{cls.extract_valid_inheritance_node()}", | ||
) | ||
|
||
def _start(self) -> None: | ||
self.collider_rect = Rect2(x=300, y=300, w=40, h=40) | ||
print(f"Start called! Rect = {self.collider_rect}") | ||
|
||
def _physics_process(self, delta_time: float) -> None: | ||
# print("Process!") | ||
pass |
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,72 @@ | ||
# Project Properties | ||
|
||
Project properties define how the game will be configured before running. An example of the file is found below: | ||
|
||
### Format | ||
|
||
```json | ||
{ | ||
"game_title": "Fighting Game Proto", | ||
"initial_scene": "scenes/init.json", | ||
"base_resolution": { | ||
"width": 800, | ||
"height": 600 | ||
}, | ||
"colliders_visible": true, | ||
"assets": [ | ||
{ | ||
"type": "texture", | ||
"file_path": "assets/game_projects/fighter/assets/fighters/puncher/puncher_basic_sheet.png" | ||
}, | ||
{ | ||
"type": "font", | ||
"file_path": "assets/fonts/bruh.ttf", | ||
"size": 60 | ||
}, | ||
{ | ||
"type": "music", | ||
"file_path": "assets/audio/music/test_music.wav" | ||
}, | ||
{ | ||
"type": "sound", | ||
"file_path": "assets/audio/sound/test_sound_effect.wav" | ||
} | ||
], | ||
"input_actions": [ | ||
{ | ||
"name": "quit", | ||
"values": ["esc"] | ||
}, | ||
{ | ||
"name": "confirm", | ||
"values": ["return"] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
### Properties | ||
|
||
`game_title` | ||
|
||
Title of the game window. | ||
|
||
`initial_scene` | ||
|
||
First scene loaded for the game. | ||
|
||
`base_resolution` | ||
|
||
Base resolution of the game | ||
|
||
`colliders_visible` | ||
|
||
If true, will render a visible box for colliders. | ||
|
||
`assets` | ||
|
||
Textures, fonts, music, and sound effect assets are defined here. | ||
|
||
`input_actions` | ||
|
||
Key bindings are defined here. |
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 |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
|
||
struct ColliderComponent { | ||
public: | ||
Rect2 collider; | ||
Rect2 collider = Rect2(); | ||
}; | ||
|
||
#endif //COLLIDER_COMPONENT_H |
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
Oops, something went wrong.