World's Hardest Game recieving coin problem!
Author |
Message |
minamikhael
|
Posted: 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)
Please specify what version of Turing you are using
<Turing 4.1.1a>
Description: |
This is the game over picture |
|
Filesize: |
10.65 KB |
Viewed: |
2312 Time(s) |
|
Description: |
This is the instructions picture |
|
Filesize: |
30.03 KB |
Viewed: |
99 Time(s) |
|
Description: |
|
Filesize: |
28.94 KB |
Viewed: |
119 Time(s) |
|
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
|
|
|
Zren
|
Posted: 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
|
Posted: 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!
|
|
|
|
|
|
|
|