Author |
Message |
munt4life
|
Posted: Sun May 15, 2011 8:15 am Post subject: Sprites in turing!! |
|
|
Does anyone have a sample code of how i can move a sprite, ive been trying forever and have been confused  |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
tyuo9980
|
Posted: Sun May 15, 2011 12:02 pm Post subject: Re: Sprites in turing!! |
|
|
well assign it a x and y coord and modify them according to which keypress. |
|
|
|
|
 |
munt4life
|
Posted: Sun May 15, 2011 4:22 pm Post subject: RE:Sprites in turing!! |
|
|
i tried something like
var x := Pic.FileNew("left1.bmp")
var chars : array char of boolean
loop
Input.KeyDown (chars)
if chars (KEY_RIGHT_ARROW) then
x:=x+5
end if
if chars (KEY_LEFT_ARROW) then
x:=x-5
end if
Pic.Draw(x,100,50,picMerge)
delay(10)
cls
end loop |
|
|
|
|
 |
Raknarg

|
Posted: Sun May 15, 2011 4:36 pm Post subject: RE:Sprites in turing!! |
|
|
That's not quite how it works.
That's assigning x to that picture's ID. Its not the number you want to adjust. Instead, assign the 100 to x. 100 is the x position, which im assuming you're trying to change. |
|
|
|
|
 |
munt4life
|
Posted: Sun May 15, 2011 7:29 pm Post subject: RE:Sprites in turing!! |
|
|
ok so if i assign x to 100, how would the picture move?
do i say left1.bmp :=left1.bmp+5 or something of that sort |
|
|
|
|
 |
Tony

|
|
|
|
 |
munt4life
|
Posted: Sun May 15, 2011 7:46 pm Post subject: RE:Sprites in turing!! |
|
|
aha i see thanks  |
|
|
|
|
 |
|