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

Username:   Password: 
 RegisterRegister   
 Help with frogger based game please
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
hossack




PostPosted: Fri May 30, 2008 5:06 pm   Post subject: 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



Frogger Rip Off.zip
 Description:
Game

Download
 Filename:  Frogger Rip Off.zip
 Filesize:  43.55 KB
 Downloaded:  154 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
hossack




PostPosted: Sat May 31, 2008 7:45 pm   Post subject: Re: Help with frogger based game please

can anyone help me out? please
riveryu




PostPosted: Sat May 31, 2008 10:35 pm   Post subject: 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




PostPosted: Thu Jun 05, 2008 7:44 am   Post subject: 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?


Chicken Road Game.zip
 Description:
Freeway

Download
 Filename:  Chicken Road Game.zip
 Filesize:  41.97 KB
 Downloaded:  100 Time(s)

S_Grimm




PostPosted: Fri Jun 06, 2008 10:33 am   Post subject: 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




PostPosted: Mon Jun 09, 2008 8:20 am   Post subject: Re: Help with frogger based game please

I did that and it doesnt work
nastynika




PostPosted: Mon Jun 09, 2008 8:31 am   Post subject: Re: Help with frogger based game please

then u must not be implementing the code right
S_Grimm




PostPosted: Thu Jun 12, 2008 12:18 pm   Post subject: 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.
Sponsor
Sponsor
Sponsor
sponsor
hossack




PostPosted: Sat Jun 14, 2008 7:39 pm   Post subject: 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?

code:
%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




PostPosted: Sun Jun 15, 2008 7:26 pm   Post subject: 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




PostPosted: Sun Jun 15, 2008 8:57 pm   Post subject: 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.
code:

....
exits main loop here...

loop
car1X+=1
car2X+=2
exit when (car1X > maxx or car1X < 0) and  (car2X > maxx or car2X < 0)
end loop
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  [ 11 Posts ]
Jump to:   


Style:  
Search: