❔ Learning C#
Hello Guys,
I have been doing a lot of theory lately (WinForms) to see whats possible and see the basics. Now I wanna practise with little programs. I have already done Numberguessing and Connect4 both of them were really fun to program. What else would you recommend programming? Which database is preferable if I want to program something with it SQLite or MS Access? I also see lots of people recommending just to code but as long as you don´t get feedback for it is it really gonna get u to get better as a programmer? Don´t wanna get into bad habits and want to learn coding properly. Any help appreciated
63 Replies
did those people also recommend not to use winforms? 😃
but it should be fine still if you're planning to just learn the language
I will start to work on Tuesday and there we use Xamarin(mobile) for client WinForms and WPF
so I kind have to learn all 33
regarding database question, nobody really uses ms acccess, sqlite is fine
DONT LEARN WINFORMS OR WPF
My only advice
Waste of time
wpf is fine
The problem I had with numberguessing and Connect4 is that I did it in console without really applying oop
It’s inferior to all the other alternatives
so I am looking for a bigger "game" project that applies interfaces composition oop
pls elaborate
The book I am following rn has Tetris in there so I will do that one next
yeah that's a nice to start with... or perhaps just a console game
I have done 2 console games already actually 3 if we count wordle
this is what I found aswell but its a bit bigger so I will do it after tetris
any content similar to this that teaches u side by side how to do a bigger project?
thats cool, I wish I had the time to make my own console game 😭
I struggle with class design not even with the actual programming
you mean inheritance?
no I went through all the principles kind of
I knkow what they are
WPF is not cross platform, it has a smaller ecosystem, it is losing support from Microsoft, has shit syntax and conventions, low performance. Blazor, maui, uno, etc are the modern solutions you should be using. They are easier to use, more robust, and are the target of Microsoft’s future.
its just that lets say I wanna program a little RPG like this
without any help I would struggle to build it because I wouldnt know how to plan the classes interfaces inheritance composition together
so its not the actual logic programming that I struggle in first place
ngl this game looks super cool to program:
I just thought maybe there are better smaller ideas first before I get into this
but if its too small like wordle or numberguessing or even connect4 where I dont really need class design per se Its not very interesting for me to program rn
Just Look up how basic infrastructure in games is, like gamoloop threads etc, or ask chatgpt ;)
I wish there was a site with lots of good design examples
to learn from
with explanations
tons of them you can find on the internet really, you just need to find the correct keyword for them
I have seen a few bad ones so its hard to judge if thats the right way
if you just want to learn the concept of rpg game, then there are tons of them on youtube even
not just rpg game just general
after all I wont be programming rpgs at my work
rpg is just an example because this is the only project I found that teaches u how to program something like this with explanation
and because its fun
also there are tons of aspects in rpg game..
inventories, character/enemy stats, item stats etc...
most important is the dialog system that you're going to use in-game
ye for rpg I found that project so I am good with that one I think lookking for similar projects
I just found this
https://www.thecsharpacademy.com/project/12
it has a few projects
but there seems to be no solution
and you should make your own tooling for that in a sense that you don't need need to code each item stats, character stats and hard coding your characters dialog in your code
or like kind of "best practise" to code those projects
I just sorta mentioned it before your post
so everything in your game can be dynamically added, updated, adjusted etc
of course they don't need to be a full blown game editor, just a simple helper tools to help you manage your inventories, char stats etc while making your game
oh you mean instead of programming everything urself?
isnt that more towards game engine then?
for me its not about getting a good game out its about the programming experience
nope, you're making your own tools to make your life easier when developing games. This is a common practice
oh well then thats what I already plan to do
can u see the classes?
this is how far I got with my design
ah yes, then you should think of your stats for example
where commmon stats can be hp, mp, def mp.def etc
the problem I have rn is appearently I shouldnt make a new class for each different axe for example
and where uniquestats can be your enemy/character specific stats
and each different axe is just a new object from the axe class but a new item itself
I thought maybe doing it with the rarity pattern so a common axe , rare axe, legendary axe all just objects of the class axe
and the class axe itself adds additional stats on to that weapon depending on what rarity I created the item
so in the constructor i suppose
and uniquestats being?
SlimStv#2835
and where uniquestats can be your enemy/character specific stats
Quoted by
<@!726512159940411422> from #Learning C# (click here)
React with ❌ to remove this embed.
yes but specific example?
like related to it's type for example
like fire, water etc
everyone would have that no? u mean like fire resistance as stats for example?
do you want them to have all on each enemy/character? if so then sure
also if the character is a magic user then they should have a different property than any other non-magic characters in the game
ye that would be way too advanced for now just get the core game design down
what do u think of the different weapons the way i described it?
also would u use different classes for each different armor piece? I kind of think of a base armor platebody class and use decorate design pattern to makke it a gold platebody forexample
same thing.. you can do
ye but each different weapon a different class?
you don't need to, no.. see the baseclass there? you can set for your base weapon property there such as weapon name, description, etc and the interfaces will do the rest (whether it's physical or magical weapon)
u see my class diagram? so thats bullshiet what I did there?
yes
thats just for base axe class I wanted to get different kind of axes aswell
yes 😃 and the above was explaining about that
for example I needed 2H swords (so I cant equip a shield with it) and normal swords
but I guess this behaviour I can solve it with I2HWeapon
oh wait I cant
the problem with that design above is if I use the same class for an axe and same for a sword I cant have different type of attacks based off of the type of weapon
you can make your
Axe
as a separate class it's up to you
so your Axe class can as well implement IPhysical too
or if the Axe class had a magic property you can also implement both IPhysical and IMagical to it
the impl here is up to you as the creatorbut each type of an axe
shouldnt have its own class
like my problem to understand is
its like I have a car class for all cars
(Weapon) for me
now we can have audi ford, fiat whatever right
those should be all different classes
in my case it could be axe,dagger,sword, 2hSword and so on
now lets say audi has a very old car with less functionality
and a new audi comes out with more functionality
shouldnt that come from the IaudiFunctionality
the old ones would have nothing implemented
and for the new ones the new functions would apply
this is where I struggle in oop design
like how to manage this
that's correct, thus we have two interfaces there.. and if the Axe does have a unique property that's not in both IPhysical or IMagical then you can make a another base class specifically for the Axe class and use that instead..
tbh BaseWeaponClass + IPhysical/IMagical should be enough but it depends on how you wanted it I guess
you should see draksouls for example, the property for the Axes there are the same with the sword
the only difference is that they're much heavier
cant we do a property in the Iphysical interface for IsTwoHanded bool type?
sure
and when I create the axxe object I can just give that object the parameter to initialize
I guess I can just try to do it with the minimalist approach as u said
and if I realize I need more I can still exxtend it with more classes
and just copy paste code I guess I should just start eventually and see when I run into problems design wise
and not try to overthink as I do rn
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.