Computer Science Canada Moving A Polygon |
| Author: | Blockgen [ Sat Oct 20, 2012 1:37 pm ] | ||
| Post subject: | Moving A Polygon | ||
What is it you are trying to achieve? I'm trying to get a polygon (car) to move across the screen. What is the problem you are having? It's giving me error codes because I don't exactly know how to do this, so I used background knowledge. Describe what you have tried to solve this problem I tried making the integers in the array variables that change 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 4.1 |
|||
| Author: | Zren [ Sat Oct 20, 2012 2:44 pm ] | ||
| Post subject: | RE:Moving A Polygon | ||
What would be the output of the following? Try it out yourself in Turing.
:= will assign the calculated value on the right side to the left side's variable. Later on, you will encounter pointers, which can be used like you wish to here. |
|||
| Author: | evildaddy911 [ Sun Oct 21, 2012 9:09 am ] |
| Post subject: | RE:Moving A Polygon |
you are changing the the various x variables, but then what are you doing with them? When it draws the car, what variables is the Draw.FilPpolygon using? |
|
| Author: | QuantumPhysics [ Sun Oct 21, 2012 2:03 pm ] |
| Post subject: | RE:Moving A Polygon |
You should also give your x values more definite names. Not some random numbers. possibly name them in order or by vertices. Also, you don't have to define them straight down, i am some what positive that turing lets you define them in a list (e.g. int x1 = 1, x2 = 2, x3 = 3) <- on the same line. |
|
| Author: | chipanpriest [ Wed Oct 31, 2012 7:30 pm ] | ||
| Post subject: | Re: Moving A Polygon | ||
You could have a for statement to get all x values to increase:
See if this works |
|||
| Author: | Raknarg [ Thu Nov 01, 2012 10:23 am ] |
| Post subject: | RE:Moving A Polygon |
Listen to what Zren said, he is doing exactly what you're doing. Tell us why, in Zren's program, a does not equal b anymore. |
|