Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / How to make this one player game a two player one?

Author
Message
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 16th Oct 2002 14:42
Hi everyone,

Like I said before, I'm kinda a newbie. I programmed AMOS on the Amiga for years (still do) and therefore don't get why I'm still so clueless with DarkBasic. However I'm learning.

Anyway, I wanted to turn this one player soccer game into a two player one, the other team doesnt seem to be doing anything anyway and it seemed fun to do so. What I was trying to go for is make the yellow team operated by the numeric keypad, of course the keys for shooting goals etc should also be available for the other player.... but I'll be damned if I know how those guys are operated. I did manage to get them holding the ball, and I tried going for the p2 value and such, but it wont work.

The source is downloadable here: http://www.estate3.com/DSOCCER.zip

Please help me out here, I'm at a total and utter loss.

Thanks in advance!
www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
Zero
21
Years of Service
User Offline
Joined: 28th Aug 2002
Location: Finland
Posted: 16th Oct 2002 16:28
Just loop the AI algorithm for all players..

The evil plan is now even closer!
- - - - - - - - - - - - - - - - - - - -
Specs:- P3 550 Nvidia TNT2M64, 192Mb RAM
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 16th Oct 2002 19:46
How do you mean? Got any example code? And wouldnt that result in the two games playing eachother without you being able to play?

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 18th Oct 2002 19:43
Can anyone help me out on this one, please?

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
Mirthin
21
Years of Service
User Offline
Joined: 13th Oct 2002
Location: Land of the Rising Haggis
Posted: 18th Oct 2002 23:23
Zero means that you can use the same code, just change the variables to suit the second player.
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 19th Oct 2002 16:13
Thats the weird part, I tried the same thing with this piece of code in the program:

if upkey() then dir1=0 : if swapview>1 then dir1=90
if downkey() then dir1=180 : if swapview>1 then dir1=270
if leftkey() then dir1=270 : if swapview>1 then dir1=0
if rightkey() then dir1=90 : if swapview>1 then dir1=180
if upkey() and rightkey() then dir1=45 : if swapview>1 then dir1=135
if upkey() and leftkey() then dir1=315 : if swapview>1 then dir1=45
if downkey() and rightkey() then dir1=135 : if swapview>1 then dir1=225
if downkey() and leftkey() then dir1=225 : if swapview>1 then dir1ye=315
`orientation (TIR INACTIF)
if power#=0 then yrotate object p2,dir1

I first figured to test it to move the yellow team, so I figured p2 must be changed to p1 and it didnt work, I also tried changing dir1 to dir2 and some other combinations but I can't find the values for the yellow team.

It's very odd, that's why I asked your help. :/

Stuff like this should be easy, like I said before I programmed basic for years. Maybe I have been out of it too long

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 19th Oct 2002 17:22
Well, you'll need to use different keys (try using keystate), and you should change all the dir1's to dir2, and change p1 to p2. If you keep dir1 with p1 and dir2 with p2, then it should all work.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 19th Oct 2002 22:58
I tried this:

if KEYSTATE(31)=1 then dir2=0 : if swapview>1 then dir2=90
if KEYSTATE(30)=1 then dir2=180 : if swapview>1 then dir2=270
if KEYSTATE(32)=1 then dir2=270 : if swapview>1 then dir2=0
if KEYSTATE(17)=1 then dir2=90 : if swapview>1 then dir2=180

But it wouldnt work, the characters wouldnt even react

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 21st Oct 2002 16:27
Still need help with this one.... anyone?

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 22nd Oct 2002 18:29
Anyone?

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
ChipOne
21
Years of Service
User Offline
Joined: 12th Sep 2002
Location: Canada
Posted: 22nd Oct 2002 22:21
Hey mm,

this is for db1, not pro, right? It won't compile for me under pro, but i'll reinstall my copy of db1 tonight and have a look for you.

cheers.

-= i only do what my rice krispies tell me to do =-
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 23rd Oct 2002 01:50
Hey thats weird, isn't DBPro backwards compatible? And yes this is still under the older DB I haven't purchased pro yet but as soon as I can I will definatly.

Thank you very much for looking into this!

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 30th Oct 2002 14:01
Still need help with this one. :+

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.
HippyGoth
21
Years of Service
User Offline
Joined: 4th Oct 2002
Location: United States
Posted: 31st Oct 2002 05:06
I personally think the best way to make a 1 player game into a 2 player game is start from scratch, implementing any new code techniques and AI improvements.

Not to be nasty, but this is a good lesson on game designing, always think ahead, and decide on everything before you do a single line of code. In my C64/Amiga days, I could easily spend 2 months just designing before even touching the assembler.

Eddie.
MiRRoRMaN
21
Years of Service
User Offline
Joined: 9th Oct 2002
Location: Netherlands
Posted: 3rd Nov 2002 00:11
Yeah I know, but in this case im experimenting. it always works the best for me for learning.

www.mirrorman.cjb.net, the classic Commodore 64 and Amiga site.

Login to post a reply

Server time is: 2024-04-24 11:25:01
Your offset time is: 2024-04-24 11:25:01