new game (need loop fix)

All discussions about the Atari 8bit range of machines.

Moderators: Mug UK, Silver Surfer, Moderator Team

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

new game (need loop fix)

Postby MrPixel » Sun Feb 18, 2018 1:58 am

so, this is the commented Demo for Chaos in L.A

2 problems:

1: i need a way to allow multiple choice through the IF-THEN statements
2: i need a way to STOP the choice and allow another if necessary. my goal is to allow multiple choices, but loop back to start upon death (the Hobbit for example)

e.g (go to house. you have found a gun, use gun on tank etc...)

but all i have is the IF statement and the if f is < > or = statements.

please help

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sun Feb 18, 2018 1:59 am

this is the Demo

sorry if it's not in CAS form, this site can only allow 4 MB images

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Sun Feb 18, 2018 5:17 am

I'd recommend using a state machine for a game
You should have three sub states for each state, init, logic, and exit.
You then call a reentrant function repeatedly and change states when required. The game runs as a tick until the state changes.

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sun Feb 18, 2018 8:13 pm

um...in english?

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Mon Feb 19, 2018 6:38 pm

Google for state machine and game :)

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sat Feb 24, 2018 2:14 am

i did. no use

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Sat Feb 24, 2018 7:55 am


jruark56
Atari freak
Atari freak
Posts: 64
Joined: Sun Nov 09, 2008 2:58 am

Re: new game (need loop fix)

Postby jruark56 » Sat Feb 24, 2018 11:38 pm

MrPixel,
Might help if we could see some code example of what you have that is not working.
You might not be that far along, though. It's OK if you're not.
Russ Ruark Jr.

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sun Feb 25, 2018 12:49 am

i had deleted it. sorry. i could make an MSX version but the commands for lines and such aren't working. i keep getting an illegal function call for the PSET command

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sun Feb 25, 2018 2:51 am

i checked the site. that's for C

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12485
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: new game (need loop fix)

Postby wongck » Sun Feb 25, 2018 4:23 am

MrPixel wrote:i checked the site. that's for C

well.... i guess it kind of answers your question in your other thread.
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Sun Feb 25, 2018 8:40 am

The language shouldn't matter. Just focus on the concepts. Writing a game without a state machine will result in a spaghetti mess. I can tell you that from experience :)

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sun Feb 25, 2018 9:36 pm

let me rephrase: how do i make a state machine in BASIC? preferably for MSX?

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Sun Feb 25, 2018 9:37 pm

wongck wrote:
MrPixel wrote:i checked the site. that's for C

well.... i guess it kind of answers your question in your other thread.


C is the language infants use to make games.

are you an infant?

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Mon Feb 26, 2018 7:13 am

MrPixel wrote:let me rephrase: how do i make a state machine in BASIC? preferably for MSX?


I'm sure it's possible. If not perhaps switch to another language :D

User avatar
spiny
Disk Imager Supreme
Disk Imager Supreme
Posts: 2493
Joined: Mon Aug 11, 2003 11:53 pm
Location: just outside bristol
Contact:

Re: new game (need loop fix)

Postby spiny » Mon Feb 26, 2018 9:05 am

MrPixel wrote:let me rephrase: how do i make a state machine in BASIC? preferably for MSX?



have you considered posting on an MSX forum ?

User avatar
spiny
Disk Imager Supreme
Disk Imager Supreme
Posts: 2493
Joined: Mon Aug 11, 2003 11:53 pm
Location: just outside bristol
Contact:

Re: new game (need loop fix)

Postby spiny » Mon Feb 26, 2018 9:05 am

MrPixel wrote:
wongck wrote:
MrPixel wrote:i checked the site. that's for C

well.... i guess it kind of answers your question in your other thread.


C is the language infants use to make games.

are you an infant?



because with posts like this, people on here probably aren't going to help you.

User avatar
shoggoth
Nature
Nature
Posts: 944
Joined: Tue Aug 01, 2006 9:21 am
Location: Halmstad, Sweden
Contact:

Re: new game (need loop fix)

Postby shoggoth » Mon Feb 26, 2018 10:53 am

I guess most doers are infants, then.
Ain't no space like PeP-space.

User avatar
wongck
Ultimate Atarian
Ultimate Atarian
Posts: 12485
Joined: Sat May 03, 2008 2:09 pm
Location: Far East
Contact:

Re: new game (need loop fix)

Postby wongck » Mon Feb 26, 2018 12:04 pm

Come to think of it, I never wrote any games in C.
The only game I wrote but was not finished was for the Apple ][, while waiting for my Uni results.
It uses High-rez mode for drawing with text on the bottom few lines for user interfacing/status text.
Moves your planes & ships using an array of 8 keys to denote the compass directions plus some other key for action.
Complete until the part of trying to figure out how the battle would be like when you find the enemy.
Since it was the early days, was done in Applesoft Basic with some assembler for sound/graphics.
My Stuff: FB/Falcon CT63/CTPCI+ATI+RTL8139+USB 512MB 30GB HDD CF HxC_SD/ TT030 68882 4+32MB 520MB Nova/ 520STFM 4MB Tos206 SCSI
Shared SCSI Bus:ScsiLink ethernet, 9GB HDD,SD-reader @ http://phsw.atari.org
My Atari stuff for sale - click here for list

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Mon Feb 26, 2018 12:56 pm

I've written games in J2ME, 6502 assembler and C. I used a state machine for each. I had to make a fairly complex game front end navigable backwards and forwards on the GBA. It got unwieldy and I replaced it with a state machine. Much easier.

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Mon Feb 26, 2018 3:57 pm

sorry for the post, i wasn't thinking straight. anyway, how would i implement a state machine in MSX basic? what commands would i need?

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 971
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: new game (need loop fix)

Postby Frank B » Mon Feb 26, 2018 4:11 pm

MrPixel wrote:sorry for the post, i wasn't thinking straight. anyway, how would i implement a state machine in MSX basic? what commands would i need?


I don't know basic. You'd need a function which returns a value and a calling routine above it with a switch statement or a load of ifs.
You'd need a global which holds the current state. Depending on the value returned it would call the relevant function. A value of say -1 would mean continue calling the current function over again. The callee can switch states by returning different values. You might want to add sub states for init and finalize. This is an example in basic http://www.protonbasic.co.uk/content.ph ... e-Machines

FedePede04
Atari God
Atari God
Posts: 1072
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: new game (need loop fix)

Postby FedePede04 » Mon Feb 26, 2018 6:05 pm

i used to code a lot in basic on the msx, did several games on it, but don't remember any of it :'(

but try look here, this seem like a good place to find information about the MSX
https://www.msx.org/

don't know if it is something like this you are looking for

https://www.msx.org/wiki/ON...GOTO

https://www.msx.org/wiki/ON...GOSUB
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Mon Feb 26, 2018 10:46 pm

i understand how it works but i need an equivalent in Basic. otherwise, it's useless. as we have an atari 800 at school, i'll need to teach this eventually

MrPixel
Captain Atari
Captain Atari
Posts: 191
Joined: Mon Jan 08, 2018 4:31 am

Re: new game (need loop fix)

Postby MrPixel » Mon Feb 26, 2018 10:59 pm

will C basic work?


Social Media

     

Return to “The Atari 8bit corner”

Who is online

Users browsing this forum: No registered users and 3 guests