Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 transportation help
Index -> Programming, Turing -> Turing Help
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
crash0414




PostPosted: 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
Sponsor
sponsor
Mazer




PostPosted: 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




PostPosted: 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




PostPosted: 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
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
crash0414




PostPosted: Tue Nov 02, 2004 5:51 pm   Post subject: (No subject)

i tried that but it didnt work right
SuperGenius




PostPosted: 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




PostPosted: 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




PostPosted: Wed Nov 03, 2004 8:37 am   Post subject: (No subject)

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




PostPosted: 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




PostPosted: 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




PostPosted: 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 Confused
crash0414




PostPosted: Sat Nov 06, 2004 8:10 pm   Post subject: (No subject)

does any1 know how to do this?
HyperFlexed




PostPosted: 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




PostPosted: 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




PostPosted: 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?
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 24 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: