Converting Old Text-based BASIC games.

Creating Games? Developing something for fun?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Converting Old Text-based BASIC games.

Post by Hutchboy » Fri Jul 19, 2024 4:14 am

Hi,

Attached is a kind of addictive game, "Chase", I ported from "More BASIC Computer Games". published by Creative Computing Press, copyright 1979. In this text-based game your player needs to avoid and eliminate "intercepters" that try to catch you while you also need to avoid electrified fences.

I kept the game close to the original, just adding some color to the text game board display and adding a navigational keypad to make it easier to play.

Happy Coding,
Mike
Attachments
Chase_in_Color.livecode.zip
(4.38 KiB) Downloaded 64 times

Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Converting Old Text-based BASIC games.

Post by Hutchboy » Fri Jul 19, 2024 2:16 pm

Hi,

Here is another interesting game, "Chomp" that had its origins in a January 1973 issue of Scientific American magazine. The game was described in an article by Martin Gardener. A BASIC version of this game is included in the book "BASIC Computer Games" by Creative Computing, copyright 1978.

My LiveCode implementation is pretty close to the original except I used HTML formatting to introduce colored text. I'm a bit new to working in HTML so I am having a bit of a struggle getting the title "Chomp" to be centered in the GameBoard field. Suggestions welcome.

Have fun with "Chomp"...there may be a few more of these coming. They are short and fun to code.

Mike
Attachments
Chomp.livecode.zip
(3.68 KiB) Downloaded 77 times

Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Converting Old Text-based BASIC games.

Post by Hutchboy » Wed Jul 24, 2024 8:10 pm

Hi, here is another Basic program I have adapted for LiveCode. This one is an ASCII art generator based on "Love.bas" from the "BASIC Computer Games" book. I added some colorization and the ability to save the color output to a .rtf file.

Mike
Attachments
LOVE asci art.livecode.zip
(4.09 KiB) Downloaded 42 times

Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Converting Old Text-based BASIC games.

Post by Hutchboy » Sat Aug 17, 2024 3:29 am

Hi,
Here is a nice game of GOMOKU adapted from the GOMOKU.bas listing found in "More Basic Computer Games" by David Ahl & Steve North, Workman Pub 1979.

I started off with a straight port but then added 3 levels of play depending on how smart you want your computer component to be. These "AI" methods are discussed a bit in the Stack Script if you're interested. There is also a debug field you can toggle on and off if you want to follow how the computer is responding to your moves.

In the original basic game it permitted a grid 19 x 19 but I trimmed it down to 15 x 15 for legibility's sake.

Happy coding,
Mike
Attachments
GOMOKU.livecode.zip
(5.28 KiB) Downloaded 33 times

Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Converting Old Text-based BASIC games.

Post by Hutchboy » Wed Sep 25, 2024 12:58 pm

Hi,

Another text-based game that has been converted to a number of programming language is "Super StarTrek".

In developing my version I want to add in some real world star data showing travel times to distant stars at various warp speeds.

Attached is this calculator which you might find useful. If you follow my naming convention you can easily add other stars, galaxies or other celestial objects to the left field on the card.

Mike

P.S. On the second card is the beginning of a scheme to be able to generate, by script, a given constellation for display in some fashion in a game or app. I simply took an image of a constellation, placed graphic objects where the key stars are in the image, then grouped those objects. The button simply loops through the group and records the data for subsequent use.
Attachments
Star Distance Warp Speed Calculations.livecode.zip
(6.58 KiB) Downloaded 260 times

Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Converting Old Text-based BASIC games.

Post by Hutchboy » Fri Sep 27, 2024 10:55 pm

Hi,

For a text-based game I wondered if I could implement a warp field effect using just text fields.

In the attached stack the first card demonstrates a text only warp field effect.

On the second card I experimented with adapting the code to handle messages. I cheated a bit on card two by overlaying the text fields with a couple of rotated triangle graphic objects. I might be able to adapt this to a poor man's Star Wars scrolling text effect.

Mike

[file deleted and superseded in next post - MR]

Hutchboy
Posts: 82
Joined: Wed Aug 01, 2018 2:57 pm
Contact:

Re: Converting Old Text-based BASIC games.

Post by Hutchboy » Sun Sep 29, 2024 2:39 am

Hi,

Attached is an improved version of the text-based warp field effects stack. I added a new 1st card that adds a gradient to enhance the warp field effect as well as to allow you to change color.

Mike
Attachments
Text Based Warp Field Effects version 1.1.livecode.zip
(6.78 KiB) Downloaded 275 times

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4089
Joined: Sun Jan 07, 2007 9:12 pm

Re: Converting Old Text-based BASIC games.

Post by bn » Sun Sep 29, 2024 7:33 pm

Hi Mike,

Thanks for posting this stack. It is a pretty nifty solution.

some observations:
If you add a lock screen

Code: Select all

on animateText
   if not sAnimating then exit animateText
   
   lock screen
   ...
   ...
   -- more code
You decrease the time spent in handler "animateText" to 1 10th of the time without lock screen since you work intensively on the text fields.

Furthermore: once you started the animation hit button "Toggle Direction" repeatedly, 6 to 10 times and see what happens.

Either you leave it the way it is as a feature or have a look at the "pendingMessages"

There is no "vTextAlign" of a field in LC. Maybe you mean "textAlign" and "center"?

Thanks again for this nice stack.

Kind regards
Bernd

Post Reply

Return to “Games”