New version after 3 months, and turtle graphics
Lua Carousel » Devlog
This version may matter a lot to some people. I massively sped up `print` calls in Carousel. So if you are in the habit of printing a lot to the lower half of the screen, you'll want this.
Someone asked me if LÖVE or other languages support Turtle graphics like in Logo. The answer is: no, but it's easy to build. Then of course I had to build it in Carousel:
X, Y = Safe_width/2, 200 angle = 90 state = 'down' color(0,0,1) function up() state = 'up' end function down() state = 'down' end function forward(d) local a = angle*pi/180 local x2 = boundx(X+d*cos(a)) local y2 = boundy(Y+d*sin(a)) if state == 'down' then line(X,Y, x2,y2) local a2 = 15*pi/180 line(x2,y2, x2-10*cos(a-a2), y2-10*sin(a-a2)) line(x2,y2, x2-10*cos(a+a2), y2-10*sin(a+a2)) end X,Y = x2,y2 end function left() turn(-90) end function right() turn(90) end function turn(da) angle = angle+da end function boundx(x) return max(0, min(Safe_width, x)) end function boundy(y) return max(0, min(Safe_height, y)) end forward(100) turn(120) forward(100) turn(120) forward(100)
If you try pasting this program into Lua Carousel, remember to first run the abbreviations on one of the example screens. Or if you've deleted that screen, here are the abbreviations I used in this post:
g = love.graphics line = g.line color = g.setColor min, max = math.min, math.max pi, cos, sin = math.pi, math.cos, math.sin
Files
carousel-bj.love 118 kB
24 days ago
carousel-bj-safe.love 118 kB
24 days ago
Get Lua Carousel
Lua Carousel
Write programs on desktop and mobile
Status | In development |
Category | Tool |
Author | Kartik Agaram |
Tags | LÖVE |
More posts
- Guest program: bouncing balls14 days ago
- Interactively zooming in to the Mandelbrot set on a touchscreen43 days ago
- A little timer app44 days ago
- New version after 4 monthsJun 28, 2024
- Visualizing the digits of πMay 04, 2024
- A little recursion problemApr 15, 2024
- Drawing histogramsApr 03, 2024
- The simplest possible ditherMar 30, 2024
- All the 1-D cellular automataMar 23, 2024
Leave a comment
Log in with itch.io to leave a comment.