I'm trying to make a (simplified) version of the 1972 arcade game "Pong" in Stata but I've run into some difficulties. However, I'm not making pong in Stata because it is easy, but because it is hard.
The idea is write the program entirely in ado, and to use Stata's plotting library for the UI. The first sticking point is that the high level graphics function is too slow to capture the motion of the paddle and ball. I tried to draw the plot on the first iteration, then use 'display' to update the plot as the objects "move". It redraws much faster this way, but I don't appear to be able to use display to change the coordinates of the plotted objects. graph7 is fast enough for a flickery but functional UI prototype, but I don't like that its out of date. Still, I may be able to figure out how to consume the low level graphics stuff later.
The second sticking point is that there doesn't appear to be a good way to get Stata native keyboard interrupts for user input. Getting input from the keyboard or mouse seems much more difficult. I thought about writing a plugin for this but it would be cheating.
Any advice? The current source covers a few files and is a bit too much to post here but I'd gladly put it up on github if there were some interest. Everyone needs a hobby, right?
Related Posts with Is it possible to make the computer game "pong" in stata?
Chi-square for subsampleHi all, A snapshot of my data is below (I have 950 data points, so its only a small section). I am r…
drop/keep with multiple conditional statementHi everyone, A sample of my data looks as follows (my current data). I am trying to keep those obser…
trend and timeI want regress difference model in panel data. using two year data, for example, I want to estimate …
Alternative of Cronbach alpha (for single item measures)Hi, I've data on patients subjective health measured by a single question "How is your health today"…
generating a new var and replacing its values with the previous year's valuesHi everyone, A sample of my data looks as follows (my current data ). As you can see, the person 1's…
Subscribe to:
Post Comments (Atom)
0 Response to Is it possible to make the computer game "pong" in stata?
Post a Comment