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 Discussion / how would i do player turns?

Author
Message
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 14th Nov 2003 00:19
i have it so


but the problem with that is playerturn = 1 so it changes to 2 then it goes to the next line and then changes back to 1

i also tried


any ideas?

Two words, moo.
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 14th Nov 2003 02:39
in the player one code put in :

if mouseclick() = 1 then playerturn = 2


then in player two code put in :


if mouseclick() = 1 then playerturn = 1

hpe i helped
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 14th Nov 2003 04:09 Edited at: 14th Nov 2003 04:13
wait. i have to separate the two codes? why?
but i kinda got it working...sometimes. it will sometimes work, and usually wont.
heres my code for now. its quite small for the time being, and pretty cluttered. but i will sort everything soon as i get it working as i want for the most part


also, i figured out what i did wrong in that second code i posted earlier
i changed



to



Two words, moo.
Cookyzue
21
Years of Service
User Offline
Joined: 12th Oct 2003
Location: Who Cares?!
Posted: 15th Nov 2003 02:05
this should work:

if mouseclick()=1 and playerturn=1 then playerturn=2
if mouseclick()=1 and playerturn=2 then playerturn=1
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 15th Nov 2003 10:24
Ok... i think Cookyzue really doesn't understand how this is meant to work... But, good try though...

You currently have:


What you need to have is another variable...
m guessing that this is part of a menu, with a button that says change player os somethign to that effect... so, i will name the variables accordingly.



I know, it seems really hard to figure things like this out sometimes and they can be the simplest problems, but never be afraid to ask the question for help, cos i am always willing to help...

Hope I Helped...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 15th Nov 2003 19:32
this works:


this doesnt



Two words, moo.
Turoid
21
Years of Service
User Offline
Joined: 1st Nov 2003
Location: The Netherlands
Posted: 15th Nov 2003 20:43
maybe this?



lalala
JoelJ
21
Years of Service
User Offline
Joined: 8th Sep 2003
Location: UTAH
Posted: 15th Nov 2003 20:54
this WORKS


it works fine. dont worry about it anymore. thanx tho guys

Two words, moo.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 16th Nov 2003 05:02
lol...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-05-21 16:10:28
Your offset time is: 2025-05-21 16:10:28