Author |
Message |
crash0414
|
Posted: 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
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Mazer
|
Posted: Tue Nov 02, 2004 9:46 am Post subject: (No subject) |
|
|
You need to tell us what it is that you need help with. |
|
|
|
|
|
crash0414
|
Posted: Tue Nov 02, 2004 9:49 am Post subject: (No subject) |
|
|
i dont know how to put a car into this to make it move |
|
|
|
|
|
Tony
|
Posted: Tue Nov 02, 2004 1:33 pm Post subject: (No subject) |
|
|
so just draw the car instead of that circle... you have the proper X/Y coordinates |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
crash0414
|
Posted: Tue Nov 02, 2004 5:51 pm Post subject: (No subject) |
|
|
i tried that but it didnt work right |
|
|
|
|
|
SuperGenius
|
Posted: Tue Nov 02, 2004 6:09 pm Post subject: (No 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) |
|
|
|
|
|
crash0414
|
Posted: Wed Nov 03, 2004 8:14 am Post subject: (No 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 |
|
|
|
|
|
McKenzie
|
|
|
|
|
Sponsor Sponsor
|
|
|
crash0414
|
Posted: Wed Nov 03, 2004 8:55 am Post subject: (No subject) |
|
|
no dying to live is a friend of mine..were in the same class |
|
|
|
|
|
SuperGenius
|
Posted: Wed Nov 03, 2004 5:42 pm Post subject: (No 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. |
|
|
|
|
|
crash0414
|
Posted: Thu Nov 04, 2004 8:16 pm Post subject: (No 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 |
|
|
|
|
|
crash0414
|
Posted: Sat Nov 06, 2004 8:10 pm Post subject: (No subject) |
|
|
does any1 know how to do this? |
|
|
|
|
|
HyperFlexed
|
Posted: Sun Nov 07, 2004 2:43 am Post subject: (No 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) |
|
|
|
|
|
crash0414
|
Posted: Mon Nov 08, 2004 10:01 am Post subject: (No subject) |
|
|
i dont care about the flashing..i need help making a background into this |
|
|
|
|
|
myob
|
Posted: Mon Nov 08, 2004 9:39 pm Post subject: (No 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? |
|
|
|
|
|
|