Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Help with Tic Tac Toe game
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
slipstream




PostPosted: Tue Jan 17, 2006 12:57 pm   Post subject: Help with Tic Tac Toe game

hey guys, i need some help with my game and im totally new to programming, alright well i started my game i put down all the instructions and my intro and all, but when i added my boxes for teh game it didnt show up anywhere......and the intro and instructions still stay there, my question is how do i make my game so that after all the intro it starts at a blank page and then the box will appear?
Sponsor
Sponsor
Sponsor
sponsor
sylvester-27




PostPosted: Tue Jan 17, 2006 1:12 pm   Post subject: (No subject)

Slipstream wrote:
Quote:
hey guys, i need some help with my game and im totally new to programming, alright well i started my game i put down all the instructions and my intro and all, but when i added my boxes for teh game it didnt show up anywhere......and the intro and instructions still stay there, my question is how do i make my game so that after all the intro it starts at a blank page and then the box will appear?


well you should probably clear the screen (cls) after you want your intro to disappear. Then you should draw your boxes and such and move on.
codemage




PostPosted: Tue Jan 17, 2006 1:24 pm   Post subject: (No subject)

If you're using offscreenonly and View.Update, make sure you're using them consistently.
Albrecd




PostPosted: Tue Jan 17, 2006 2:01 pm   Post subject: (No subject)

Posting your code is much more helpful for those of us who want to help you than futilely trying to describe what happens. If you're worried about people stealing it, you can delete it afterwards. (but think about it... if we're helping you with you're code, we are probably capable of writing our own code, and don't need to steal yours)
slipstream




PostPosted: Tue Jan 17, 2006 3:45 pm   Post subject: (No subject)

its such a newbie thing...but i havnt written much codes...


%CULMINATING ACTIVITY
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% Intro and Instructions ^
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
setscreen ("graphics")
locatexy (209,380)
put " Welcome to Tic Tac Toe Game "
delay (1000)
locatexy (220,350)
put " This is a Two person game "
delay (2000)
locatexy (280,310)
put " How To Play "
delay (1500)
locatexy (90,290)
put " 1. Choose which player will be represented by X and which by O. "
delay (1500)
locatexy (50,280)
put " 2. Let player X go first. He or she may put an X in any of the 9 boxes. "
delay (1500)
locatexy (240,270)
put " 3. O player go next. "
delay (1500)
locatexy (70,250)
put " 4. Alternate until either there are three in a row of one symbol "
locatexy (150,230)
put " or the boxes are filled and no one has won. "
delay (2000)
cls

%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
% This creates all of the boxes ^
%^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cool dude




PostPosted: Tue Jan 17, 2006 4:17 pm   Post subject: (No subject)

either your code got cut off or u didn't post all of it b/c no where in the code are you drawing your boxes. another thing instead of those quick delays which i can't finish reading the instructions screen u should have a getch command to get any key to continue.

anyways post the code where u draw the buttons and we'll go from there Smile
slipstream




PostPosted: Tue Jan 17, 2006 10:10 pm   Post subject: (No subject)

For my boxes
drawfillbox (100, 160, 175, 75, brightred)
drawfillbox (170, 160, 240, 75, black)
drawfillbox (240, 160, 310, 75, brightred)
drawfillbox (100, 240, 170, 159, black)
drawfillbox (170, 240, 240, 160, brightred)
drawfillbox (241, 240, 310, 160, black)
drawfillbox (100, 325, 169, 241, brightred)
drawfillbox (170, 325, 240, 240, black)
drawfillbox (241, 325, 310, 241, brightred)

seems to be working right now but do i have to add another part other tahn just "drawfillbox"??
Clayton




PostPosted: Tue Jan 17, 2006 11:17 pm   Post subject: (No subject)

slipstream wrote:
For my boxes
drawfillbox (100, 160, 175, 75, brightred)
drawfillbox (170, 160, 240, 75, black)
drawfillbox (240, 160, 310, 75, brightred)
drawfillbox (100, 240, 170, 159, black)
drawfillbox (170, 240, 240, 160, brightred)
drawfillbox (241, 240, 310, 160, black)
drawfillbox (100, 325, 169, 241, brightred)
drawfillbox (170, 325, 240, 240, black)
drawfillbox (241, 325, 310, 241, brightred)

seems to be working right now but do i have to add another part other tahn just "drawfillbox"??


