File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 110110 "github_user" : "idom-team" ,
111111 "github_repo" : "idom" ,
112112 "github_version" : "main" ,
113- "doc_path" : "docs" ,
113+ "doc_path" : "docs/source " ,
114114}
115115
116116# Add any paths that contain custom static files (such as style sheets) here,
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ Try typing in the text box and pressing 'Enter' 📋
3333The Game Snake
3434--------------
3535
36- Click to start playing and use the arrow keys to move 🎮
36+ Click to start playing and use WASD to move 🎮
3737
3838Slow internet may cause inconsistent frame pacing 😅
3939
Original file line number Diff line number Diff line change @@ -34,16 +34,16 @@ def GameView():
3434
3535
3636class Direction (enum .Enum ):
37- ArrowUp = (0 , - 1 )
38- ArrowLeft = (- 1 , 0 )
39- ArrowDown = (0 , 1 )
40- ArrowRight = (1 , 0 )
37+ w = (0 , - 1 )
38+ a = (- 1 , 0 )
39+ s = (0 , 1 )
40+ d = (1 , 0 )
4141
4242
4343@idom .element
4444def GameLoop (grid_size , block_scale , set_game_state ):
4545 # we `use_ref` here to capture the latest direction press without any delay
46- direction = idom .hooks .use_ref (Direction .ArrowRight .value )
46+ direction = idom .hooks .use_ref (Direction .d .value )
4747
4848 snake , set_snake = idom .hooks .use_state ([(grid_size // 2 - 1 , grid_size // 2 - 1 )])
4949 food , set_food = use_snake_food (grid_size , snake )
You can’t perform that action at this time.
0 commit comments