Computer Science Canada DDR Problems  | 
  
| Author: | Savage Reindeer [ Thu Apr 30, 2009 9:32 am ] | ||
| Post subject: | DDR Problems | ||
What is it you are trying to achieve? I am about half a year into learning Turing. So I am relitively new. I am making a DDR game. My current goal is to have a block (called arrowup) move up the screen and assing a value of "perfect", "good", "bad" or "miss" to the variable ans. I also want the program to generate blocks (or arrows) in four columns. What is the problem you are having? I am having two problems. 1) The block moves up into the three areas. If you hold down the up arrow, the value of ans will change for as long as that arrow is held down. How do I have the game take whatever value it is when the arrow is pushed? 2) I have no idea how to generate the blocks. I thought I would use arrays, but beyond that I have no idea. Describe what you have tried to solve this problem As for problem one, I tried making a loop inside a loop, that exited when the up arrow was pressed. the only problem was that it got stuck in the loop (displaying a blank screen) until the up arrow was pressed and then continuing later. Like I said before, I have no idea how to solve the second problem passed the fact that a should use arrays. Post any relevant code 
 Please specify what version of Turing you are using <Answer Here>  | 
	|||
| Author: | Dusk Eagle [ Thu Apr 30, 2009 9:36 pm ] | ||||
| Post subject: | Re: DDR Problems | ||||
Quote: 1) The block moves up into the three areas. If you hold down the up arrow, the value of ans will change for as long as that arrow is held down. How do I have the game take whatever value it is when the arrow is pushed?  
Do you know Object Oriented Programming? If so, make a block class that contains a boolean variable stating whether an attempt has been made to make points off of that block. If an attempt has been made, disable all further attempts. However, if you are not familiar with OOP, I suggest that once a button has been pushed, you set a variable that declares whether the button is up or down to down. Then, make them raise the key again before setting the variable back to up and allowing them to score from it. You can check that a key is up using 
 Quote: I have no idea how to generate the blocks. I thought I would use arrays, but beyond that I have no idea.  
Here's pseudo-code to help you develop your idea. I believe this should work. 
  | 
	|||||
| Author: | copthesaint [ Thu Apr 30, 2009 10:54 pm ] | 
| Post subject: | RE:DDR Problems | 
If you go here http://compsci.ca/v3/viewtopic.php?t=20842, I have a Key module that you may like to look at. I have made a key hit function that can solve problem 1, and problem 2 , you will need a couple arrays, and array 1 to 4 (assuming there are 4 arrows ) of the x, a variable for the velocity, an array for the max num of arrows for there y position and an array for the max num of arrows for the type. (if type 1 then draw at x (1)) If you need me to xplain more clearly I can help at any time.  | 
	|
| Author: | Savage Reindeer [ Fri May 01, 2009 8:30 am ] | 
| Post subject: | RE:DDR Problems | 
I am familiar with the concept of OOP, an object is like a car, and its properties are like its parts, and you can change the parts to make different types of cars, but they are still a car. Anyway, could someone direct me to a tutorial for OOP?  | 
	|
| Author: | Dusk Eagle [ Fri May 01, 2009 9:58 am ] | 
| Post subject: | Re: DDR Problems | 
Check out The Turing Walkthrough. It includes extensive lessons in classes, as well as many other useful subjects.  | 
	|
| Author: | Savage Reindeer [ Fri May 01, 2009 2:58 pm ] | ||
| Post subject: | Re: DDR Problems | ||
I tried using nested if statements. It didn't seem to do anything. 
  | 
	|||
| Author: | BigBear [ Fri May 01, 2009 3:55 pm ] | 
| Post subject: | RE:DDR Problems | 
Follow the order of your code in that function it will check the first if statement if it is true it will follow after the then if it is false it will exit the function with the result " "  | 
	|