
-----------------------------------
hossack
Fri May 30, 2008 5:06 pm

Help with frogger based game please
-----------------------------------
I want my chickens tail to switch back and forth i have 2 pictures for that and i have know clue how to do it and also i need help getting my if you get hit statement working

edit:: new file

-----------------------------------
hossack
Sat May 31, 2008 7:45 pm

Re: Help with frogger based game please
-----------------------------------
can anyone help me out? please

-----------------------------------
riveryu
Sat May 31, 2008 10:35 pm

Re: Help with frogger based game please
-----------------------------------
Think of a switch, it is either on or off, and your picture is either one or the other. 
If you didnt know before, boolean type variables have true or false. 
You can use if and then statments and the boolean type to determine which pic to display. 
Eg. 
if (moved left) then
left := true
elsif (moved right) then
left :=false
end if

if left then
change to left pic 
else
change to right pic
end if

If you plainly put change pic without a "switch"(the boolean variable changes) in the "if user pressed key" statement then the user have to hold the key in order for it stay in the changed form.

-----------------------------------
hossack
Thu Jun 05, 2008 7:44 am

Re: Help with frogger based game please
-----------------------------------
I need help making it so that if i get hit then its game over. I have what i thought i should do but its not working. Can someone please help?

-----------------------------------
S_Grimm
Fri Jun 06, 2008 10:33 am

RE:Help with frogger based game please
-----------------------------------
Recently, another person asked for the same advice. Ill tell you the same thing I told her. 

if chicken coordinates = car coordinates then
quit
end if


check out this topic:
http://compsci.ca/v3/viewtopic.phpt=17958&highlight=frogger

-----------------------------------
hossack
Mon Jun 09, 2008 8:20 am

Re: Help with frogger based game please
-----------------------------------
I did that and it doesnt work

-----------------------------------
nastynika
Mon Jun 09, 2008 8:31 am

Re: Help with frogger based game please
-----------------------------------
then u must not be implementing the code right

-----------------------------------
S_Grimm
Thu Jun 12, 2008 12:18 pm

RE:Help with frogger based game please
-----------------------------------
the code works. i can tell you that she got it to work just fine. if you take a look at her code you might understand how it works.

-----------------------------------
hossack
Sat Jun 14, 2008 7:39 pm

Re: Help with frogger based game please
-----------------------------------
Thanks a lot for the help! I got it to work. 

I have my opening title screen and then once you click it should go the instructions screen. It doesn't work. Any suggestions?

%Opening Scene
Pic.Draw (opener, 1, 1, picCopy)
loop
    buttonwait ("down", xm, ym, buttonnumber, buttonup) %Clicking to go to Instructions
    if xm > 1 and xm < 800 and ym > 1 and ym < 400 then
        exit
    end if
end loop

Pic.Draw (instructions, 1, 1, picCopy)
loop
    buttonwait ("down", xm, ym, buttonnumber, buttonup) %Clicking to go to Instructions
    if xm > 1 and xm < 800 and ym > 1 and ym < 400 then
        exit
    end if
end loop

thats what have and the instructions dont show up all it does is make it so i have to click twice.

-----------------------------------
hossack
Sun Jun 15, 2008 7:26 pm

Re: Help with frogger based game please
-----------------------------------
i fixed the instructions. How can i get the cars to stop moving. ie When you win or lose, i want the cars to be gone off the screen how could i go about doing this?

-----------------------------------
riveryu
Sun Jun 15, 2008 8:57 pm

RE:Help with frogger based game please
-----------------------------------
If you had all of them in a loop then exit the loop and do a end game animation when you either increase or decrease their x until they are out of screen, using loop and if and thens. 
e.g.
 
....
exits main loop here...

loop
car1X+=1
car2X+=2
exit when (car1X > maxx or car1X < 0) and  (car2X > maxx or car2X < 0) 
end loop

