Friday, October 9, 2020

Pong7

 Nice, nice, nice!


Once one hits Pong7, one encounters Object Oriented

Programming. Classes are not built into LOVElua, but the

project defines class itself. In short, LOVE is designed so that one

can do this. One can see what is involved - in my experience - for

th first time. And I have finally come to appreciate what the concept

of class simplifies in programming: it is a handy form of housekeeping

which dramatically reduces the amount of coding needed. 



So Ball is now an instance of a class, and has a method called update.

All I have to do is call this in main, and the position of the ball gets updated...


From Ball.lua:


From main.lua:



The next game intro references two books that seem very interesting. The

first goes into the particularities of the LOVE engine. The second - which one can 

read online - talks about game paradigms.




No comments: