Guitar Hero theme problem
Author |
Message |
LostUser
|
Posted: Wed Jun 03, 2009 12:00 pm Post subject: Guitar Hero theme problem |
|
|
What is it you are trying to achieve?
I'm trying to achieve a guitar hero game
What is the problem you are having?
I got the bars to move but I don't know how to get it so if you click this button then the bar will dissapear
and I want to have multiply bars going at the same time
Describe what you have tried to solve this problem
I don't know enough...
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
This is what I got so far I want to put like lots of for commands.... but like one box goes at a time, I don' t want that, is it possible to get multiple multiple boxes to go, I made it like that but it looks awkward and is flickering
Turing: |
View.Set ("offscreenonly")
View.Set ("graphics:600;800,position:centre;center,nobuttonbar")
procedure bacground
%Border1
drawfillbox (90, 0, 100, maxy, grey)
%Border2
drawfillbox (500, 0, 510, maxy, grey)
%Background
drawfillbox (100, 0, 500, maxy, black)
%Perfect Target Zone
drawfillbox (100, 80, 500, 90, red)
%Control 1
drawfillbox (100, 20, 200, 40, yellow)
%Control 2
drawfillbox (200, 20, 270, 40, blue)
%Control 3
drawfillbox (330, 20, 400, 40, blue)
%Control 4
drawfillbox (400, 20, 500, 40, yellow)
%Spacebar
drawfillbox (100, 1, 500, 20, green)
%spacebar mid filler
drawfillbox (270, 20, 330, 40, green)
%Border separating controls
drawfillbox (100, 40, 500, 43, grey)
%control 1 border
drawbox (100, 20, 200, 40, black)
%control 2 border
drawbox (200, 20, 270, 40, black)
%control 3 border
drawbox (330, 20, 400, 40, black)
%Control 4 border
drawbox (400, 20, 500, 40, black)
%Top of space bar
%Right side
drawfillbox (100, 0, 100, 20, black)
%Left Side
drawfillbox (500, 0, 500, 20, black)
%bottom of space bar
drawfillbox (100, 1, 500, 1, black)
%bottom
drawfillbox (100, 0, 500, 0, grey)
end bacground
for decreasing y : 801 .. - 20 by 25
drawfillbox (100, y, 500, y + 19, green)
View.Update
delay (70)
bacground
end for
loop
for decreasing y : 800 .. - 20 by 25
drawfillbox (100, y + 20, 200, y + 40, yellow)
View.Update
delay (70)
bacground
end for
for decreasing y1 : 800 .. - 20 by 25
drawfillbox (200, y1 + 20, 270, y1 + 40, blue)
View.Update
delay (70)
bacground
end for
for decreasing y2 : 800 .. - 20 by 25
drawfillbox (330, y2 + 20, 400, y2 + 40, blue)
View.Update
delay (70)
bacground
end for
for decreasing y2: 800. . - 20 by 25
drawfillbox (400, y2 + 20, 500, y2 + 40, yellow)
View.Update
delay (70)
bacground
end for
end loop
|
Please specify what version of Turing you are using
4.1.1 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Diablo117
![](http://compsci.ca/v3/uploads/user_avatars/6345067144872e0c7b2cf1.jpg)
|
Posted: Wed Jun 03, 2009 3:36 pm Post subject: Re: Guitar Hero theme problem |
|
|
For loops will only run the code that is inside of them then exit. You need to update their locations in a different way, without for loops, but counters. A computer can only do 1 task at a time, so it would run your for loops in order, moving 1 box at a time. |
|
|
|
|
![](images/spacer.gif) |
DtY
![](http://compsci.ca/v3/uploads/user_avatars/8576159234be48b7a8b0e8.png)
|
Posted: Wed Jun 03, 2009 4:57 pm Post subject: Re: Guitar Hero theme problem |
|
|
Diablo117 @ Wed Jun 03, 2009 3:36 pm wrote: For loops will only run the code that is inside of them then exit. You need to update their locations in a different way, without for loops, but counters. A computer can only do 1 task at a time, so it would run your for loops in order, moving 1 box at a time.
Just to put it out there, turing can do more than one task at the same time using the fork command, however since forked processes are run independently of main program, you will have to do some advanced timing to make everything move properly using that. |
|
|
|
|
![](images/spacer.gif) |
|
|