Results 1 to 3 of 3
- 12-16-2012, 11:48 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 37
- Rep Power
- 0
How would I use a sound clip class, static or not?
this might be a stupid question... but it's one of those moments when I look back and go, hold on. do I want to do this?
ok so I have a soundClip class with instance variables and methods. methods like play, stop, set loopcount etc. it's basically a small class to delegate the sequencer code for sound effects.
my question is do I make this class static or not?
I didn't make it a static class but then I thought, isn't it silly to create an instance of this in each of my classes that need sound?
my sprite class is a static class with image arrays and reference numbers.
isn't sound kinda the same thing, a resource to be shared?
so basically do I turn my soundclip class into a static class with private static variables and static methods or not?
how is sound usually handled in games. what is logical?
- 12-17-2012, 02:59 AM #2
- 12-17-2012, 05:29 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,606
- Blog Entries
- 7
- Rep Power
- 17
Re: How would I use a sound clip class, static or not?
I think you have your terminology wrong (als see Darryl's reply); only nested classes can be static; I assume you mean a class with only (public) static methods? (not unlike the System class). If there really is no need for an instance of your class it can be a possibility ...
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Can non-static Inner Class have static fields ?
By fatabass in forum New To JavaReplies: 3Last Post: 02-05-2012, 09:47 PM -
Static and non static class methods question
By silverglade in forum New To JavaReplies: 2Last Post: 05-14-2011, 10:10 PM -
how to program sound into your class
By jaytee in forum New To JavaReplies: 2Last Post: 03-13-2010, 09:42 PM -
Java class HashIt with a static recursive method and a static iterative method
By kezkez in forum New To JavaReplies: 3Last Post: 02-09-2010, 05:22 AM -
sound clip
By f_the_cook in forum Advanced JavaReplies: 4Last Post: 10-17-2008, 05:19 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks