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

Username:   Password: 
 RegisterRegister   
 DDR help please?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ladum




PostPosted: Tue Jun 09, 2009 3:52 pm   Post subject: DDR help please?

Hi, 'm looking for a way to make the arrows move up the screen one after the other, , i need more than one arrow on the screen at a time... without using forks... i've tried arrays but the arrows move up the screen very choppy, here is a sample of one of the forks... please help?

process pdown
loop

Sprite.Hide (boo)
Sprite.Hide (perfect)
Sprite.Hide (correctds)
Sprite.Show (sdown)
timerunning := Time.Elapsed
exit when timerunning > 88000
counter := counter + 1
%Move the sprite up
for i : arrow2 .. maxy + 50 by 5


Input.KeyDown (chars)
if chars (KEY_DOWN_ARROW) and i > 825 and i < 850 then
response := 1
Sprite.Hide (sdown)
Sprite.Show (perfect)
Sprite.Show (correctds)

end if
Sprite.SetPosition (sdown, 275, i, true)
delay (1)
View.Update

end for
if response = 1 then
perfects := perfects + 1
response := 0
else
boos := boos + 1
end if

delay (1)
end loop
end pdown
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Jun 09, 2009 8:14 pm   Post subject: Re: DDR help please?

ladum @ Tue Jun 09, 2009 3:52 pm wrote:
the arrows move up the screen very choppy

View.Update
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
ladum




PostPosted: Tue Jun 09, 2009 8:43 pm   Post subject: Re: DDR help please?

even when i used that it still seemed choppy, for the array one... here's a sample

loop
for i : 1 .. 4
if height (i) = 1 then
Sprite.SetPosition (spriteArrow (i), 400, d (i), true)
Input.KeyDown (chars)

if Math.Distance(400,d(i),400,885)<25 and b(i)-1 not = 1 then
Sprite.Hide (perfect)
Sprite.Show (boo)
elsif chars (KEY_UP_ARROW) and d (i) > 775 and d (i) < 875 then
Sprite.Hide (sup)
Sprite.Show (perfect)
b(i):=1
end if

elsif height (i) = 2 then
Sprite.SetPosition (spriteArrow (i), 150, d (i), true)
Input.KeyDown (chars)
%if d (i) > 855 and
if Math.Distance(150,d(i),150,885)<25 and b(i)-1 not = 1 then
Sprite.Hide (perfect)
Sprite.Show (boo)
elsif chars (KEY_LEFT_ARROW) and d (i) > 775 and d (i) < 875 then
Sprite.Hide (sleft)
Sprite.Show (perfect)
b(i):=1

end if
elsif height (i) = 3 then
Sprite.SetPosition (spriteArrow (i), 275, d (i), true)
Input.KeyDown (chars)

if Math.Distance(275,d(i),275,885)<25 and b(i)-1 not = 1then
Sprite.Hide (perfect)
Sprite.Show (boo)
elsif chars (KEY_DOWN_ARROW) and d (i) > 775 and d (i) < 875 then
Sprite.Hide (sdown)
Sprite.Show (perfect)
b(i):=1

end if
elsif height (i) = 4 then
Sprite.SetPosition (spriteArrow (i), 525, d (i), true)
Input.KeyDown (chars)

if Math.Distance(525,d(i),525,885)<25 and b(i)-1 not = 1then
Sprite.Hide (perfect)
Sprite.Show (boo)
elsif chars (KEY_RIGHT_ARROW) and d (i) > 775 and d (i) < 875 then
Sprite.Hide (sright)
Sprite.Show (perfect)
b(i):=1

end if
end if

d (i) := d (i) + 1
delay (1)
View.Update

end for
delay (100)
Sprite.Hide (boo)
Sprite.Hide (perfect)
%exit when counter

end loop
Tony




PostPosted: Tue Jun 09, 2009 8:47 pm   Post subject: RE:DDR help please?

have you set the view type?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Insectoid




PostPosted: Wed Jun 10, 2009 5:01 pm   Post subject: RE:DDR help please?

You need View.Set ("offscreenonly") before you draw anything, preferably the first line of the program (excluding comments)
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 1  [ 5 Posts ]
Jump to:   


Style:  
Search: