Skip to content

Commit

Permalink
feat(examples): add rpg stats
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Aug 27, 2024
1 parent 4988618 commit 93556c7
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
40 changes: 40 additions & 0 deletions game/examples/rpg_stats.rpy
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
label rpg_stats:

default attack = 0
default defense = 0
default magic = 0

screen stat(name, amount):
text "[name]: [amount]"
bar value AnimatedValue(amount, 100) xalign 0.5 xsize 300

screen stats():
frame:
xalign 0 ypos 0
vbox:
use stat("Attack", attack)
null height 15
use stat("Defense", defense)
null height 15
use stat("Magic", magic)

show screen stats

menu:
"Which stat do you want to increase?"

"Attack":
$ attack += 1
jump rpg_stats

"Defense":
$ defense += 1
jump rpg_stats

"Magic":
$ magic += 1
jump rpg_stats

"End":
hide screen stats
jump start
3 changes: 3 additions & 0 deletions game/examples/start.rpy
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ label start:
"Drag and Drop":
jump drag_and_drop

"RPG Stats":
jump rpg_stats

"Text":
jump text

Expand Down

0 comments on commit 93556c7

Please sign in to comment.