Computer Science Canada Help in animation |
Author: | triumph [ Sat Apr 23, 2005 7:12 pm ] |
Post subject: | Help in animation |
Could someone help me with some quick questions that I run into along the way? I don't want to bother the entire forums for simple things (I am a amateur TURING user) and I keep running into little things along the way while trying to complete a school project. I by no means want anyone to do this for me, or even to send me any code I just know I could do this alot faster when someone can answer me a very simple question instead of messing around for several hours trying to do it myself. If anyone would be so kind please reply here or PM me and i'll msg you my MSN / AIM. Thanks! |
Author: | jamonathin [ Sat Apr 23, 2005 7:20 pm ] |
Post subject: | |
Don't worry about bothering. If a mod thnks it's useless they'll dispose of it. besides, it could help someone else out. |
Author: | Cervantes [ Sat Apr 23, 2005 7:33 pm ] |
Post subject: | |
The question here is how small are these questions? If they are really small, you probably won't be asking such questions for long. I'll leave the judgement up to you. You can either post the questions on the board, or ask someone via MSN. Feel free to ask me. Check the MSN button for my e-mail address. (And yes, that's the e-mail address I use for msn) |
Author: | jamonathin [ Sat Apr 23, 2005 7:39 pm ] |
Post subject: | |
do all mods use @compsci.ca? cuz im sick of hotmail |
Author: | Cervantes [ Sat Apr 23, 2005 7:52 pm ] |
Post subject: | |
No, we use whatever we want. If you want a compsci email, amass 2500 bits. If you want an email somewhere other than hotmail, you can get gmail. PM if you want it. Now, let's get back to the topic of waiting for triumph to ask his questions. |
Author: | triumph [ Sat Apr 23, 2005 10:51 pm ] | ||
Post subject: | |||
jamonathin helped me out with this earlier but my computer restarted out of nowhere in the middle of my program and I lost the peice of code he sent me. I am trying to make it so the ovals bounce off the walls when they hit the given parameters. I am attempting something like this:
xball being the x coordinate variable for drawoval. I am just learning when it comes to turing When jamonathin helped me I realised you had to use two variables, but I was also wondering... am I going to have to set paramters for each side so the ovals constantly bounce off everything they hit? (By the way, I am trying to make a single "scene" to a screen saver) Thanks for your help. |
Author: | Bacchus [ Sun Apr 24, 2005 12:10 am ] | ||
Post subject: | |||
youd want to multiply it by -1 not set it to that
|
Author: | Cervantes [ Sun Apr 24, 2005 7:42 am ] | ||||
Post subject: | |||||
if you want to make the ball bounce off the wall, you have to reverse it's velocity. Assuming it hits the right or left wall, we reverse it's velocity in the x plane.
If you want to move it to the other side of the screen:
|
Author: | triumph [ Sun Apr 24, 2005 10:58 am ] | ||
Post subject: | |||
I still cannot get it. I replaced all my x,y radius' with the variable "ballradius" I put in the if statements and they still just fly off the screen.
Whoa, I'm sorry ... I really suck at this |
Author: | shlitiouse [ Sun Apr 24, 2005 11:35 am ] |
Post subject: | |
Hmmmm, I'm by no means the best programmer around here, and I'm fairly new to it myself, but PM me your e-mail (MSN) and I'll be willing to help out with any questions you have, could be fun to have someone to work out a problem with. |
Author: | Cervantes [ Sun Apr 24, 2005 11:56 am ] | ||
Post subject: | |||
Are you using the ball's x and y velocities to update the ball's x and y positions?
Also, you should be using maxy in your second if statement, not maxx. |
Author: | triumph [ Sun Apr 24, 2005 1:25 pm ] | ||
Post subject: | |||
Let me just post my entire code up and tell me what I have done wrong.
|
Author: | Cervantes [ Sun Apr 24, 2005 4:44 pm ] |
Post subject: | |
triumph wrote: Let me just post my entire code up and tell me what I have done wrong.
No. You can fix this yourself, and it will benefit you more if you do it, as opposed to us doing it for you. For the moment, I would recommend only using one ball. If you want more later, you should look into arrays. But for now, just go with one. Why are you adding ten to the ball's x and y position each time through the loop? Also, I would think carefully about the starting position of your ball. |
Author: | triumph [ Sun Apr 24, 2005 5:34 pm ] |
Post subject: | |
The + 10 every time through the loop is so it updates it's position....? I didn't want you to do it for me if I wanted that I wouldn't of spent 3 and a half hours messing around with it. I'll keep at it. |
Author: | Cervantes [ Sun Apr 24, 2005 6:18 pm ] |
Post subject: | |
Do you really want to move the balls ten pixels up and ten pixels right each time through the loop, forever and ever? Seems to me that wouldn't allow you to make the balls bounce off the edges of the screen... |
Author: | triumph [ Sun Apr 24, 2005 6:40 pm ] |
Post subject: | |
It seems I have alot to learn. That's the only way I learned how to move objects. Our teacher (student teacher) teaches us nothing. He tells us to use the "help menu" for everything. So basically it's all on your own. |
Author: | jamonathin [ Mon Apr 25, 2005 6:03 am ] |
Post subject: | |
Also, pay attention to what you're changing in your if statements? is it the xball := xball + 10, or is it the velocityx? Whatever you're changing, is what should be moving the ball, and for right now, the only thing moving the ball. |
Author: | triumph [ Mon Apr 25, 2005 6:57 am ] | ||
Post subject: | |||
Where do you put the ballvelocity variable within this line:
I don't see where this "direction/speed" variable is inserted so it makes a difference within the code... |
Author: | jamonathin [ Mon Apr 25, 2005 8:52 am ] |
Post subject: | |
nowhere, you add the ball velocity to the xball and yball. Hint: The velocities should be 10 (or however speed) also. |
Author: | triumph [ Mon Apr 25, 2005 10:48 am ] |
Post subject: | |
I got help from someone in my programming class and it worked out alot better. Thanks anyways, |