gbdev / gb-asm-tutorial

Learn to create games for the Game Boy using Assembly
http://gbdev.io/gb-asm-tutorial/
MIT License
103 stars 34 forks source link

Part II, Lesson 3 #14

Closed ISSOtm closed 1 year ago

ISSOtm commented 2 years ago

This lesson will introduce player input by allowing the paddle to be moved. As an exception to the general goal of "no cargo-culting", @pinobatch's input routine shall be used, with modifications to "simplify" it. This is because the rationale behind its choices are complex and subtle, and thus out of scope. A footnote could be made, linking to some explanation; though I'm not aware of any discussion of its inner workings that isn't a long Discord thread.

TODO: gb-asm-tutorial's code license is "public domain", whereas Pino's input routine is zlib-licensed. We must figure out either a relicensing deal, or a way to preserve this license. I do not want to use the "repeated ldh a, [rP1] method, as it has shaky origins and copyright implication; Pino's routine is a good unencumbered implementation, and even a simpler version (only using nops, for example) might be considered a derivative work.

The paddle must "collide" with the edges of the playfield; this shall be implemented as a simple position check.

eievui5 commented 1 year ago

I've already got a branch for this, I'll open a PR now that 2's published