![]() |
Forum Index : Microcontroller and PC projects : CMM2 - Tank versus UFO
Author | Message | ||||
Schlowski Newbie ![]() Joined: 26/03/2014 Location: GermanyPosts: 29 |
As a snake clone already exists I took the chance to make a conversion of the classic Tank versus UFO from the VIC-20 user manual. As the CMM2 is a little bit more powerful than the good old VIC it should be called Tank versus UFOs. I tried to auto-detect Nunchuks and Classic controllers in ports 1 to 3, support the digital joystick with the following pins as in the CMM2 deluxe const DUP = 35 const DDOWN = 36 const DLEFT = 38 const DRIGHT = 40 const DFIRE = 32 Any button on the digital or classic controller or nunchuk including shoulder buttons and select, home or start act as fire buttons. Any directional control, analog or digital can be used to move your tank left or right. Of course it's possible to play with keyboard, use cursor keys to move and space to fire. There's no sound as I'm worse in sound compared to graphics :-) Or positively spoken it's only a single .bas file with no additional files and can be started from anywhere. ![]() ![]() TankVersusUFO.zip |
||||
Plasmamac![]() Guru ![]() Joined: 31/01/2019 Location: GermanyPosts: 579 |
Hahaha Asci ! Genial Plasma |
||||
vegipete![]() Guru ![]() Joined: 29/01/2013 Location: CanadaPosts: 1132 |
Awesome! Well done! Visit Vegipete's *Mite Library for cool programs. |
||||
Schlowski Newbie ![]() Joined: 26/03/2014 Location: GermanyPosts: 29 |
Thank you :-) |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5089 |
New challenge: change it into dual player. One plays the WASD keys, the other the arrow keys. Two tanks versus UFO's... PicomiteVGA PETSCII ROBOTS |
||||
Schlowski Newbie ![]() Joined: 26/03/2014 Location: GermanyPosts: 29 |
Challenge accepted! Here you go, Multiplayer Tanks vs. UFOs, up to 4 players. Freely configurable user inputs, multiple keyboard controls possible: ![]() Multiplayer arcade action for your home: ![]() If you switch the colors in the configuration to all players white the confusion is perfect :-) Hopefully not too many bugs, it's really difficult to test a multiplayer game as a single developer! TanksVersusUFOs.zip |
||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
Schlowski, Kudos for your accomplished challenge. The result was beyond expected, very good!! |
||||
Schlowski Newbie ![]() Joined: 26/03/2014 Location: GermanyPosts: 29 |
Thank you, I have tons of fun tinkering around with my new toy. MMBasic is a very cool tool with it's SUBs and local variables and so on. Only thing I'm really missing are structs or records, for TvU I went on using a lot of Arrays. tx() for tank x-coordinates ty() for tank y-coordinates tl() for tank lives ux() for UFO x-coordinates uy() for UFO y-coordinates etc. It's very readable but makes the code a little bit convoluted... For more complex structures I'm thinking of using strings as binary blobs and packing and repacking data in and out of strings. I'm sure this needs some thorough testing for speed and function. Maybe that would be something for CSUBs, but I'm anxious to loose control over when to use BASIC and when to use CSUBs as you could do everything in a CSUB. So many new frontiers... |
||||
jirsoft![]() Guru ![]() Joined: 18/09/2020 Location: Czech RepublicPosts: 533 |
With the limitation of 3 types in MMBasic, I'm using more ways how to replace missing types: 1. STRINGS (and STRING arrays), for example when use DIM STRING x(100) LENGTH 2 and STR2BIN(), BIN2STR$() with UINT16, it takes less memory than INTEGER. You can also pack more variables in one STRING 2. LONGSTRING or binary data with PEEK/POKE 3. more dimensions for ARRAYs, DIM INTEGER coord(n,2), where coord(n,0) is X... Just my few cents... Jiri Napoleon Commander and SimplEd for CMM2 (GitHub), CMM2.fun |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |