DDR help please?
Author |
Message |
ladum
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
ladum
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
|
|
|
![](images/spacer.gif) |
Insectoid
![](http://compsci.ca/v3/uploads/user_avatars/13760332514cbd0ce972eaa.jpg)
|
Posted: 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) |
|
|
|
|
![](images/spacer.gif) |
|
|