development:csdk:1.0:controllers
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| development:csdk:1.0:controllers [2024/11/08 01:57] – removed - external edit (Unknown date) 127.0.0.1 | development:csdk:1.0:controllers [2024/11/08 01:57] (current) – ↷ Page moved from development:csdk:controllers to development:csdk:1.0:controllers clyde | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Reading Controllers ====== | ||
| + | |||
| + | Reading controllers on the GameTank requires to add ''# | ||
| + | |||
| + | update_inputs(); | ||
| + | if (player1_buttons & INPUT_MASK_LEFT) { | ||
| + | ... | ||
| + | } else if (player1_buttons & INPUT_MASK_RIGHT) { | ||
| + | ... | ||
| + | } | ||
| + | if (player1_buttons & INPUT_MASK_UP) { | ||
| + | ... | ||
| + | } else if (player1_buttons & INPUT_MASK_DOWN) { | ||
| + | ... | ||
| + | } | ||
| + | // players_old_buttons is used to make sure users press and release the button | ||
| + | if (player1_buttons & ~player1_old_buttons & INPUT_MASK_A) { | ||
| + | ... | ||
| + | } | ||
| + | |||
| + | ===== Testing in the Emulator ===== | ||
| + | |||
| + | * The first controller is using the arrow key for directions and ZXC for the buttons | ||
| + | * The second controller is using TFGH for directions and Tab QW for the buttons | ||
| + | |||
