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

Username:   Password: 
 RegisterRegister   
 World's Hardest Game recieving coin problem!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
minamikhael




PostPosted: Sat Jun 09, 2012 4:59 pm   Post subject: World's Hardest Game recieving coin problem!

What is it you are trying to achieve?
I want the user to be able to collect the coins in any order they want.


What is the problem you are having?
The coins that I have made can only be collected in a certain order. When I try to get a coin without following the order, all the coins disappear!


Describe what you have tried to solve this problem
I have tried to use whatdotcolour colour detection to see if that will help and it did not


Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)

Turing:





Please specify what version of Turing you are using
<Turing 4.1.1a>



gameover.gif
 Description:
This is the game over picture
 Filesize:  10.65 KB
 Viewed:  2313 Time(s)

gameover.gif



instructions.gif
 Description:
This is the instructions picture
 Filesize:  30.03 KB
 Viewed:  99 Time(s)

instructions.gif



menu.gif
 Description:
This is the menu picture
 Filesize:  28.94 KB
 Viewed:  119 Time(s)

menu.gif



worldshardestgame.t
 Description:
The problem is in proc level2 and I identified it by a comment line saying problem

Download
 Filename:  worldshardestgame.t
 Filesize:  12.22 KB
 Downloaded:  129 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Zren




PostPosted: Sat Jun 09, 2012 6:28 pm   Post subject: RE:World\'s Hardest Game recieving coin problem!

Ew @ WhatDotColor colision detection.

Turing:

        %PROBLEM!!!
        if points = 0 then
            drawfilloval (200, 338, 8, 8, yellow)
            drawfilloval (600, 150, 8, 8, yellow)
            drawfilloval(602,152,1,1,black)
        end if
        if points = 1 and whatdotcolour (202, 340) not= yellow then
            drawfilloval (600, 150, 8, 8, yellow)
        elsif points = 1 and whatdotcolour (603, 153) not= yellow then
            drawfilloval (200, 338, 8, 8, yellow)
        end if
        %PROBLEM ^^^^^^


You only use one variable to store two states. Then you have a circular dependancy on your calculations...

Clear screen.
if 1 point and coin2 is not drawn, draw coin1.
if 1 point and coin1 is not drawn, draw coin2

coin2 is NEVER drawn when you check if it's drawn.

I suggest you use a boolean variable for each to store if the coin has been collected or not.
minamikhael




PostPosted: Sat Jun 09, 2012 6:50 pm   Post subject: Re: World's Hardest Game recieving coin problem!

I made 2 booleans and made both true when they are drawn. Then I said if the first coin was collected, the coin is false and it worked!
Thanks!
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 1  [ 3 Posts ]
Jump to:   


Style:  
Search: