❔ RPG battle game
So i have to do this RPG Battle game for my class and i can't solve these errors, i think that i did a little bit too much for my experience.
Sorry i know its a lot so please :/
28 Replies
Player
class doesn't have an image
propertyhow would u implement it?
Battle()
method takes 3 argument, you're passing twoLike your other properties
right
i think i did a little bit 2 much xD
Name of the constructor has to be identical as the name of the class
im such a newb, sorry x.x
Encounters
probably not being a collection of integersProtip: click this to see the errors
Read them
They're usually enough to tell you what's wrong
yeah, thing is i just began learning like 3 months ago
i never coded before
so i think im doing 2 much for 3 months
anyway i need to do it
nah man 3 months is a lot, you got this
Also, can you add midi to a project in visual studio?
like a midi song
Is it a console game?
Or is it played through another medium?
its a visual studio console project
Are you allowed to use 3rd party libraries?
yeah im allowed to use whatever i want
You could take a look around nuget for playing audio or look into a p/invoke method part of winmm.dll but the latter isn't cross platform
NAudio is a good choice if you just want it as simple as possible
the one that is easiest to implement, it will only be played in visual studio 🙂
With NAudio you just need to create a file reader and a WaveOutEvent
Don't forget to dispose though
seems perfect! Will give it a shot! 😄
I'll tell you now that the audio will stop playing as soon as you dispose so you need to wait for it to finish
My duct tape solution was to dispose my WavPlayer class with
Task.Delay(length).ContinueWith(DisposeAction)
that delayed at least as long as the longest .wav filemy idea was, when i battle a monster it would start playing the pokemon battle theme song
and whenever i wasnt in battle it would stop
There you go, loop it until you're out of battle then dispose
What if i want to put the file in the bin folder?
Like, i wanna put the mp3 in the bin of the project
so my teacher can listen to it too
I haven't figured out how to include resources in the exe or copy them to the build directory automatically
So don't take it from me but I would include the resources in a compressed file with the entire compiled program and just use the Directory or Environment class to get the current working directory
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.