danShumway / python_math

A puzzle game designed to teach early math concepts about addition, subtraction, and order of operation.
MIT License
6 stars 2 forks source link

Getting Keyboard Input to work #14

Closed mstubinis closed 10 years ago

mstubinis commented 10 years ago

As seen in class today, we managed to get our game running on the XO. However keyboard input did not work. Although not tested, it is possible that mouse input might not work either.

We need to figure out how to fix the input issues or change our control setup. There was a similar problem by another individual on this issue. https://github.com/platipy/spyral/issues/13

We should try to download and build some spyral example games to see how they (if their input works) got their input working.

mstubinis commented 10 years ago

I took a look at the spyral hangman example located here. https://github.com/platipy/colgadito-spyral

This example, when built to the .xo file and installed on the OLPC does have their keyboard input working. We should dissect this example to see how they did it, or see if they have a more recent version of their libraries that we do not yet have.

danShumway commented 10 years ago

I thought that their keyboard class was pretty much the same, but it could easily be other things. I can look through their actual game files and see what they're doing if you want.

mstubinis commented 10 years ago

Alright I got keyboard input to work for our build. What was wrong was either 1 of 2 things (or both).

My input class was registering keyboard events and overlapping with those of currently running scenes. I removed all instances of this from the build and just defined keyboard events when needed.

The update loop itself was causing the bug. The current build I got working does not use any update methods or update method events. However I don't think this is the real issue.

I can see where the professor said to be careful when working on a windows machine. Loading in the text file for the level is producing some artifacts related to the extra hidden characters he mentioned to us.

danShumway commented 10 years ago

Awesome, thanks a ton - this means we can close off both #14 and #10.

The text level thing is a bit of a pain though, because I'm not sure there's any great way to deal with it short of jumping into a linux machine and manually chopping that stuff off whenever we make/edit levels. I wonder if wordpad or sublime text would have the same issues?