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

Development Help For help from coding to error finding to that one thing you just can't get right

Reply
 
LinkBack Thread Tools
Old 10-19-2009, 04:27 PM   #1 (permalink)
Squirt
 
Join Date: Oct 2008
Posts: 26
Fallenarms3 is on a distinguished road
Default NEED HELP (I'm completely lost here)

All this is no longer a problem:
I can see the light on the horizon with this new app I'm making for the Zune HD, but I'm stuck on the simplest of things. The app uses a BUNCH of small .wav files as sound effects. So I've got them all listed out:
Code:
        SoundEffect string1A;
        SoundEffectInstance string1AInstance;
        SoundEffect string4Asharp;
        SoundEffectInstance string1AsharpInstance;
        SoundEffect string4A;
        SoundEffectInstance string4AInstance;

etc,etc,etc
like that, in the namespace. PLEASE NOTE the use of the word "string" in the names doesn't mean I'm trying to make a string; that's just the name I want to use. That's correct, right? Feel free to laugh at me if it's not. Anyways, now how do I play them? It's... really that simple. I've tried all sorts of tutorials and inspected source code for several projects, but nothing seems to work with the latest Zune XNA. Or maybe I'm doing it wrong. If someone could just tell me the verb used to play a sound...


See later for the real problem.

Last edited by Fallenarms3; 10-19-2009 at 06:45 PM.



Fallenarms3 is offline   Reply With Quote

Advertisement [Remove Advertisement]
Old 10-19-2009, 05:08 PM   #2 (permalink)
you lost the game.
zB Programmer
Moderator
Elite Zuner
 
itsnotabigtruck's Avatar
 
Join Date: May 2008
Posts: 2,434
itsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud ofitsnotabigtruck has much to be proud of
Default

IIRC there's a Play method on SoundEffect that plays the effect and creates a SoundEffectInstance that you can use to stop it. For that reason you probably don't want to create a whole bunch of SoundEffectInstance variables ahead of time.
__________________

signature by vettexl




itsnotabigtruck is offline   Reply With Quote
Old 10-19-2009, 06:36 PM   #3 (permalink)
Squirt
 
Join Date: Oct 2008
Posts: 26
Fallenarms3 is on a distinguished road
Default

Thanks for replying. With some help from a guy on an IRC I visit, I was able to get it sorted out. Now I'm hung up on nondescript errors, which prove to be even more annoying.

Ok, so here's the deal. I'm going to upload the current project and link it. If anyone can get it to debug without crazy errors, tell me how, please. I'm way over my head here. I'm not sure if I'm using the touchscreen controls correctly.

A basic description of what I want to do:

When the user is touching certain regions on the screen, I want it to set an integer variable (string1,string2,string3,string4) to a value (1-5, depending on the position). Then, if the user is touching another part of the screen, I want it to play a note based off the value of one of those variables.

Tell me if more explanation is required. If anyone can just give me a tutorial on all the touchscreen functions that would be great.

the files:
http://cid-5ea5c2eaa6cabfe5.skydrive.../ZuneGame1.zip

Last edited by Fallenarms3; 10-19-2009 at 06:53 PM.



Fallenarms3 is offline   Reply With Quote
Old 10-19-2009, 09:44 PM   #4 (permalink)
Experienced Member
 
Tiptup300's Avatar
 
Join Date: Apr 2008
Posts: 806
Tiptup300 has disabled reputation
Default

You may want to use enums like

enum InstrumentType
{
Guitar,
Piano,
}

and enums for the notes

enum Note
{
A,
ASharp,
B,
C,
CSharp,
D,
DSharp,
E,
F,
FSharp,
G,
GSharp,
}

then use dictionaries.



Tiptup300 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools