gifs for day 4

This commit is contained in:
sejo 2021-08-11 21:45:37 -05:00
parent 3f17e3daeb
commit a87509a9d2
4 changed files with 10 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -450,6 +450,8 @@ however, this repetition might not allow for a smooth movement like what we can
the following program allows us to control the horizontal position of our square using the arrow keys. the following program allows us to control the horizontal position of our square using the arrow keys.
=> ./img/screencap_uxn-moving-square.gif animated gif showing a square moving horizontally in the screen, apparently controlled by a human.
note the similarities between the previous program, and what we covered on day 3! note the similarities between the previous program, and what we covered on day 3!
``` ```
@ -551,8 +553,8 @@ EQU2 ( is x equal to screen width - 8 ? )
,&continue JCN ,&continue JCN
&increment &increment
( increment sprite/pos-x ) ( increment sprite/pos-x )
.sprite/pos-x LDZ2 #0001 ADD2 .sprite/pos-x STZ2 .sprite/pos-x LDZ2 #0001 ADD2 .sprite/pos-x STZ2
&continue &continue
``` ```
@ -768,6 +770,8 @@ note that it uses a sequence similar to the previous programs:
the clear sprite section is not actually needed in this case because of the colors that are used, but it would be when using colors with transparency in them :) the clear sprite section is not actually needed in this case because of the colors that are used, but it would be when using colors with transparency in them :)
=> ./img/screencap_uxn-animation.gif animation of a diagonal stripe inside a pixelated square. the diagonal moves from bottom right to top left
``` ```
( hello-animation.tal ) ( hello-animation.tal )
@ -873,8 +877,12 @@ we can use these macros to divide the frequency in our code:
.Screen/addr DEO2 ( set computed address ) .Screen/addr DEO2 ( set computed address )
``` ```
=> ./img/screencap_uxn-animation-quarterspeed.gif animation of a diagonal stripe inside a pixelated square. the diagonal moves from bottom right to top left. it moves slower than the previous one.
ah, way better! ah, way better!
## not powers of two ## not powers of two
note that if you want to divide the frequency to numbers that are not powers of 2, you might start to see some glitches approximately every 4 seconds: this is due to framecount overflowing and not giving a nice sequence of results for those divisors. note that if you want to divide the frequency to numbers that are not powers of 2, you might start to see some glitches approximately every 4 seconds: this is due to framecount overflowing and not giving a nice sequence of results for those divisors.