wat do you mean by that, what else r u trying to achieve, if you are just trying to draw the squares then that is all you need otherwise tell us wat you are trying to do and maybe we will be able to help you out more
Sponsor
Sponsor
Sponsor
sponsor
jam jam




PostPosted: Wed Jan 18, 2006 12:51 am   Post subject: (No subject)

i need help on that too...i have to that for summative. I only got the boxes but how do you do the mouse.button choose and the if then else?
sylvester-27




PostPosted: Wed Jan 18, 2006 12:53 pm   Post subject: (No subject)

Quote:
or my boxes
drawfillbox (100, 160, 175, 75, brightred)
drawfillbox (170, 160, 240, 75, black)
drawfillbox (240, 160, 310, 75, brightred)
drawfillbox (100, 240, 170, 159, black)
drawfillbox (170, 240, 240, 160, brightred)
drawfillbox (241, 240, 310, 160, black)
drawfillbox (100, 325, 169, 241, brightred)
drawfillbox (170, 325, 240, 240, black)
drawfillbox (241, 325, 310, 241, brightred)

seems to be working right now but do i have to add another part other tahn just "drawfillbox"??

Why are you using drawfillbox? If your making a tictactoe game it might be easier if you just keep them to drawbox. Also, have you actually started to code the program or are you just drawing boxes and making intros right now. I don't know if we can help you without actually writing the code because there is nothing really to help with.
Albrecd




PostPosted: Wed Jan 18, 2006 1:01 pm   Post subject: (No subject)

Quote:
If your making a tictactoe game it might be easier if you just keep them to drawbox.

Why would you use Draw.Box for Tic-Tac-Toe? I think what he has looks fine.

Quote:
how do you do the mouse.button choose and the if then else?

You shouldn't need to use a multi button mouse for This game, and the mouse is automatically set to single button, so I don't think you need this.
sylvester-27




PostPosted: Wed Jan 18, 2006 1:04 pm   Post subject: (No subject)

Quote:
Quote:
If your making a tictactoe game it might be easier if you just keep them to drawbox.

Why would you use Draw.Box for Tic-Tac-Toe? I think what he has looks fine.

Well the reason i suggested Draw.Box is because otherwise the boxes look more like checkers with the red and black pattern. You don't have to take my advice though. But still write your code and if you have problems such as its not working, then ask for help
codemage




PostPosted: Wed Jan 18, 2006 1:43 pm   Post subject: (No subject)

As a matter of principle, you're drawing five too many boxes.

code:
drawfillbox (100, 75, 310, 325, brightred)
drawfillbox (170, 75, 240, 325, black)
drawfillbox (100, 160, 310, 240, black)
drawfillbox (170, 240, 240, 160, brightred)
Cervantes




PostPosted: Wed Jan 18, 2006 2:38 pm   Post subject: (No subject)

This thread doesn't seem to be going far, and you seem to be asking very broad questions. For a broad question, you get a broad answer: Turing Walkthrough.
jam jam




PostPosted: Wed Jan 18, 2006 5:17 pm   Post subject: (No subject)

i 'm stuck on how to use mouse.button chose. can someone tell me why this isn't working?

function player_move :int
var x, y, button:int
loop
Mouse.Where (x,y,button)
if button=2 then
if x>=7 and x<207 and y>=7 and y<=207 then
if not (taken(2)) then
result 2
end if
elsif x>=207 and x<407 and y>207 and y <=207 then
if not (taken(5)) then
result 5
end if
elsif x>=407 and x<503 and y>=407 and y<=503 then
if not (taken(4))then
result 4
end if
elsif x>=7 and x<=207 and y>=207 and y<=407 then
if not (taken(7)) then
result 7
end if
elsif x>=7 and x<407 and y>=7 and y<=407 then
if not (taken(9)) then
result 9
end if
elsif x>=207 and x<=407 and y>=7 and y<=207then
if not (taken (3))then
result 3
end if
elsif x>207 and x<=407 and y>=407 and y<=503then
if not (taken (1))then
result 1
end if
elsif x>407 and x<503 and y>=7 and y<=207 then
if not (taken (6))then
result 6
end if
elsif x>=207and x<503 and y >=207 and y<=207 then
if not (taken(8))then
result 8
end if
end if
end if

end loop
end player_move
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 19 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: