![]() |
Forum Index : Microcontroller and PC projects : Heart Attack (game)
![]() ![]() |
|||||
Author | Message | ||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
Don't worry!! You can make very cristal clear music on the CMM2 using MOD files. You can use samples at 44100Hz, including sound effects as samples at this frequency with WAV files played in stereo at this frequency too. Isn't a problem at all. I use 22050Hz only to squeeze maximum performance because my games are more "performance-hungry" and I make all I can do to speed up the things a little. |
||||
MauroXavier Guru ![]() Joined: 06/03/2016 Location: BrazilPosts: 303 |
Things work this way: Look at the little screenshot that I posted ago. When you import a sample, you need to set the main frequency in that screen (on the left side), and above you define the transpose note. If you upload a 44100 Hz sample and set it as a note "A", then when you use upper notes it will play it faster or slower in lower notes. In the standard MOD file, the notes change the speed of the samples, and if you want to maintain the tempo in each note, you need to make a loop (look in the middle of the image), defining when to Start and to End the waveform. Only for clarification, I'm not a musician and not a "MOD file expert", I'm only an enthusiast game developer. All the things that I do with MOD music I learned trying alone and reading some docs. Then I can't talk about real music notation because I don't even have good ears to distinguish some notes. |
||||
bar1010 Senior Member ![]() Joined: 10/08/2020 Location: United StatesPosts: 197 |
My advice is do what you are comfortable with, not what other people are comfortable with. |
||||
PeteCotton![]() Guru ![]() Joined: 13/08/2020 Location: CanadaPosts: 543 |
Feedback is much appreciated... ![]() Heart Attack (by TweakerRay).zip I just got a chance to play it. Very well done! Lots of fun. Thanks for sharing. |
||||
TweakerRay![]() Senior Member ![]() Joined: 01/08/2020 Location: GermanyPosts: 138 |
My advice is do what you are comfortable with, not what other people are comfortable with. True... But his advice has valid and good points and I am thankful for the advice from all people here so I get better in coding and it really helps to see the code better. Also all help from Mauro is much appreciated - this cleared a lot of fog in my knowledge about the sound options here. @Retro Joe: I see it as PeterCotton: This is for me a hobby and If I use a "?" for a "Print" , sure its not elegant but I would not say its a grafitti on a church... I am beginner... I did not know better. This are workethics. (And this should be fun... But I get the point that a cleaner code is better) I tided my code a little bit... so please download the latest version of the game. And bare with me ;-) I am a beginner not a magician programmer. Also maybe Important: the new version also has a smaller mp3 so the filesize in total is reduced. (I changed the mp3 from 320kbit to 160Kbit/s) - I found out that the CMM2 has problems playing MP3s which holds coverinformation in the file. Download the game here: HEART ATTACK V1-1 Cheers TweakerRay http://tweakerray.bandcamp.com |
||||
TweakerRay![]() Senior Member ![]() Joined: 01/08/2020 Location: GermanyPosts: 138 |
I added WII Controller to the game ;-) So you can now play it with the digital joypad and b for bombs on a controller or ona keyboard with the coursor keys and b So you can now either use the keyboard or the WII Controller from the front to avoid checking all the allowed keys and all the stuff that happens when you use your keyboard (For instance the little yellow sign moves in the same direction you last moved it if you dont press another key...) I simply changed the incoming buttons to strings which will be checked like it's keyboard presses... with that I don't need to programm everythin again. 2 Questions for the more experienced programmers here: Do anyone know if that will make a big lag ? Or can the cmm2 handle that ? For me it's okay... Because of getting a error message and abort of the programm when no controller is connected I had to use "ON ERROR IGNORE"... So I check at beginning if that error code is there... Is there a clever way how you can avoid to use this "On Error Ignore" Or is this how you have to do it ? Download the new Version here: Heart Attack (by TweakerRay)_v1-2 with controller support.zip Cheers TweakerRay http://tweakerray.bandcamp.com |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
So I check at beginning if that error code is there... Is there a clever way how you can avoid to use this "On Error Ignore" Or is this how you have to do it ? Hi TR, this is the correct way to do that (from Sasquatchs Mandelbrot code): DIM TRUE =1 On Error Skip 1 Wii Nunchuk Open If MM.ERRNO = 0 Then HaveChuk = True and later If HaveChuk Then If Nunchuk(Z,3) = 1 Then K = 73 'Zoom in If Nunchuk(C,3) = 1 Then K = 67 'Re-Center ... Gruß Michael causality ≠correlation ≠coincidence |
||||
TweakerRay![]() Senior Member ![]() Joined: 01/08/2020 Location: GermanyPosts: 138 |
Danke Two Fingers ;-) Do I need to close connection of the Classic Controller also somehow ? Or if a controller is not connected is the errorcode check enough ? Or for better coding close it ? I have not done this before. So any advice would be appreciated. Cheers TweakerRay http://tweakerray.bandcamp.com |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
Hi TR, i'm not very familiar with this nunchuk thing. I would think it doesn't matter if the nunchuk channel is open. But I assume that it is not open when an error message appears. I think it's just good style to close a nunchuk channel - no risk of data loss like with open files. I don't know for sure. A look at the source code might help (or Peter clarifies). It can also help if you read working sample code. Kind regards Michael causality ≠correlation ≠coincidence |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10315 |
If the Wii open command fails with an error then the port will not be left open from V5.05.06RC3 onwards. Before that release it was left open in some cases by mistake but that would be benign and have no impact on the program. |
||||
twofingers![]() Guru ![]() Joined: 02/06/2014 Location: GermanyPosts: 1593 |
@Peter, THANKS! causality ≠correlation ≠coincidence |
||||
TweakerRay![]() Senior Member ![]() Joined: 01/08/2020 Location: GermanyPosts: 138 |
Thanks a lot ! @matherp. http://tweakerray.bandcamp.com |
||||
TweakerRay![]() Senior Member ![]() Joined: 01/08/2020 Location: GermanyPosts: 138 |
I just bump this up again... maybe someone else likes to play it ? Heart Attack (Game) with WII Controller (or Keyboard) support Cheers TweakerRay http://tweakerray.bandcamp.com |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |