Computer Science Canada Forking Help!!! |
Author: | mike200015 [ Fri Feb 04, 2005 8:57 pm ] | ||
Post subject: | Forking Help!!! | ||
I made a program that draws a house and theres a sun that moves, and a garage that opens. I want to make the garage open while the sun is moving up, but i dont know how to do that. Also the black driveway flickers when the garage is going up??.. If anyone can help id appreciate it. Heres the code:
|
Author: | person [ Fri Feb 04, 2005 9:09 pm ] |
Post subject: | |
cant u make the garage door moving up a process and then forking it? example (oval moving up and square moving up at the same time): process oval for x:1..500 drawfilloval (0,0,20,20,1) delay (20) end for end oval fork oval for x: 1..500 drawfillbox (40,40,80,80,1) delay (20) end for |
Author: | cycro1234 [ Fri Feb 04, 2005 9:11 pm ] |
Post subject: | |
Yeah, but processes aren't the greatest. Because they will run forever, and never stop. So u'll have ur animation run non stop. Like the garage door will constantly open. |
Author: | person [ Fri Feb 04, 2005 9:24 pm ] | ||
Post subject: | |||
try this cycro...tell me if it keeps on running
|
Author: | cycro1234 [ Fri Feb 04, 2005 9:29 pm ] |
Post subject: | |
I don't have Turing on this computer, I can't rite now. Send it as exe ![]() |
Author: | mike200015 [ Fri Feb 04, 2005 9:43 pm ] |
Post subject: | |
i tried forking it and having the garage as a process, but it doesnt work 2 well, because when u hav a process it doesnt go at the same time or in any order, it tries to , but it actually goes randomly, and it looks really bad |
Author: | person [ Fri Feb 04, 2005 9:56 pm ] |
Post subject: | |
define randomly....b/c a process runs when it is called by using fork the starting point of a process is the exact moment it is called...so how is it random? |
Author: | md [ Fri Feb 04, 2005 10:34 pm ] |
Post subject: | |
The new process doesn't actually have to start running right away, and it doesn't run until completion... it's run in small parts. It's also easy to end a process, all you need is for it to return... I don't have much experience with graphics in turing, but in other languages I ususally used a animation counter for each thing that was being animated; each frame you update all the counters, and draw the image for the new value. |
Author: | Carino [ Sat Feb 05, 2005 6:59 am ] |
Post subject: | |
Yea, use a counter for the animatations and not a process. It will be much easier this way. Both the sun and garage will move together at the same speed or can be adjusted really easily. |
Author: | Cervantes [ Sat Feb 05, 2005 9:46 am ] |
Post subject: | |
mike200015 wrote: i tried forking it and having the garage as a process, but it doesnt work 2 well, because when u hav a process it doesnt go at the same time or in any order, it tries to , but it actually goes randomly, and it looks really bad
A beacon of light! in these dark times when so many are falling prey to the process. +10 bits Person, if you insist on using processes, fine. But can you try to avoid bringing others to use processes? |
Author: | mike200015 [ Sat Feb 05, 2005 11:09 am ] |
Post subject: | |
Carino wrote: Yea, use a counter for the animatations and not a process. It will be much easier this way. Both the sun and garage will move together at the same speed or can be adjusted really easily.
What do you mean by that Carino?.. how would i do that instead of a process? Can u give me an example code of it plz |
Author: | alvini [ Fri Dec 16, 2005 4:33 pm ] | ||||
Post subject: | Garage help | ||||
hey i have this
and i am trying to put this into it so that they both work at the same time.
|
Author: | Geminias [ Fri Dec 16, 2005 6:32 pm ] |
Post subject: | |
find a way to use them both in the same for loop... |
Author: | alvini [ Fri Dec 16, 2005 6:48 pm ] |
Post subject: | help |
Geminias wrote: find a way to use them both in the same for loop...
i tried every way that i know and it din't work |
Author: | Cervantes [ Fri Dec 16, 2005 7:27 pm ] | ||||||||||
Post subject: | Re: help | ||||||||||
alvini wrote: i tried every way that i know and it din't work Then you didn't try hard enough. ![]() We're going to create pseudo-objects here. They won't be built off classes, but they'll have their own properties. We'll throw all their properties into a pot, and manually keep them apart, since that's the best you can do for now. Let's just say the sun moves horizontally.
The x velocity of the sun is 1 pixel per loop cycle. To move the sun:
Now, we can create another pseduo-object. Let's make it a person. We'll give him an x position and an x velocity. (For simplicity, pretend we live in a one dimensional universe.)
Now we can move the person by
We can combine these two pseudo-objects into the same loop so that each of their properties work simultaneously, without the need for processes.
Lastly, read. |
Author: | alvini [ Sun Dec 18, 2005 8:33 pm ] |
Post subject: | - |
Hey guys how do i do smoke just using ovals. help asap |
Author: | Albrecd [ Sun Dec 18, 2005 9:25 pm ] |
Post subject: | |
If you check the topic "doing house project need help asap," the same issue is being covered. |
Author: | Martin [ Sun Dec 18, 2005 10:41 pm ] |
Post subject: | |
To make cool looking smoke with ovals, try doing something like this: First, draw three or more black ovals, so that they overlap each other slightly. Make them in a triangle shape. Next, draw the same number of white ovals centered on the same points, but with radius 2 or 3 pixels smaller. I haven't tried this, but it should work. |
Author: | alvini [ Mon Dec 19, 2005 9:00 pm ] |
Post subject: | - |
Martin wrote: To make cool looking smoke with ovals, try doing something like this:
First, draw three or more black ovals, so that they overlap each other slightly. Make them in a triangle shape. Next, draw the same number of white ovals centered on the same points, but with radius 2 or 3 pixels smaller. I haven't tried this, but it should work. I tried your way but when i put delay so it wont go that fast everything else in the program slws down. Is there a way to like end a delay. |
Author: | Martin [ Mon Dec 19, 2005 9:13 pm ] | ||
Post subject: | |||
Don't use processes. http://www.compsci.ca/v2/viewtopic.php?t=7842 Your program should look like this:
|