Computer Science Canada

transportation help

Author:  crash0414 [ Tue Nov 02, 2004 9:43 am ]
Post subject:  transportation help

need to make a form of transportation using turing,ex car or plane. it has to move across the page..im not asking for someone to give me the answer im just asking if you can help

here is what i have so far

code:
var x,y : int
x:=100
y:=100
var chars : array char of boolean

loop
Input.KeyDown (chars)
if chars (KEY_UP_ARROW) then
y:=y+5
end if

if chars (KEY_RIGHT_ARROW) then
x:=x+5
end if

if chars (KEY_LEFT_ARROW) then
x:=x-5
end if

if chars (KEY_DOWN_ARROW) then
y:=y-5
end if

drawoval(x,y,4,4,red)
delay(10)
cls
end loop

Author:  Mazer [ Tue Nov 02, 2004 9:46 am ]
Post subject: 

You need to tell us what it is that you need help with.

Author:  crash0414 [ Tue Nov 02, 2004 9:49 am ]
Post subject: 

i dont know how to put a car into this to make it move

Author:  Tony [ Tue Nov 02, 2004 1:33 pm ]
Post subject: 

so just draw the car instead of that circle... you have the proper X/Y coordinates

Author:  crash0414 [ Tue Nov 02, 2004 5:51 pm ]
Post subject: 

i tried that but it didnt work right

Author:  SuperGenius [ Tue Nov 02, 2004 6:09 pm ]
Post subject: 

supposing that you had a picture called car.jpg stored in the same folder as your program:

code:
var picID: int
picID := Pic.FileNew("car.jpg")
Pic.Draw(picID,0,0,picCopy)


this draws the picture with the bottom left corner at (0,0)

Author:  crash0414 [ Wed Nov 03, 2004 8:14 am ]
Post subject: 

i dont want to have a picture of a car, i need to draw a car, but everytime a draw a car in this it always messes up

Author:  McKenzie [ Wed Nov 03, 2004 8:37 am ]
Post subject: 

Hmmm ...
Crash == Dying to live ???
http://www.compsci.ca/v2/viewtopic.php?t=6281&highlight=transportation

Author:  crash0414 [ Wed Nov 03, 2004 8:55 am ]
Post subject: 

no dying to live is a friend of mine..were in the same class

Author:  SuperGenius [ Wed Nov 03, 2004 5:42 pm ]
Post subject: 

well if you don't want a picture of a car what I suggest you do is to draw it in turing and then use Pic.New to convert your image into a picture, which makes it a lot simpler to move around the screen.

Author:  crash0414 [ Thu Nov 04, 2004 8:16 pm ]
Post subject: 

i have a car made now and it will move around but now i am just having troubles getting a background..i dont know how, everytime i try the screen just flashes Confused

Author:  crash0414 [ Sat Nov 06, 2004 8:10 pm ]
Post subject: 

does any1 know how to do this?

Author:  HyperFlexed [ Sun Nov 07, 2004 2:43 am ]
Post subject: 

for flashing, put the following at the beginning of your code (after your vars I guess)

code:

View.Set ("offscreenonly")


when you draw an object with turing, it won't go right to the screen now, it stores everything you draw in a buffer. You can load the buffer onto the screen by calling

View.Update

that helps with flickering


As well, when drawing the car with shapes, the trick is to know where all the shapes are in relativity to your x and y variables. It helps me sometimes to draw out stuff like this (make a dot for x and y, and then see where the other objects are relative to the x,y position)

Author:  crash0414 [ Mon Nov 08, 2004 10:01 am ]
Post subject: 

i dont care about the flashing..i need help making a background into this

Author:  myob [ Mon Nov 08, 2004 9:39 pm ]
Post subject: 

u gonna be more specific, what do you mean by saying "making a background into this"? do you want to put a background in ur program or what?

Author:  crash0414 [ Mon Nov 08, 2004 10:06 pm ]
Post subject: 

yes i do want to put a background into this

Author:  myob [ Mon Nov 08, 2004 10:16 pm ]
Post subject: 

as i recall there is no background picture commands, just draw a picture that is at the back of the screen and draw everything else on top of it

Author:  crash0414 [ Mon Nov 08, 2004 10:18 pm ]
Post subject: 

ok..so where would i put it??? Question Question

Author:  myob [ Mon Nov 08, 2004 10:28 pm ]
Post subject: 

code:
var picID: int       
        picID := Pic.FileNew ("mypic.bmp")
            Pic.Draw (picID, 0, 0, picUnderMerge)
       


so lets say ur picture is called "mypic.bmp", u declare it like that and put it at (0,0) so its at bottom left corner. you should setup the screen and/or the picture so they match each other.

Author:  crash0414 [ Tue Nov 09, 2004 8:50 am ]
Post subject: 

ok..i did that and it didnt work..it said it was an "illeagal picture id"

Author:  HyperFlexed [ Tue Nov 09, 2004 6:12 pm ]
Post subject: 

why don't you use rectangles and stuff to draw your image? That's be more pro. Write a procedure to draw a road with a width and number of lanes that you declacre in the procedure.

Author:  myob [ Tue Nov 09, 2004 7:40 pm ]
Post subject: 

crash0414 wrote:
ok..i did that and it didnt work..it said it was an "illeagal picture id"


then we gonna need ur code to help us

Author:  cool dude [ Tue Nov 09, 2004 8:39 pm ]
Post subject: 

i'm not sure if i completely understand but as i understand u just want to make a background on your whole screen. you could use the command colourback and the colour in brackets.

code:

colourback (7)


then if u want to make it look like a road you could draw a huge grey rectangle and draw little yellow rectangles in the big grey rectangle to make it look like a road. good luck

Author:  crash0414 [ Wed Nov 10, 2004 10:31 pm ]
Post subject: 

i have changed my whole thing and i am now doing a ufo, i have the ufo made with a black background and stars, but all i need help doing now is making a moon or somthing move arcoss the screen, i dont have the program here on this computer but i will post it when i can


: