Posted: Fri Dec 16, 2011 9:11 pm Post subject: Creating a code for my assignment
What is it you are trying to achieve?
I have to create a 15-30 second advertisement of a wireless device. I made a stick figure bully that throws a snowball at another stick figure. The stick figure moves his hands and takes out an ipod to text his friends(stick men as well). His friends throw snowballs at him, and scares the bully away. In the end, they text each other "Merry Christmas".
What is the problem you are having?
I don't know how to code it properly or how to fix it so it works.
Describe what you have tried to solve this problem
I've asked friends who are more experienced with this program to help me, but they didn't know how to do it either. The code just confuses me, so I don't know how to even start to fix it.
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
<Answer Here>
Posted: Sat Dec 17, 2011 12:36 pm Post subject: RE:Creating a code for my assignment
Total troll here but iPod's don't text (well some apps can with wifi). Maybe you mean iPhone?
As for the code, if you don't understand it, then take some time, and clean the code up, or if that's not possible, maybe start over.
ProgrammingFun
Posted: Sat Dec 17, 2011 1:05 pm Post subject: Re: RE:Creating a code for my assignment
mirhagk @ Sat Dec 17, 2011 12:36 pm wrote:
As for the code, if you don't understand it, then take some time, and clean the code up, or if that's not possible, maybe start over.
Lesson learned: Don't copy code and comment you own.
DennyChin
Posted: Sat Dec 17, 2011 1:22 pm Post subject: Re: Creating a code for my assignment
Tony @ Fri Dec 16, 2011 9:35 pm wrote:
DennyChin @ Fri Dec 16, 2011 9:11 pm wrote:
The code just confuses me
You are confused by code that you wrote yourself? How did that happen?
Well, I had lots of help from other people to help me write the code. I understand most of it, but I don't understand the animation parts because they never explained that part to me.
Aange10
Posted: Sat Dec 17, 2011 1:46 pm Post subject: RE:Creating a code for my assignment
Quote:
I don't understand the animation parts
What is it your code is doing again?
Tony
Posted: Sat Dec 17, 2011 1:59 pm Post subject: RE:Creating a code for my assignment
I've taken a look at the code, and it's obvious that some parts were written by different people (based on style -- most noticeably when there are different ways of doing the same thing, and the use is inconsistent). There are also parts that are simply copy-pasted, and the pasted copies do nothing (that is, not contribute to the animation).
That's not "help" -- other people were simply handing you parts of a solution, without you learning anything. Your best bet to get out of this mess is to rewrite all the given parts yourself.
Posted: Sat Dec 17, 2011 5:15 pm Post subject: RE:Creating a code for my assignment
the basic idea of animating something is that you draw one frame, and then you draw another frame. When you draw enough frames, together they produce an animation. If the changes are simple, it often helps to place things in a for-loop
code:
for i: 1 .. maxx div 2
Draw.Oval(i, 100, 2, 2, red)
Draw.Oval(i*2, 200, 2, 2, blue)
delay(60)
cls
end for
Posted: Sat Dec 17, 2011 6:03 pm Post subject: Re: Creating a code for my assignment
How would I animate a box from coordinates (400, 500, 350, 450) to (400, 140, 350, 140)? I tried to do it in a loop, but you just see the box extend to that point, it doesn't actually move there.
Insectoid
Posted: Sat Dec 17, 2011 6:04 pm Post subject: RE:Creating a code for my assignment
The box IS moving there. You just aren't erasing all the old positions.
DennyChin
Posted: Sat Dec 17, 2011 6:25 pm Post subject: Re: Creating a code for my assignment
Okay, so I got it to move, but when I run the program, everything else disappears. How can I make it so the box moves, and everything else stays in place?
Insectoid
Posted: Sat Dec 17, 2011 6:30 pm Post subject: RE:Creating a code for my assignment
Redraw everything.
Tony
Posted: Sat Dec 17, 2011 6:58 pm Post subject: Re: Creating a code for my assignment
This might seem a bit critical, but
DennyChin @ Sat Dec 17, 2011 6:03 pm wrote:
I tried to do it in a loop, [and so it draws stuff many times, on top of each other]
Insectoid @ Sat Dec 17, 2011 6:04 pm wrote:
[you should erase old stuff]
DennyChin @ Sat Dec 17, 2011 6:25 pm wrote:
[Okay, I've erased the screen, and now everything has disappeared. What do I do now?]
Telling you, step by step, what to do is not that much better than giving you the entire solution as a single chunk. Computer Science is amazing in a way that it's one of the very few courses that requires at least a bit of critical thought. This might come as a shock after mostly just following directions for so many years of schooling, but this new workflow of I have a new problem. Why is it a problem, and what can I do about it? is insanely powerful and will make your life better. This isn't even a computer thing. We try to encourage it with "the template" for initial Turing Help posts, so how about we try that again:
Problem: "The screen is blank after using cls. I would like it to not be blank."
What have you done to try to solve it? "The documentation for cls says "The entire output window is set to the current text background color", so blank screen should have been expected. There are only two reasonable options: not erase the screen in the first place (but that is necessary since an object had moved), and restoring a blank screen...."
Great, at this point we've deduced what Insectoid ended up saying anyway, but we also know why we are doing it this way.