Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ButtonState = {
- eventCountThisFrame: number;
- isDown: boolean;
- }
- ButtonStates[] = []
- onmousedown()
- {
- if button == left {
- // or use an enum
- ButtonStates[0].eventCountThisFrame += 1;
- ButtonStates[0].isDown = true;
- }
- if button == right {
- // or use an enum
- ButtonStates[1].eventCountThisFrame += 1;
- ButtonStates[1].isDown = true;
- }
- }
- render()
- {
- // do all the shit
- for each buttonstate
- {
- ButtonStates[i].eventCountThisFrame = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement