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?
Negative lower confidence interval boundary for variance with nlcom after a multilevel logistic regressionHello, I am conducting a multilevel logistic regression to identify determinants of the availabilit…
Using mata to create matrixI'd like to create a matrix shown in the figure. It's a NC*(N+C) matrix. All N block matrixes on the…
Long Data Format: Creating a New Variable with Values Conditional on Combination of Values of Other Variables Across Many ObservationsHello! I am stuck not knowing how to create a variable I need based on my current data. I have a l…
How to graph difference in means between model 1 and model 2Hi Statalist, I will appreciate help with this problem. First, here is my data: Code: * Example g…
total dose per day with multiple dates and times Code: * Example generated by -dataex-. To install: ssc install dataex clear input int(date_daily_3…
Subscribe to:
Post Comments (Atom)
0 Response to Is it possible to make the computer game "pong" in stata?
Post a Comment