|
  
|
|
|||||||
| Development Discussions All developers who are coding games may stop by here for any help, suggestions, and everything development related. |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) |
|
Zewbie
Join Date: May 2008
Posts: 8
Reputation: 10
Donate |
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 ![]() |
|
|
|
| Remove Advertisements Sponsored Links | |
Advertisement |
|
|
|
#2 (permalink) |
|
zB Programmer
Experienced Member Join Date: Mar 2007
Posts: 966
Reputation: 114
Donate |
-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)
}
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;
}
-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. ![]() |
|
|
|
|
|
#3 (permalink) |
|
Zewbie
Join Date: May 2008
Posts: 8
Reputation: 10
Donate |
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? ![]() |
|
|
|
|
|
#4 (permalink) |
|
Support Team
Expert Zuner Join Date: Nov 2007
Posts: 2,890
Reputation: 178
Donate |
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. ![]() ![]() |
|
|
|
|
|
#5 (permalink) | ||
|
zB Programmer
Experienced Member Join Date: Mar 2007
Posts: 966
Reputation: 114
Donate |
Quote:
Quote:
![]() |
||
|
|
|
|
|
#9 (permalink) |
|
Experienced Zuner
Join Date: May 2008
Location: somewhere in NC my zunetag is username
Posts: 171
Reputation: 11
Donate |
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 ![]() |
|
|
|
![]() |
| Thread Tools | |
|
|
| |