Advertisement



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

New Member?



 
Register 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 07-11-2008, 11:37 AM   #1 (permalink)
Experienced Zuner
 
Rockman87's Avatar
 
Join Date: Nov 2007
Location: UT, USA
Posts: 199
Reputation: 25
Send a message via MSN to Rockman87
Default General Questions


Post General questions here:

Is there a way you can test the games/apps you write for the zune with out debugging it to your zune, and having your zune connected?



__________________

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.




Rockman87 is offline   Reply With Quote
Old 07-11-2008, 11:51 AM   #2 (permalink)
zB Programmer
Experienced Member
 
LedZepp's Avatar
 
Join Date: Mar 2007
Posts: 975
Reputation: 119
Default

__________________

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




LedZepp is offline   Reply With Quote
Old 07-14-2008, 12:35 PM   #3 (permalink)
Experienced Zuner
 
Rockman87's Avatar
 
Join Date: Nov 2007
Location: UT, USA
Posts: 199
Reputation: 25
Send a message via MSN to Rockman87
Default If statement Help

I need help with an if statement.

Code:
 public Texture2D advanceLevel(int score)
        {
            //Level 2
            
                if (score == 10)
                {
                    monsterControl.changeMonSpeed(.5f);
                    return level2;
                }

                //Level 3
                if (score == 20)
                {
                    monsterControl.changeMonSpeed(.75f);
                    return level2;
                }           
        }
This is what I want it to do. But I get the error
Quote:
Error 1 'Xmonster.LevelControls.advanceLevel(int)': not all code paths return a value GocumentsVisual Studio 2008ProjectsZuneXmonsterXmonsterLevelControls.cs 30 26 Xmonster
However I don't want it to return a value if none of the if statements are valid. This class is only called when I advance to the next level. So, there will always be an if statement that is valid. This code changes my background every level...so it passes the new background to game1 depending on what level it is.

[edit]Nevermind, I discovered a solution
__________________

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.

Last edited by Rockman87 : 07-14-2008 at 12:43 PM. Reason: Solved




Rockman87 is offline   Reply With Quote
Old 07-14-2008, 12:38 PM   #4 (permalink)
Jr. Member
 
SimReality's Avatar
 
Join Date: May 2008
Posts: 410
Reputation: 60
Default

Then return null. There is no way to not return something some of the time. So you can have a 'return null;' statement at the end which will satisfy the error, but then you have to make sure that whatever code is calling this method knows it might be getting a null value back.



SimReality is offline   Reply With Quote
Old 07-14-2008, 12:45 PM   #5 (permalink)
Experienced Zuner
 
Rockman87's Avatar
 
Join Date: Nov 2007
Location: UT, USA
Posts: 199
Reputation: 25
Send a message via MSN to Rockman87
Default

ok...thanks. I could probably work with a null.
__________________

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.




Rockman87 is offline   Reply With Quote
Old 07-16-2008, 04:18 PM   #6 (permalink)
Experienced Zuner
 
Rockman87's Avatar
 
Join Date: Nov 2007
Location: UT, USA
Posts: 199
Reputation: 25
Send a message via MSN to Rockman87
Default

What is the best way to reset all the variables to the values they were initialized. Like when you get a game over. This would be so when they click start game again, the game starts at the beginning.
__________________

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.




Rockman87 is offline   Reply With Quote
Old 07-16-2008, 05:04 PM   #7 (permalink)
Zuner
 
Join Date: Jan 2008
Posts: 57
Reputation: 44
Default

reinitialize the class. So if it was
Classname name;

when you want to reset it do
name = new Classname();



Manticore-X is offline   Reply With Quote
Old 07-16-2008, 07:19 PM   #8 (permalink)
Experienced Zuner
 
Rockman87's Avatar
 
Join Date: Nov 2007
Location: UT, USA
Posts: 199
Reputation: 25
Send a message via MSN to Rockman87
Default

Will this add to the memory already in the ram? Should I just create a method that changes the values of all the variables?
__________________

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.




Rockman87 is offline   Reply With Quote
Old 07-16-2008, 07:23 PM   #9 (permalink)
ad majorem dei gloriam
Administrator
Ultimate Zuner
 
Deiparous's Avatar
 
Join Date: Jan 2007
Posts: 6,610
Reputation: 474
Send a message via AIM to Deiparous Send a message via MSN to Deiparous Send a message via Yahoo to Deiparous Send a message via Skype™ to Deiparous
Awards Showcase
Most Flamboyant Personality 
Total Awards: 1
Default

Garbage Collecting is your friend. Not the most efficient way, but easiest to program
__________________

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



Deiparous is online now   Reply With Quote
Old 07-19-2008, 09:52 AM   #10 (permalink)
Experienced Zuner
 
Rockman87's Avatar
 
Join Date: Nov 2007
Location: UT, USA
Posts: 199
Reputation: 25
Send a message via MSN to Rockman87
Default

Is diagonal movement possible on a 30GB dpad?
__________________

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.




Rockman87 is offline   Reply With Quote
Old 07-19-2008, 12:04 PM   #11 (permalink)
zB Programmer
Experienced Member
 
LedZepp's Avatar
 
Join Date: Mar 2007
Posts: 975
Reputation: 119
Default

Quote:
Originally Posted by Rockman87 View Post
Is diagonal movement possible on a 30GB dpad?
Yes, but you would have to press up/down and left/right at the same time, you can code it using an if statement

if (up == buttonsstate.pressed && left == buttonstate.pressed)
__________________

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




LedZepp 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


All times are GMT -8. The time now is 07:56 PM.

 
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