Computer Science Canada

megaman style game ...help

Author:  Chaos_Theory [ Mon Nov 22, 2004 7:12 pm ]
Post subject:  megaman style game ...help

k... you know how in mega man...how you run...

pic1 -> pic 2 -> pic 3 -> pic4 -> pic5 -> pic6 -> pic7 -> pic8 -> pic9

pic1 through 3 will only repeat once...while you hold teh button...then it will go into pic 4 through 6 which will repeat until you let go of the btton...when pic 7 through 9 wil play... then you press the button again to continue??? gow do you do that???... ive been trying for like a weekk and i cant fugure it out... i was thinking to put pics 4-6 in a loop that would exit when no buttons are pressed... but i cant figure out how to get it to exit when you let go of the "right or left" arrow keys...

can somebody plz help?

Author:  Cervantes [ Mon Nov 22, 2004 8:54 pm ]
Post subject: 

I'm not sure if I correctly understand what you are saying, but here's the basic idea I came up with. The details may be wrong, but you can fix those up:

code:

picNumber = 1

case picNumber of
   
    label 1 :
        Draw pic1
        picNumber = 2
    label 2 :
        Draw pic2
        picNumber = 3
    label 3 :
        Draw pic3
        picNumber = 4
    label 4 :
        Draw pic4
        picNumber = 5
    label 5 :
        Draw pic5
        picNumber = 6
    label 6 :
        Draw pic6
        if mouse_is_down then
            picNumber = 4
        else
            picNumber = 7
        endif
    label 7 :
        Draw pic7
        picNumber = 8
    label 8 :
        Draw pic8
        picNumber = 9
    label 9 :
        Draw pic9
        if button_is_pressed then
            picNumber = 1
        endif
       
end case

Author:  Chaos_Theory [ Mon Nov 22, 2004 10:36 pm ]
Post subject: 

yah thanks... that seems like it should work... never really thoiought cases could be used like that 8) o well... though...i just want to point out that i didnt want the mouse to clck to keepi it going...so here is what i think would be more useful to me...(and anyone else who wants a similar system) ill sorta explain alil for ppl who may not under stand how my system works...and a lil test for ppl who wanna try it 8)

code:

var pic1, pic2, pic3, pic4, pic5, pic6, pic7, pic8, pic9 : int
var RunCycle : int
var chars : array char of boolean

pic1 := Pic.FileNew ("File Path")
pic2 := Pic.FileNew ("File Path")
pic3 := Pic.FileNew ("File Path")
pic4 := Pic.FileNew ("File Path")
pic5 := Pic.FileNew ("File Path")
pic6 := Pic.FileNew ("File Path")
pic7 := Pic.FileNew ("File Path")
pic8 := Pic.FileNew ("File Path")
pic9 := Pic.FileNew ("File Path")

loop

Input.KeyDown (chars)

if chars (KEY_RIGHT_ARROW) then
RunCycle := 1
case RunCycle of
   
    label 1 :
        Pic.Draw (pic1,x , y, picMerge)
        delay (5)       
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 2
    label 2 :
        Pic.Draw (pic2,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 3
    label 3 :
        Pic.Draw (pic3,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 4
    label 4 :
        Pic.Draw (pic4,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 5
    label 5 :
        Pic.Draw (pic5,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 6
    label 6 :
        Pic.Draw (pic6,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
       
       if chars (KEY_RIGHT_ARROW) then
            RunCycle := 4
        else
            RunCycle := 7
        endif
    label 7 :
        Pic.Draw (pic7,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 8
    label 8 :
        Pic.Draw (pic8,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
        RunCycle := 9
    label 9 :
        Pic.Draw (pic9,x , y, picMerge)
        delay (5)
        Draw.Fill Box (x1,y1,x2,y2,colour)
       
   end case

end if
end loop



basically... that should work as is...you just need to get 9 pics ... and change the file paths...so taht iy cna find those pics....

thanks Cervantes... and if you want me to explain this (anyone) just pm me...im getting tired...lmao

Author:  Mazer [ Tue Nov 23, 2004 8:28 am ]
Post subject: 

So... Turing Help, eh? Tsk.
(moved)


: