Sponsors



Go Back   Zune Boards > Zune Discussions > Zune Games > Development Discussions

New Member?



 
Register Zunecentive FAQ Members List Calendar Search Today's Posts Mark Forums Read

Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related.

Reply
 
LinkBack Thread Tools
Old 06-06-2008, 01:48 PM   #1 (permalink)
Zewbie
 
tamasuperlover's Avatar
 
Join Date: May 2008
Posts: 8
Reputation: 10
$zB: 8
Donate
Default Frogger

Okay. I'm a extreme beginner at programming. And I wanted to give it a try. This is my first project, creating Frogger for the Zune. I'll get a pic of how far I've come soon. Right now, however, the project is at a standstill. I need to know how to:

Program input into the game. example press left of zune pad, frog moves left.

Make it so that when a sprite collides with another sprite it does a task. Example: frog is hit by car. loses life.

Program lives into the game.

Program a score.

Make it so that when all the frogs have gotten into their holes, a screen saying "You win!" comes up and ends the game.

Make it so that if all the lives are lost, a screen saying "You lose" comes up and ends the game.

If someone could tell me all this, I could have the game done in a week. Thanks!

Last edited by tamasuperlover : 06-06-2008 at 04:37 PM. Reason: mistake, used code for emoticon




tamasuperlover is offline   Reply With Quote
Remove Advertisements Sponsored Links
Advertisement
 
Old 06-06-2008, 02:09 PM   #2 (permalink)
zB Programmer
Experienced Member
 
LedZepp's Avatar
 
Join Date: Mar 2007
Posts: 966
Reputation: 114
$zB: 626
Donate
Default

-Program input into the game. exampleress left of zune pad, frog moves left.

In the Update() method of your main class(or your input class) you need to write code for each button you will be using. So for your example you want the left button to move the frog
Code:
if (GamePad.GetState(PlayerIndex.One).DPad.Left == ButtonState.Pressed)
{
(yourSpritePosition).X -= (Float amount you would like to move the sprite left)
}
Making the sprite position variable a Vector2 variable will allow this. You may also want to add a boolean so that it will only move it once instead of moving it as long as the button is pressed like so:
Code:
if (!left && GamePad.GetState(PlayerIndex.One).DPad.Left == ButtonState.Pressed)
{
(yourSpritePosition).X -= (Float amount you would like to move the sprite left)
left = true;
}
if (GamePad.GetState(PlayerIndex.One).DPad.Left == ButtonState.Released)
{
left = false;
}
This assumes you have a boolean called left that is initially set to false. Then as long as left is false when you press the button it will evaluate the expression then set left to be true and it will only move the frog over once. Then once you release the button it will set the boolean back to false.(using an input class i dont believe requires this, you jsut need 2 variables currentGamePadState and oldGamePadState and these are GamePadState variables(you can name them whatever you want)

-Make it so that when a sprite collides with another sprite it does a task. Example: frog is hit by car. loses life.

This is a bit harder, you can use either the Rectangle class or any of the Bounding classes(such as BoundingBox or BoundingSphere), you would then encase your frog in a Rectangle or whatever, and use the (rectangleName).Intersects((otherRectangle or whatever you used));
You would put that in an if statement and it will return either true or false, true means it collided false means it didnt.

-Program lives into the game.

Use an integer variable, set it to however many lives you want, then when a car collides with the frog just subtract one from the variable.

-Program a score.

Again, use an integer variable, set it initially to 0, then increment it whenever you want.
Score += 10; (or something)

-Make it so that when all the frogs have gotten into their holes, a screen saying "You win!" comes up and ends the game.

This is a bit harder, I dont know if you have the code to check if they are in their holes, but i will assume you do. You may have another boolean you can call gameWon and set it to false at the beginning, then surround everything in your Draw() method that you dont want on the winning screen with
if (!gameWon)
This checks if the gameWon variable is false then keep drawing the game
Then just surround the rest of the code with
else if (gameWon)
That means if the gameWon variable is true stop drawing the other stuff and draw this stuff.

-Make it so that if all the lives are lost, a screen saying "You lose" comes up and ends the game.

Pretty much same as the last one except you can change the
if (!gameWon)
to
if (!gameWon && lives != 0)
this checks to see if the game isnt won and the lives are greater than zero
You may also put this into your draw method outside of both the gamewon and !gamewon
if (lives == 0)
and just code the game over screen there.




LedZepp is offline   Reply With Quote
Old 06-06-2008, 04:42 PM   #3 (permalink)
Zewbie
 
tamasuperlover's Avatar
 
Join Date: May 2008
Posts: 8
Reputation: 10
$zB: 8
Donate
Default

Uh, i'm getting an error message that says

'int' does not contain a definition for 'X' and no extension method 'X' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)

I made code for moving right, but it gives the same error message. elp?




tamasuperlover is offline   Reply With Quote
Old 06-06-2008, 04:46 PM   #4 (permalink)
Support Team
Expert Zuner
 
soccerfreak24's Avatar
 
Join Date: Nov 2007
Posts: 2,890
Reputation: 178
$zB: 39
Donate
Default

Awesome, frogger in developement!? Woot. Glad to see you've taken on the challenge of creating a zune game, and Good luck. Too bad I can't help with any of your problems..
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.





soccerfreak24 is offline   Reply With Quote
Old 06-06-2008, 05:19 PM   #5 (permalink)
zB Programmer
Experienced Member
 
LedZepp's Avatar
 
Join Date: Mar 2007
Posts: 966
Reputation: 114
$zB: 626
Donate
Default

Quote:
Originally Posted by tamasuperlover View Post
Uh, i'm getting an error message that says

'int' does not contain a definition for 'X' and no extension method 'X' accepting a first argument of type 'int' could be found (are you missing a using directive or an assembly reference?)

I made code for moving right, but it gives the same error message. elp?
Reread my post
Quote:
Making the sprite position variable a Vector2 variable will allow this. You may also want to add a boolean so that it will only move it once instead of moving it as long as the button is pressed like so:
You really shouldnt be taking on this big challenge for your first game




LedZepp is offline   Reply With Quote
Old 06-06-2008, 11:14 PM   #6 (permalink)
Jr. Member
 
ZeroCool2021's Avatar
 
Join Date: May 2007
Location: Zune land
Posts: 252
Reputation: 14
$zB: 46
Donate
Default

Frogger YES!
Simpe too




ZeroCool2021 is offline   Reply With Quote
Old 06-07-2008, 12:36 PM   #7 (permalink)
Experienced Zuner
 
Join Date: May 2008
Posts: 207
Reputation: 12
$zB: 170
Donate
Default

You really shouldnt be taking on this big challenge for your first game[/quote]

what is a good thing to start with, then?




cable729 is offline   Reply With Quote
Old 07-05-2008, 07:58 AM   #8 (permalink)
Zewbie
 
tamasuperlover's Avatar
 
Join Date: May 2008
Posts: 8
Reputation: 10
$zB: 8
Donate
Default

Okay, computer crashed. Can't work on Frogger or upload the full MP3 WARS file. Will fix as soon as possible. Sorry. Typing on freinds computer. Repeat: will fix as soon as possible.




tamasuperlover is offline   Reply With Quote
Old 07-15-2008, 04:58 AM   #9 (permalink)
Experienced Zuner
 
dabeastofdamusic's Avatar
 
Join Date: May 2008
Location: somewhere in NC my zunetag is username
Posts: 171
Reputation: 11
$zB: 141
Donate
Default

its been over a month have you released it yet? not even alpha?
__________________

To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 0 or greater. You currently have 0 posts.

error occered, no keyboard, press (F1) to continue




dabeastofdamusic is offline   Reply With Quote
Old 07-15-2008, 05:40 AM   #10 (permalink)
Experienced Zuner
 
Flash Gordon's Avatar
 
Join Date: Feb 2007
Location: Phoenix, Arizona
Posts: 153
Reputation: 24
Send a message via AIM to Flash Gordon Send a message via MSN to Flash Gordon Send a message via Yahoo to Flash Gordon
$zB: 121
Donate
Default

I'm pretty sure that if he released it, he'd have posted it somewhere.




Flash Gordon is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


Register and remove this ad

All times are GMT -8. The time now is 03:11 AM.

 
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC8
vB Ad Management by =RedTyger=
(C) ZuneBoards 2006-2007
Copyright © 2006 - 2008 Zune Boards | About Zune Boards | Legal | A member of the Crowdgather Forum Community