Why don't use OOP to gain flexibility?

Hi all, i go right to the point
I just finished Text 101 section and i was a little disappointed by last videos, why instead of continue to add functions for every text state dont we create an unique function that print the text of the curent state and the possible choises? I think it is possible with just an array of key-value couples or even an external .txt file.
Had someone made something like that or is a thing i’ll see in next lessons??

2 Likes

[EDIT] i was thinking to OOP and classes because it can be done even in more complex ways, but i think an array or other simple structures will go well too

2 Likes

Hello Andrea, how are you?
There are plenty of improvements that could be done to the structure, but imo it was made this way so people without any experience in neither C# or Unity can follow up, it eventually gets better near the end of the course.

1 Like

Ditto what Johnny has said here, the beginning of the course is aimed for people very new to any form of programming.

You obviously could go to town on a Text101 style adventure and create classese for locations, enemies, player, items, inventory and more, you could also consider breaking the story “out” of the actual code and perhaps reading it in, maybe from XML, or a webservice, or database.

As introduction games go, this one has the potential for a great deal of individual learning and experimentation. I believe most students focus on the story and aim to make that more unique adding more complexity via all of the states and so on, this does of course help to reinforce what they have been taught so far in the course which is great, it also often brings out a lot of each students creativity which is awesome to see.

Why not give it a go and see what you can create and then share it with the community, put together a little explanation of the design considerations/choices you made, what was tough, what was easy, it could be very inspirational to other students :slight_smile:

2 Likes

Im now in brick breaker section and it actually goes much better :smiley: I think i was just a little impatient cause i try to implement every lesson in to my project, but that was too basic :stuck_out_tongue:
Im very entusiantic about the course, the learning curve is starting raising!!

2 Likes

Keep it going :slight_smile:
I do recommend that you try to improve/modify the games of each section, most that I’ve learned during the course was doing that.

2 Likes

Privacy & Terms