» Electronics » Arduino »We play in one dimension - 2

We play in one dimension - 2



Transferring classic video games from two dimensions to one can give interesting results. I have already translated an article by Instructables under the nickname mischka about a corresponding experiment with a game similar to Pong. And the author of the same site under the nickname Infinityspace transferred a game similar to Duck Hunt to one dimension. Its design is a slightly modified version. homemade another author of the same site, under the nickname Joe_barhouch, about whom he spoke here.

The plot of the game is as follows: a duck flies past the hunter, and you need to press the button at the moment when it is directly above the hunter. However, classic video games are so minimalistic, and even more so after being transferred to one-dimensional space. It does not know what is “above”, and it is believed that in the middle of a single-line display the distance between the duck and the hunter is equal to zero, therefore, the fact that the flight speed of the fraction is finite is not taken into account, and the lead that is taught in the real world of hunters first is not required in this game.

A duck is reusable, because in a one-dimensional space it has nowhere to fall. When the hunter gets into it, it blinks, and ... continues to fly further, but at a faster speed. The increase in speed with each hit continues until the hunter starts to miss. If he misses five times, not even in a row, the duck, teleporting to the beginning of the line (it turns out to teleport in one-dimensional space is a simple and mundane thing, like walking or riding in two-dimensional or three-dimensional space), rests and gives the hunter a rest, after which the game begins again at low speed.



Yes, this is not for you, pay attention to the use of Ctrl + C there in the same meaning as it is used so far in consoles of modern UNIX-like operating systems (the following video was shot by Sergei Frolov):



But let’s return to the Infinityspace workshop - he is eager to experiment with one-dimensional space, even virtual one, so he urgently prepares a button, LEDs, dupont jumpers, a USB cable for Arduino and current limiting resistors:

We play in one dimension - 2



Makes up the Fritzing program for connecting LEDs to resistors. All LEDs are connected by anodes to Arduino pins, cathodes to resistors, opposite resistor pins are connected to a common wire. The button in the diagram is not shown; when pressed, it connects the Arduino pin 13 to a common wire. It is recommended to pull it up with a resistor, or turn on the output 13 of the internal pull-up resistor programmatically.



The following is a list of the Arduino pins involved:

LED 1 - pin 2
. . .
LED 9 - pin 10
Button - pin 13.

Sketch master spreads here. If you wish, you can edit it so that you can miss the duck not 5 times, but, say, 100. And remember the ZX Spectrum and cheating by the POKE team for special brochures. The features of the program are comments in Chinese, as well as output to the serial port monitor messages about events occurring during the game.

The master makes the game case out of a cardboard box, although plastic, plywood, sheet metal, etc. can be used for this. The most budgetary, but at the same time durable case is a junction box. When transferring home-made products to the case, it is recommended to remove the breadboard and the Dupont jumpers - they are useful for debugging the following projects - and connect everything by soldering.









With sufficient imagination, you can come up with one-dimensional analogues of other classic games. And even make a single console for them with a line of LEDs and several buttons, in which microcontrollers with various one-dimensional games can be changed like cartridges. One-dimensionality is not the only direction in applying the KISS principle to games. There are also audio games where the image is missing, and the player receives all the information in the form of sounds. Initially, such games were developed for the blind, but then those who wanted to play in them were found among the sighted.
4.3
1.7
5

Add a comment

    • smilesmilesxaxaokdontknowyahoonea
      bossscratchfoolyesyes-yesaggressivesecret
      sorrydancedance2dance3pardonhelpdrinks
      stopfriendsgoodgoodgoodwhistleswoontongue
      smokeclappingcraydeclarederisivedon-t_mentiondownload
      heatirefullaugh1mdameetingmoskingnegative
      not_ipopcornpunishreadscarescaressearch
      tauntthank_youthisto_clueumnikacuteagree
      badbeeeblack_eyeblum3blushboastboredom
      censoredpleasantrysecret2threatenvictoryyusun_bespectacled
      shokrespektlolprevedwelcomekrutoyya_za
      ya_dobryihelperne_huliganne_othodifludbanclose

We advise you to read:

Hand it for the smartphone ...