C
C#2y ago
ren_cross

❔ 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
ren_cross
ren_cross2y ago
Angius
Angius2y ago
Player class doesn't have an image property
ren_cross
ren_cross2y ago
how would u implement it?
Angius
Angius2y ago
Battle() method takes 3 argument, you're passing two
Angius
Angius2y ago
Like your other properties
ren_cross
ren_cross2y ago
right i think i did a little bit 2 much xD
Angius
Angius2y ago
Name of the constructor has to be identical as the name of the class
ren_cross
ren_cross2y ago
im such a newb, sorry x.x
Angius
Angius2y ago
Encounters probably not being a collection of integers
Angius
Angius2y ago
Protip: click this to see the errors
Angius
Angius2y ago
Read them They're usually enough to tell you what's wrong
ren_cross
ren_cross2y ago
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
DaVinki
DaVinki2y ago
nah man 3 months is a lot, you got this
ren_cross
ren_cross2y ago
Also, can you add midi to a project in visual studio? like a midi song
DaVinki
DaVinki2y ago
Is it a console game? Or is it played through another medium?
ren_cross
ren_cross2y ago
its a visual studio console project
DaVinki
DaVinki2y ago
Are you allowed to use 3rd party libraries?
ren_cross
ren_cross2y ago
yeah im allowed to use whatever i want
DaVinki
DaVinki2y ago
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
ren_cross
ren_cross2y ago
the one that is easiest to implement, it will only be played in visual studio 🙂
DaVinki
DaVinki2y ago
With NAudio you just need to create a file reader and a WaveOutEvent Don't forget to dispose though
ren_cross
ren_cross2y ago
seems perfect! Will give it a shot! 😄
DaVinki
DaVinki2y ago
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 file
ren_cross
ren_cross2y ago
my 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
DaVinki
DaVinki2y ago
There you go, loop it until you're out of battle then dispose
ren_cross
ren_cross2y ago
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
DaVinki
DaVinki2y ago
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
Accord
Accord2y ago
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.