
-----------------------------------
DennyChin
Fri Dec 16, 2011 9:11 pm

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)








Please specify what version of Turing you are using


-----------------------------------
Tony
Fri Dec 16, 2011 9:35 pm

Re: Creating a code for my assignment
-----------------------------------
The code just confuses me
You are confused by code that you wrote yourself? How did that happen?

-----------------------------------
mirhagk
Sat Dec 17, 2011 12:36 pm

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
Sat Dec 17, 2011 1:05 pm

Re: RE:Creating a code for my assignment
-----------------------------------
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
Sat Dec 17, 2011 1:22 pm

Re: Creating a code for my assignment
-----------------------------------
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. :oops:

-----------------------------------
Aange10
Sat Dec 17, 2011 1:46 pm

RE:Creating a code for my assignment
-----------------------------------
 I don't understand the animation parts 

What is it your code is doing again?

-----------------------------------
Tony
Sat Dec 17, 2011 1:59 pm

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.

-----------------------------------
DennyChin
Sat Dec 17, 2011 2:44 pm

Re: Creating a code for my assignment
-----------------------------------
Well, I guess I'll try to redo it, but I need someone to explain to me how animating works  :? Here is the code that I did without copying anyone

-----------------------------------
Tony
Sat Dec 17, 2011 5:15 pm

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
[/code]

-----------------------------------
DennyChin
Sat Dec 17, 2011 6:03 pm

Re: Creating a code for my assignment
-----------------------------------
How would I animate a box from coordinates (400, 500, 350, 450) to (400, 140, 350, 140)? :cry: 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
Sat Dec 17, 2011 6:04 pm

RE:Creating a code for my assignment
-----------------------------------
The box IS moving there. You just aren't erasing all the old positions.

-----------------------------------
DennyChin
Sat Dec 17, 2011 6:25 pm

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
Sat Dec 17, 2011 6:30 pm

RE:Creating a code for my assignment
-----------------------------------
Redraw everything.

-----------------------------------
Tony
Sat Dec 17, 2011 6:58 pm

Re: Creating a code for my assignment
-----------------------------------
This might seem a bit critical, but

I tried to do it in a loop, 



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 "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.

-----------------------------------
DennyChin
Sun Dec 18, 2011 1:51 pm

Re: Creating a code for my assignment
-----------------------------------
Is it possible to create a program where the outputted message is in a big font?

-----------------------------------
Tony
Sun Dec 18, 2011 2:00 pm

RE:Creating a code for my assignment
-----------------------------------
yup, read up on [tdoc]Font.Draw[/tdoc]
