https://github.com/eruvanos/arcadezero
A beginner friendly layer on top of Arcade to create your very first game
https://github.com/eruvanos/arcadezero
Last synced: 5 months ago
JSON representation
A beginner friendly layer on top of Arcade to create your very first game
- Host: GitHub
- URL: https://github.com/eruvanos/arcadezero
- Owner: eruvanos
- License: mit
- Created: 2021-07-26T21:13:50.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-26T22:31:43.000Z (over 4 years ago)
- Last Synced: 2025-01-30T21:16:13.297Z (10 months ago)
- Language: Python
- Size: 50.8 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# arcadezero
A beginner friendly layer on top of Arcade to create your very first game.
> Hint for arcade devs: ArcadeZero uses a wrapper of `arcade.Sprite` to reduce
> the available methods and provide a easier start into game development.
> The main focus is to code your first game.
## Your first game

## Basic commands
```python
from arcadezero import *
# ...
```
## ZeroSprites
A sprite is a figure, which has a position and an image.
ArcadeZero come with a few default ones.
To start with the game, it is enough to create them. they will be drawn automatically.
```python
coin = Coin()
silvercoin = SilverCoin()
playermale = PlayerMale()
playerfemale = PlayerFemale()
bee = Bee()
saw = Saw()
```
### Functions
- `sprite.move(dx=0, dy=0)` - moves the Sprite into a direction
- `sprite.move_left(dx=0)` - moves the Sprite left
- `sprite.move_right(dx=0)` - moves the Sprite right
- `sprite.move_up(dy=0)` - moves the Sprite up
- `sprite.move_down(dy=0)` - moves the Sprite down
- `sprite.rotate(angle)` - rotates the Sprite
## Example from Screenshot
Move the player with the arrow keys, you can add more Coins by pressing `SPACE`.
Do not touch the saws!
```python
from arcadezero import *
from arcadezero import sounds
score = Score("Your score is: ", 0)
player = PlayerMale(200, 200)
@player.when_key(keys.SPACE)
def new_coin_on_space(player, key):
Coin().with_rand_pos()
@player.while_key(keys.UP, keys.DOWN)
def player_move(player, key):
if key == keys.UP:
player.move_up(10)
if key == keys.DOWN:
player.move_down(10)
@player.while_key(keys.LEFT)
def player_move(player, key):
player.move_left(10)
@player.while_key(keys.RIGHT)
def player_move(player, key):
player.move_right(10)
@player.when_collide_with(Coin)
def player_move(player, coin):
coin.remove()
score + 20
sounds.coin1.play()
if len(Coin.all()) == 0:
player.remove()
show_message(f"You won with {score} points.")
@player.when_collide_with(Saw)
def player_move(player, saw):
player.remove()
show_message("You lost", color=colors.COAL)
@when_start
def setup():
set_background_color(colors.CORN)
# Lege 2 neue Coins an
Coin().with_rand_pos()
Coin().with_rand_pos()
# Und 2 Gegner
Saw().with_rand_pos()
Saw().with_rand_pos()
run(1200, 800)
```