susanBuck / e2-fall22

0 stars 0 forks source link

Fun way of thinking about Classes #27

Closed andlearnmore closed 2 years ago

andlearnmore commented 2 years ago

I found this article that discusses OOP in the context of some familiar games: Quick Tip: Intro to Object-Oriented Programming for Game Development. I found it useful as I was working to getting my head around it all so I thought I'd share. I'd love to hear if others find it helpful/fun too.

RobertHolzhauser commented 2 years ago

That's a really fun article, thanks for posting it!

Got me to thinking about other games.

Space Invaders Objects -- Flyings Saucers, bullets (or whatever they shoot), Shelters, and the main defense gun. Properties -- They would all have a position, direction of movement, velocity. Methods -- Move, Shoot, .....

Pong Objects --- Paddles, Ball.

Both would have properties of Position, Speed, Direction. Methods of Move, Impact.

All the best, Robert

susanBuck commented 2 years ago

Thanks for sharing this resource, @andlearnmore. Think I'll incorporate this into "outside readings" for future semesters!

traveler9878 commented 2 years ago

I've never seen object oriented programming explained in terms of 80s video games... cool thanks.