Skip to content

Commit

Permalink
fixed projects after the StateHandler dict to list change.
Browse files Browse the repository at this point in the history
  • Loading branch information
pokepetter committed Nov 5, 2024
1 parent 99378e5 commit 48622ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
7 changes: 3 additions & 4 deletions cmyk_swap/cmyk_swap.html
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
menu.on_enable = def():
menu.bg.alpha = 0
menu.bg.animate('alpha', .99)
menu_handler.state = 'shop'
menu_handler.state = shop_menu


shop_menu = Entity(visible_self=False, parent=menu, xy=[-.27,.5])
Expand Down Expand Up @@ -311,7 +311,6 @@
card_reveal_effect_rare.texture = card_reveal_effect_rare.texture



after .4:
card.text = `${card.value}`
if len(card.value) > 5:
Expand Down Expand Up @@ -559,10 +558,10 @@
grid_layout(tab_parent.children, max_x=1, spacing=[1,2.2], offset=[0,0])


states = {'shop':shop_menu, 'unlocks':unlocks_menu, 'skins':skins_menu}
states = [shop_menu, unlocks_menu, skins_menu]
# states = {'shop':shop_menu}
menu_handler = StateHandler(states=states, fade=False)
menu_handler.state = None
menu_handler.state = states[0]

# line = Entity(parent=menu, scale=[.0025,1], x=-.3, z=-1, color=hsv(0,0,.1))
# line = Entity(parent=menu, scale=[.0025,1], x=-.27, z=-1, color=hsv(0,0,.1))
Expand Down
13 changes: 7 additions & 6 deletions gem_hunt/gem_hunt.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><meta charset="utf-8" /> -->
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"><meta charset="utf-8" />
<title>gem hunt</title>
<script src="../taptapir/taptapir.js"></script><script type='text/sunsnake'>

Expand All @@ -18,7 +18,7 @@

wallet.set_gems(99)

gem_hunt_start_bet_scene = Scene('market_crop')
gem_hunt_start_bet_scene = Scene(texture='market_crop')

num_mines = 3
multiplier = 1
Expand Down Expand Up @@ -75,7 +75,7 @@

impact = Entity(texture='impact.gif', scale=.3, z=-100, enabled=False)

gem_hunt_play_scene = Scene('taptapir_stars')
gem_hunt_play_scene = Scene(texture='taptapir_stars')
gem_hunt_play_scene.on_enter = def():
current_win_label.enabled = True
current_win_label.rotation = 0
Expand All @@ -98,8 +98,8 @@
else:
print('win!')
impact.xy = [(e.X/5)-.4, (e.Y/5)-.4]
impact.texture = impact.texture
impact.enabled = True
impact.texture = impact.texture
set_amount_won(amount_won + int(current_bet * multiplier))
after .2:
loose_gem.xy = impact.xy
Expand All @@ -110,6 +110,7 @@
loose_gem.enabled = False

cash_out_button.enabled = True
current_win_label.enabled = True
back_button.enabled = False
e.ignore_collision = True

Expand Down Expand Up @@ -198,7 +199,7 @@
cash_out_button.enabled = False
end_screen.enabled = True
# end_text.enabled = False
end_text.text = `YOU LOST :(`
end_text.text = 'YOU LOST :('
end_text.text_color = color.red
end_text.text_size = 0
end_text.animate('text_size', 5, duration=.25)
Expand All @@ -211,7 +212,7 @@
reveal_all()


retry_button = Button(parent=end_screen, y=-.4, z=-4, text='🗘', scale=[.4,.25], color='#738738', shadow=True, text_size=4, text_color=color.white, on_click=start_game)
retry_button = Button(parent=end_screen, y=-.4, z=-4, text='Play\nagain', scale=[.4,.25], color='#738738', shadow=True, text_size=4, text_color=color.white, on_click=start_game)
bet_text_retry = Button(parent=end_screen, scale=[.2,.075], text_origin=[-.5,0], y=retry_button.y+.12, z=-4, text=` 💎 ${current_bet}`, text_size=2.5, padding=.3)
back_button = Button(parent=end_screen, y=-.4, x=-.45, z=-4, origin=[-.5,0], text='back', scale=[.2,.25], color='#287287', shadow=True, text_color=color.white)
back_button.on_click = def():
Expand Down
2 changes: 1 addition & 1 deletion taptapir
Submodule taptapir updated 2 files
+105 −5 sunsnake_compiler.js
+311 −115 taptapir.js

0 comments on commit 48622ba

Please sign in to comment.