Please specify what version of Turing you are using
4.1.1
Sponsor Sponsor
Cezna
Posted: Tue Jun 08, 2010 5:37 pm Post subject: RE:Walking animation help
The simplest way would be to draw the character at multiple stages of his run, taking pictures of each, and then either draw these pictures sequentially with Turing, or upload them into another program such as Power Point and make a .gif out of it.
You can also check this link to another thread in which someone posted a "Mario Movement Test", which does exactly what it sounds like you are trying to do.
Posted: Tue Jun 08, 2010 5:51 pm Post subject: Re: Walking animation help
ah thank you so much... and btw in your welcome thread i cant reply cause for some reason its set to only mods and admins
Cezna
Posted: Tue Jun 08, 2010 5:53 pm Post subject: RE:Walking animation help
Hmmmm.... just mine? Or are all of the welcome threads like that?
Monduman11
Posted: Tue Jun 08, 2010 5:54 pm Post subject: Re: Walking animation help
im not sure cause ive only tried urs.... hold on ill go check
edit: i checked and it seems that everyones is like that... wonder why
Cezna
Posted: Tue Jun 08, 2010 5:57 pm Post subject: RE:Walking animation help
They're probably not supposed to develop into full-fledged conversations.
Btw, I'm the chat room right now.
Feel free to jump in.
Monduman11
Posted: Tue Jun 08, 2010 5:58 pm Post subject: Re: Walking animation help
i would but i cant.. for some reason it gives me an error
Monduman11
Posted: Tue Jun 08, 2010 6:01 pm Post subject: Re: Walking animation help
im attaching a picture so u can see for yourself lol
chat.jpg
Description:
chat error
Filesize:
82.7 KB
Viewed:
83 Time(s)
Sponsor Sponsor
Cezna
Posted: Tue Jun 08, 2010 6:01 pm Post subject: RE:Walking animation help
It's probably filtering it out.
Try closing the page, then coming back (I mean close your browser), and then set it to allow "potentially unsafe content" if/when it prompts you
I had the same problem, and doing that fixed it.
edit : just saw the attachment, I had that EXACT same error message
Monduman11
Posted: Tue Jun 08, 2010 6:11 pm Post subject: Re: Walking animation help
here it is
Turing:
var chars :arraycharofboolean var x, y :array0.. 5ofint var bullet, Posx, Posy :int:=0 var bullettrue :array0.. 5ofboolean:=init(false, false, false, false, false, false) var ball :int:=Pic.FileNew("fire.bmp") process bulletshoot
loop for z :0.. 5 if bullettrue (z)then
x (z) +=5 Pic.Draw(ball, x (z), y (z),picMerge) if x (z) > maxxthen
bullettrue (z):=false endif endif
endfor delay(10) cls View.Update endloop end bulletshoot
fork bulletshoot
loop Input.KeyDown(chars) if chars ('s')and bullettrue ((bullet + 1)mod6)=false then
bullet +=1
x (bullet mod6):= Posx
y (bullet mod6):= Posy
bullettrue (bullet mod6):=true loop Input.KeyDown(chars) exitwhen chars ('s')=false endloop endif endloop
fire.bmp
Description:
here is the pic
Filesize:
918 Bytes
Viewed:
3545 Time(s)
Cezna
Posted: Tue Jun 08, 2010 6:16 pm Post subject: RE:Walking animation help
Posted: Tue Jun 08, 2010 6:48 pm Post subject: Re: Walking animation help
Here is the shooting without a process.
Turing:
View.Set("graphics:500;500,offscreenonly,nobuttonbar,title:Shooting") var ball1 :int:=Pic.FileNew("fire.bmp") const NUM_BULLETS :=6
type bullet : record
x :int
y :int
isAlive :boolean endrecord
function newBullet (newX, newY :int, newIsAlive :boolean): bullet
var b : bullet
b.x := newX
b.y := newY
b.isAlive := newIsAlive
result b
end newBullet
var bullets :array0.. NUM_BULLETS of bullet
var keys :arraycharofboolean var preKeys :arraycharofboolean
for i :1.. NUM_BULLETS
bullets (i):= newBullet (0, 0, false) endfor
I didint really want to use this one cause TerranceN helped me with it when i couldnt figure out how to do it without a process.
but yea if you could somehow help id appreciate it
Cezna
Posted: Wed Jun 09, 2010 7:12 pm Post subject: RE:Walking animation help
I can't do anything without the picture
Monduman11
Posted: Wed Jun 09, 2010 7:59 pm Post subject: Re: Walking animation help
lol its the pic in the attachment
fire.bmp
Description:
here it is again
Filesize:
2.63 KB
Viewed:
3481 Time(s)
Insectoid
Posted: Wed Jun 09, 2010 8:01 pm Post subject: RE:Walking animation help
@Cezna, You could keep a stock image around for just this type of situation. I find it very helpful.
Anyway, what you want is an array of images with the character in different stages of walking. Keep a counter of what image is being used, and then say, if the left arrow key is pressed, increment the counter by 1 and instead of
Pic.Draw ("Whatever.bmp"), you'd have
Pic.Draw (picArray(counter)).
Using a 2d array of left and right images, you can swap which direction the character is facing for left or right movement using a direction variable. For example (a very pseudo-code-y, incomplete example),
code:
%pics at (0)(0-24) are left-facing, pics at (1)(0-24) are right-facing
var picArray : array 0..1, 0..24 of int
var counter : int := 0
var direction : int := 0
proc animate
if counter = 24 then
counter := 0
else
counter += 1
end if
end animate
loop
if (left arrow pressed) then
direction := 0
animate
elsif (right arrow pressed) then
direction := 1
animate
end if
Pic.Draw (x, y, picArray(direction)(counter))
end loop
You could add an idle pic so if no key is pressed it switches to a default image so he doesn't freeze mid-stride (lawl).