Computer Science Canada small car tips |
Author: | dying to live [ Mon Oct 25, 2004 7:38 am ] | ||
Post subject: | small car tips | ||
can anyone help me change my ball to a small car? heres is what i have so far....i just want to get the hang o fthis so i can make a game but everytime i make my car, i start with drawbox then when i run it the bottom left corner of the box stays were it is and the box just gets bigger with the input:( can anyone help ![]()
|
Author: | josh [ Mon Oct 25, 2004 7:45 am ] |
Post subject: | |
what u need to do is draw the car at the begining of the program. Then u need to look up Pic.New and Pic.Draw in the turing help file ![]() |
Author: | dying to live [ Mon Oct 25, 2004 7:49 am ] |
Post subject: | |
im not sure i understand that but ok ![]() |
Author: | josh [ Mon Oct 25, 2004 8:29 am ] | ||
Post subject: | |||
srry, basically what the Pic.New command does is it takes all the shapes that u have drawn in a specified area, or box defined in the Pic.New command, (see the syntax in the code below), that make up the car, e.g. a rectangle, wheels... and "takes a picture of them" and stores that picture in a variable. You can then change the x and y coordinates of jus that picture to move it instead of moving each shape individually. To display the picture that u took u use the Pic.Draw command. for ecample, this program draws a stickman and makes him bounce around the screen:
so in your code, u would draw the individual shapes before the loop and take the pic after the shapes are drawn and before the loop u then replace the line where u draw the oval witht he Pic.Draw line |
Author: | dying to live [ Mon Oct 25, 2004 8:58 am ] |
Post subject: | |
haha thats awosme, but yeah i still cant quite figure out how to apply this to my program cuz im not sure i understand the elsif, and if commands yet, im new at this. but thanks. |
Author: | josh [ Mon Oct 25, 2004 9:01 am ] |
Post subject: | |
np, U can keep the if's and else ifs and just do like I said, and use the same x and y variables to move the picture u took |
Author: | dying to live [ Mon Oct 25, 2004 6:51 pm ] |
Post subject: | |
your explaining it god i just dont get it sorry |
Author: | Cervantes [ Mon Oct 25, 2004 6:59 pm ] | ||||
Post subject: | |||||
if you are confused about the ifs and elsifs:
is the same as
|
Author: | josh [ Mon Oct 25, 2004 9:15 pm ] |
Post subject: | |
kk, that program is definantly good for a n00b though. I keep up the good work ![]() |
Author: | dying to live [ Thu Oct 28, 2004 9:39 am ] | ||
Post subject: | |||
hah thanks man ive changes it a bit so now its a ufo not a car lol...heres what i got.
|
Author: | rollerdude [ Thu Oct 28, 2004 5:52 pm ] |
Post subject: | |
in our class we have to do animation, my car kicks ass however the program is on th eschool computer so i'll give you my car program when i get to school tommorow the rollerdude |
Author: | dying to live [ Fri Oct 29, 2004 7:20 am ] |
Post subject: | |
if you can that would be awsome! just pm it to me. ![]() |
Author: | Flea [ Fri Oct 29, 2004 10:48 am ] | ||
Post subject: | |||
you can stop that annoying blinking by using View.Update:
|