From 0d7b415224b62e0bb5f5b8495f96651a70bc9c28 Mon Sep 17 00:00:00 2001 From: sejo Date: Tue, 14 Sep 2021 17:10:50 -0500 Subject: [PATCH] links to uxn tutorial day 6 --- src/atom.xml | 12 +++++++++++- src/log.gmo | 4 ++++ src/tw.txt | 1 + src/uxn_tutorial.gmo | 13 +++++++++++++ src/uxn_tutorial_day_5.gmo | 12 ++++++++---- src/uxn_tutorial_day_6.gmo | 16 +++++++--------- 6 files changed, 44 insertions(+), 14 deletions(-) diff --git a/src/atom.xml b/src/atom.xml index 19873e6..5fdef1e 100644 --- a/src/atom.xml +++ b/src/atom.xml @@ -5,10 +5,20 @@ compudanzas: updates sejo a mano -2021-08-25T12:00:00Z +2021-09-14T12:00:00Z + +https://compudanzas.net/log.html#12021-09-14 +12021-09-14 uxn tutorial day 6, towards pong +2021-09-14T12:00:00Z + + +published {uxn tutorial day 6}, towards pong! + + + https://compudanzas.net/log.html#12021-08-24 12021-08-24 uxn tutorial day 5 diff --git a/src/log.gmo b/src/log.gmo index 0ad76aa..3b905b4 100644 --- a/src/log.gmo +++ b/src/log.gmo @@ -5,6 +5,10 @@ what's happening with compudanzas => ./atom.xml [atom feed] => ./tw.txt [twtxt] +## 12021-09-14 + +published {uxn tutorial day 6}, towards pong! + ## 12021-08-24 published {uxn tutorial day 5}, the mouse and uxntal goodies! diff --git a/src/tw.txt b/src/tw.txt index b1af032..f4e790a 100644 --- a/src/tw.txt +++ b/src/tw.txt @@ -2,6 +2,7 @@ # url = https://compudanzas.net/tw.txt # url = gemini://compudanzas.net/tw.txt # +2021-09-14T20:00:00-05:00 published {uxn tutorial day 6}, towards pong! 2021-08-24T20:00:00-05:00 published {uxn tutorial day 5}, the mouse and uxntal goodies! 2021-08-18T15:00:00-05:00 updated the {uxn tutorial} with changes in the instructions and opcodes: NIP, INC, and LIT 2021-08-11T20:00:00-05:00 published {uxn tutorial day 4}, variables and animation loop! diff --git a/src/uxn_tutorial.gmo b/src/uxn_tutorial.gmo index bffd898..4a85d60 100644 --- a/src/uxn_tutorial.gmo +++ b/src/uxn_tutorial.gmo @@ -58,6 +58,19 @@ we also discuss possible structures to create loops and more complex programs us # day 6 +here we talk about how we can integrate everything that we have covered in order to create even more complex subroutines and programs for the varvara computer. + +we base our discussion in a recreation of the classic pong game! + +besides using previous strategies and snippets of code, we cover strategies for drawing and controlling multi-tile sprites, and for checking collisions. + +=> ./uxn_tutorial_day_6.gmi {uxn tutorial day 6} + +=> ./img/screenshot_uxn-pong-paddles-and-ball.png screenshot showing the stage of the pong game: a couple of paddles at the sides, and a ball at the center + + +# day 7 + coming soon! # external resources diff --git a/src/uxn_tutorial_day_5.gmo b/src/uxn_tutorial_day_5.gmo index 3ce140c..ace67c7 100644 --- a/src/uxn_tutorial_day_5.gmo +++ b/src/uxn_tutorial_day_5.gmo @@ -717,13 +717,17 @@ these are the uxntal instructions that we discussed today! with these, we have c * JSR: unconditionally jump to the address in the working stack, pushing down into the return stack the address of the next instruction in memory * STH: take a value from the working stack and push it down into the return stack. in return mode, do the opposite. -# coming soon: day 6 +# day 6 -the following days of the {uxn tutorial} will consist in discussing all the remaining devices in the varvara computer. +in {uxn tutorial day 6} we talk about how we can integrate everything that we have covered in order to create even more complex subroutines and programs for the varvara computer. -meanwhile, i invite you to keep exploring, to share your findings, and to also take a break! +we base our discussion in a recreation of the classic pong game! -stay tuned! +besides using previous strategies and snippets of code, we cover strategies for drawing and controlling multi-tile sprites, and for checking collisions. + +first, i invite you to take a break! + +then, keep exploring, and share your findings! # support diff --git a/src/uxn_tutorial_day_6.gmo b/src/uxn_tutorial_day_6.gmo index 6056085..fca8f8b 100644 --- a/src/uxn_tutorial_day_6.gmo +++ b/src/uxn_tutorial_day_6.gmo @@ -1,8 +1,6 @@ # uxn tutorial: day 6, towards pong -(work in progress) - -this is the sixth section of the <(uxn tutorial)>! here we talk about how we can integrate everything that we have covered in order to create more complex subroutines and programs for the varvara computer. +this is the sixth section of the {uxn tutorial}! here we talk about how we can integrate everything that we have covered in order to create more complex subroutines and programs for the varvara computer. we base our discussion in a recreation of the classic pong game. @@ -955,11 +953,11 @@ where CLEAR-COLOR in this case would be: %CLEAR-COLOR { #40 } ( clear sprite from the foreground ) ``` -this is a good reminder to review the tables for the sprite bytes in <(uxn tutorial day 2)>! +this is a good reminder to review the tables for the sprite bytes in {uxn tutorial day 2}! ### update position -to update the position of our paddles, we can resort to the hello-moving-sprite.tal example from <(uxn tutorial day 4)>. +to update the position of our paddles, we can resort to the hello-moving-sprite.tal example from {uxn tutorial day 4}. we can use up and down arrows to change the position of the left paddle, and ctrl and alt (A and B) buttons to change the position of the right paddle. @@ -1033,7 +1031,7 @@ BRK note that we are able to move the paddles beyond the limits of the screen. -i invite you to modify the update-paddles subroutine so that there's a limit in the paddles movement. in <(uxn tutorial day 4)> we discussed some possible strategies for achieving it :) +i invite you to modify the update-paddles subroutine so that there's a limit in the paddles movement. in {uxn tutorial day 4} we discussed some possible strategies for achieving it :) # the ball @@ -1339,7 +1337,7 @@ in other languages it is probably easier to write the first one, but here we'll in any case, it can be a good exercise for you to try to figure out how to "invert" the speed with a single arithmetic or logic operation! -hint: look again at the bitwise masks discussed on <(uxn tutorial day 3)> :) +hint: look again at the bitwise masks discussed on {uxn tutorial day 3} :) ### top wall @@ -2043,7 +2041,7 @@ share what you create based on all this! :) that's it for now! -the following day of the <(uxn tutorial)> will consist in discussing all the remaining devices in the varvara computer. +the following day of the {uxn tutorial} will consist in discussing all the remaining devices in the varvara computer. meanwhile, i invite you to keep exploring, to share your findings, and to also take a break! @@ -2051,4 +2049,4 @@ stay tuned! # support -if you found this tutorial to be helpful, consider sharing it and giving it your <(support)> :) +if you found this tutorial to be helpful, consider sharing it and giving it your {support} :)