Computer Science Canada doing house project need help asap |
Author: | dani190 [ Tue Dec 13, 2005 9:43 pm ] |
Post subject: | doing house project need help asap |
hey guys i need to know how to do the following: make an oval(sun/moon) move across the screen make smoke that comes out of a chimny |
Author: | Geminias [ Tue Dec 13, 2005 9:55 pm ] | ||
Post subject: | |||
To move oval across the screen:
|
Author: | dani190 [ Tue Dec 13, 2005 9:56 pm ] |
Post subject: | |
omg thx now i just need smoke |
Author: | Geminias [ Tue Dec 13, 2005 9:59 pm ] |
Post subject: | |
smoke is pretty easy too, but you have to know how to import pictures. What you do is you get two pictures of billowing smoke, or just use the spray can in paint. then you take the pictures making sure they each have different particle patterns and you import them into your program. And make them show up, one after the other in a continous loop, so it will appear to be billowing smoke lol. if you can't import pictures either view the tutorial section, or ask me i'll give you a list of the functions you'll need, but i wont code it all for you. |
Author: | dani190 [ Tue Dec 13, 2005 10:01 pm ] |
Post subject: | |
var row, column : int var x : int x := 1 loop setscreen ("graphics:max,max") colorback (black) setscreen ("graphics:max,max,offscreenonly") for i : 1 .. maxx drawfilloval (i, 300, 40, 40, white) delay (10) cls %---------------------------------------------------Stars begin delay (200) randint (row, 1, 20) randint (column, 1, 158) locate (row, column) color (white) put "*" %----------------------------------------------------Stars end % x1 y1 x2 y2 color Draw.FillBox (150, 50, 400, 250, brightred) %Main house box Draw.FillBox (501, 50, 620, 150, brightgreen) %Garage Draw.FillBox (520, 50, 601, 140, brightblue) %Garage Door Draw.FillBox (350, 140, 300, 170, yellow) %Main house window Right side Draw.FillBox (200, 140, 250, 170, yellow) %Main house window Left side end for end loop THAT IS WHAT i have now but i cant get the moon to go over the house can u guys look and see if u can get the moon to go over like a real moon |
Author: | Geminias [ Tue Dec 13, 2005 10:24 pm ] |
Post subject: | |
wow man.. you always declare your setscreen function first, and you only need one. If you use the "offscreenonly" option it will make all the adjustments off screen and you can only see the new version if you use the View.Update command. So if you run that code, you will see nothing. The advantage of "offscreenonly" is it makes objects move smoothly across the screen rather than having them flicker like pure "cls"ing would do. Read the tutorials and get a better feel for the turing language before you start asking all kinds of questions. And also, ask questions in the "Turing help" section, not here. |
Author: | dani190 [ Tue Dec 13, 2005 10:27 pm ] |
Post subject: | |
ok then how can i make my moon arc across the screen then? |
Author: | dani190 [ Tue Dec 13, 2005 10:34 pm ] |
Post subject: | |
also View.Update will not work i get an error called update is not in the export list of view |
Author: | zylum [ Tue Dec 13, 2005 10:58 pm ] |
Post subject: | |
wtf? why is this in tutorials? should be in turing help... too bad i cant move threads |
Author: | dani190 [ Wed Dec 14, 2005 7:58 am ] |
Post subject: | |
cant you just help i cant move it either but i really need help man plz help guys |
Author: | dani190 [ Wed Dec 14, 2005 1:17 pm ] |
Post subject: | |
help plz |
Author: | codemage [ Wed Dec 14, 2005 2:07 pm ] | ||
Post subject: | |||
make sure you have View.Update capitalized as shown here. Arcing is probably beyond your ability. Work on getting the chimney to go. You can probably make a few grey circles clumped together to simulate smoke. Then use the same technique you used to move the moon across. Here is your code with some of your errors removed, and View.Update in the right spot. Try to fix it from here.
|
Author: | dani190 [ Wed Dec 14, 2005 2:14 pm ] |
Post subject: | |
ok man thx, but now my stars are going crazy and my moon is going way way to slow, iv been trying to fidle with it but it wont work, il continue trying but could u help me with the speed of the stars and the moon! |
Author: | dani190 [ Wed Dec 14, 2005 4:35 pm ] |
Post subject: | |
nvm i got it guys thx for all the help but now i need help with the smoke who can help me (not provide coding) |
Author: | alvini [ Wed Dec 14, 2005 7:43 pm ] |
Post subject: | need help for a project asap!! |
hey guys i just need how to make smoke and meke the stars . |
Author: | alvini [ Wed Dec 14, 2005 7:51 pm ] |
Post subject: | Re: need help for a project asap!! |
alvini wrote: hey guys i just need how to make smoke and make the stars . |
Author: | Albrecd [ Thu Dec 15, 2005 2:50 pm ] | ||
Post subject: | |||
In order to make the smoke, you need 2 pictures of it, like Geminias said. You need to have two pictures of the smoke, different pictures but similar, for example: _***_ __ ***** ***** __ _***_ _***_ __ ***** ***** __ _***_ _***_ __ ***** ***** __ _***_ _***_ __ ***** ***** __ _***_ (preferrably these pictures would not be made from text) When these pictures are interchanged, it should look like the puffs of smoke are rising. In order to do this:
|
Author: | Cervantes [ Thu Dec 15, 2005 5:21 pm ] |
Post subject: | Re: need help for a project asap!! |
alvini wrote: alvini wrote: hey guys i just need how to make smoke and make the stars . dani190 wrote: help plz
alvini wrote: can anybody help me how to make smoke.
plz dani190 wrote: help?
Kids, relax. There's no need to bump your thread after waiting such short times. It only pisses people off. You two probably go to the same school. Why are you both asking the same questions to us, when you should first be asking each other? Lastly, you've got to put some effort into it yourself. You can't just say, "please help me" and expect us to do it for you, for four reasons. First, that's extremely rude. Second, we have no obligation to help; we do this voluntarily. Third, that's cheating. Fourth, and most important, you don't learn from it. |
Author: | dani190 [ Thu Dec 15, 2005 7:13 pm ] |
Post subject: | |
well im just saying something her also you have no clue how much we have done,we have the whole project almost done we r just asking for help with 2 things, also yes we do go to the same school but that doesnt mean we live together and know when 1 of us is guna post that so you cant expect that |
Author: | dani190 [ Thu Dec 15, 2005 7:14 pm ] |
Post subject: | |
from last post ALSO we have asked each other but if we give each other code then we get a 0 so i guess u see why we arent doing that |
Author: | codemage [ Fri Dec 16, 2005 10:50 am ] |
Post subject: | |
If we give you code, then your assignment is logically worth zero as well, by the same ethical standard. You've had all sorts of suggestions on how to solve your problem. No self-respecting person here is going to write the code for you. Try something - and someone will show you where your errors are if your solution doesn't work. |
Author: | dani190 [ Fri Dec 16, 2005 2:34 pm ] |
Post subject: | |
i am not freaken asking for you to write the code gosh im asking for help WITH it |
Author: | Albrecd [ Fri Dec 16, 2005 4:08 pm ] |
Post subject: | |
But if you don't post any code, then It's more like you helping us do your code. (And sence you don't know how [no offence intended, but if you did you probably wouldn't be asking for help] you wouldn't really be helping us) |
Author: | dani190 [ Sat Dec 17, 2005 7:21 pm ] | ||
Post subject: | |||
hey guys, i need the garage to close again, and smoke to come out of the chiminy |
Author: | pavol [ Sat Dec 17, 2005 7:47 pm ] |
Post subject: | |
well, how did you open the garage door? use the same technique to close it. slowly draw a blue box and increase its size. also, a tip: use for loops, makes moving objects easier |
Author: | dani190 [ Sat Dec 17, 2005 8:31 pm ] |
Post subject: | |
thanks so much garage works now, but i still need the smoke, anybody know how to? |
Author: | pavol [ Sat Dec 17, 2005 8:50 pm ] |
Post subject: | |
draw a picture of the smoke like others were suggesting and then use the same technique you've been using so far to move the moon and sun to move the smoke up. |
Author: | dani190 [ Sat Dec 17, 2005 10:50 pm ] |
Post subject: | |
ok does anybody think they could help me some more wit this smoke, maybe provide some coding cause i cant get it to work |
Author: | pavol [ Sun Dec 18, 2005 12:37 pm ] |
Post subject: | |
post what you've got so far |
Author: | dani190 [ Sun Dec 18, 2005 2:18 pm ] | ||
Post subject: | |||
ok so thats what i have so far and i want the smoke to show up during the night time, also i cant really get my stars to work, i dont want 1 star to show up i want like tuns at a time and they just go away and eventually come back (blinking stars) Thanks |
Author: | pavol [ Sun Dec 18, 2005 4:02 pm ] |
Post subject: | |
you should really learn how to use for loops. THEY WILL HELP YOU. anyways, for the smoke, it all depends on how you want to draw it. if you use paint then save the file bring it into your program and just move it up the same way you moved your sun and moon. for the stars, depending on how many stars you want you can declare an array storing the star's x and y coordinates and then use a for loop to draw them inside your main loop. to make them flash just make 2 for loops one drawing them in white and another drawing them in black |
Author: | dani190 [ Sun Dec 18, 2005 6:05 pm ] | ||
Post subject: | |||
ok so thats my code and im trying to get the smoke to work, it just says that there is not value or something like that! Help plz |
Author: | pavol [ Sun Dec 18, 2005 6:20 pm ] |
Post subject: | |
make sure that the picture file name is correct and make sure that it's in the same folder as your turing progra. also you might want to exit that loop somehow because it's infinite |
Author: | Albrecd [ Sun Dec 18, 2005 7:21 pm ] | ||
Post subject: | |||
For the smoke, you could draw a grey circle (or more than one) and have it (them) rise to the top of the screen. If you want the smoke to keep coming then when the circle reaches the top of the screen you could make it restart at the chimney. Ex:
|
Author: | dani190 [ Sun Dec 18, 2005 8:14 pm ] |
Post subject: | |
umm that dont work it only draws one circle |
Author: | dani190 [ Sun Dec 18, 2005 8:58 pm ] |
Post subject: | |
anyone else know how to do the smoke in a different way? |
Author: | Albrecd [ Sun Dec 18, 2005 9:17 pm ] |
Post subject: | |
So add more circles, all you need is a Y vairable for each, the loop needs to add 3 or whatever to the Y variables, and you need a separate if statement for when each circle gets to the top of the screen. |
Author: | dani190 [ Sun Dec 18, 2005 9:35 pm ] |
Post subject: | |
lol uv confused me , how do i add more and get em moving |
Author: | Albrecd [ Mon Dec 19, 2005 8:45 am ] |
Post subject: | |
Well since I've used only 1 Draw.FillOval, maybe draw 2 or 3 in YOUR code. And like I said, they each need their own Y variable and if statement. |
Author: | dani190 [ Mon Dec 19, 2005 4:18 pm ] |
Post subject: | |
ok but if i do that will it make it move like smoke? |
Author: | Albrecd [ Mon Dec 19, 2005 6:13 pm ] |
Post subject: | |
What I'm saying is, if you draw grey circles that move upward from the chimney to the top of the screen, you can give the appearance of smoke: if you space them appart, it will appear to be short puffs, or if you overlap them somewhat, it will appear to be a continuous billow. If you want the smoke to move for the entire program, then when a circle reaches the top of the screen, you must change it's Y value back to the height of the chimney. For this reason, each circle must have it's own Y value. |
Author: | dani190 [ Mon Dec 19, 2005 9:04 pm ] | ||||
Post subject: | |||||
ok so do i half to double this code
if i double this code i will get more than 1 circle which i have done but now they will not move up to look like real smoke This is my code now with the grey circles:
how can i make this so that the grey circles will move up like real smoke? |
Author: | Albrecd [ Mon Dec 19, 2005 9:09 pm ] | ||
Post subject: | |||
You need to add to YOval, not subtract from it. another thing
You should replace the YOval := 250 with YOval := 440 INSIDE THE IF STATEMENT (I don't mean to yell but that's very important to the sucess of the program) Get rid of the YOval := that is outside of the if statement or each time it will reset the circle's position and It won't move. |
Author: | dani190 [ Mon Dec 19, 2005 9:14 pm ] |
Post subject: | |
umm it says Yoval has no value? |
Author: | Albrecd [ Mon Dec 19, 2005 9:29 pm ] |
Post subject: | |
What line of code does it say that in? Are you still saying YOval := 430 before the if statement? I should have specified, you still need to say YOval := 430 first, but it must be before the loop that the if statement is in. |
Author: | dani190 [ Mon Dec 19, 2005 9:42 pm ] |
Post subject: | |
umm so i just declare YOval := 430 once and then all those drawfilloval's i put in my code will just keep coming up at the same place but several of them |
Author: | Albrecd [ Mon Dec 19, 2005 9:44 pm ] |
Post subject: | |
You have to put a cls in the loop (I'd put it at the very beginning) NOTE: this will also clear the rest of the images, so you'll have to redraw them too (there is no way around this) |
Author: | dani190 [ Mon Dec 19, 2005 9:45 pm ] |
Post subject: | |
sry were? |
Author: | Albrecd [ Tue Dec 20, 2005 9:01 am ] | ||||
Post subject: | |||||
In your code you have:
Instead, you should have:
|
Author: | Albrecd [ Tue Dec 20, 2005 9:06 am ] |
Post subject: | |
Sorry, I noticed a few errors in the code that I gave you: 1) there should be a comma before grey in the Draw.FillOvals 2) there should be a cls at the beginning of the loop 3) there should be a delay somewhere (either before the cls or after the Draw.FillOvals) |
Author: | dani190 [ Tue Dec 20, 2005 10:45 am ] |
Post subject: | |
woot woot it works thx man |
Author: | Albrecd [ Tue Dec 20, 2005 12:29 pm ] |
Post subject: | |
No problem that's what we're here for. |
Author: | dani190 [ Tue Dec 20, 2005 12:46 pm ] | ||
Post subject: | |||
this is what i have now
but now i only get 1 smoke puff, eirlier when i tried this i got the 5, can anybody help me fix this Thanks |
Author: | Albrecd [ Tue Dec 20, 2005 1:13 pm ] |
Post subject: | |
If you're using offscreenonly then you'll need a View.Update after you draw the ovals. |
Author: | dani190 [ Tue Dec 20, 2005 1:19 pm ] |
Post subject: | |
ok nvm man i got it to work thanks everyone im almost done!!! |
Author: | dani190 [ Tue Dec 20, 2005 4:53 pm ] | ||
Post subject: | |||
ok so i want to keep that snow going the whole time does anybody know how i can modify my code to allow that? Also i want to add light in the windows at night time but then get them to turn off half way? how can i do this?(filling them with yellow but duno how to get the code to do it and go back to grey after) |
Author: | dani190 [ Tue Dec 20, 2005 4:53 pm ] |
Post subject: | |
sorry not snow i want the smoke! |
Author: | MysticVegeta [ Tue Dec 20, 2005 6:35 pm ] |
Post subject: | |
Using Trig fcns for the movement of moon and sun would actualy save a lot of code and will be accurate. |
Author: | dani190 [ Tue Dec 20, 2005 9:42 pm ] |
Post subject: | |
huh, im in grade 10 course i duno what you are talking about |
Author: | do_pete [ Wed Dec 21, 2005 11:44 am ] |
Post subject: | |
He's talking about trigonometry functions lke sine and cosine |
Author: | dani190 [ Wed Dec 21, 2005 3:34 pm ] |
Post subject: | |
well i have no clue what that is |
Author: | Albrecd [ Wed Dec 21, 2005 4:27 pm ] |
Post subject: | |
Trig functions are definatly not required for grd. 10 computers. |
Author: | MysticVegeta [ Wed Dec 21, 2005 6:31 pm ] |
Post subject: | |
Hmm I am in Grade 10, I have them in my course... I have used them in my Grade 9 CS course too... what school do you go to dani? |
Author: | do_pete [ Wed Dec 21, 2005 6:31 pm ] |
Post subject: | |
Actually they are definatly needed in the creation of some games such as overhead shooters |