Coder Social home page Coder Social logo

Comments (5)

noelwelsh avatar noelwelsh commented on July 20, 2024

There is currently basic support for animations. Take a look at Orbit.scala in the examples. I have an immediate task to make this a lot better.

You can add multiple drawings to the same window with the current API, but it's not obvious how to do this unless you know the API in quite some depth. I'll look at making this easier, but it will happen after the animation improvements.

I don't have a reliable Internet connection at the moment so my responses will be delayed.

from doodle.

ddemange avatar ddemange commented on July 20, 2024

This would indeed be useful. Any update on this?

Reading the source code of Animation and Orbit, I couldn't find a easy way to display the animation with the Standard Interpreter. I'm planning to use Doodle to teach Scala. I'd like to stay away from the js backend, and rather stick to a regular, simple, Scala app.

Am I missing something?

Thanks

from doodle.

noelwelsh avatar noelwelsh commented on July 20, 2024

@ddemange The rough plan for animations is some kind of FRP system. Could probably build it out of existing parts, like fs2 or monix, and a few changes to the backend.

What is your time frame, and what are teaching goals around animations?

from doodle.

ddemange avatar ddemange commented on July 20, 2024

@noelwelsh Sorry for the late reply.

I'd like to get ready for late october.

This is a course I adapt from a previous one, in which I was relying on Racket, and the universe.rkt teachpack. There, I could easily ask the students to write all the mechanics of the game, while I was taking care of providing the right call to big-bang and potential required conversions. I found universe/big-bang really smooth to use (and to explain to the students while not having to wave hands too much -- this is something I was not ashamed to show).

I don't have teaching goals around animations, per se. Rather, I see it as a way of doing entertaining program exercises. Having something similar to universe/big-bang would save me the re-coding of a whole GUI every time.

Perhaps a simple reactive framework -- limited to clock ticks -- would be enough for me. Something like a simple state monad, where at each step, the state would be "printed" as a doodle Image. Typical workflow:

  • define the type State
  • a conversion function show: State => Image
  • a step function : State => State
  • define a initial state init : State
  • and the step function would be applied (starting from init) at every clock tic, re-showing the current State in the same single frame.

I can see in Orbit.scala some of the above elements, but I fail to see how to use this in the current version of doodle (typically, draw is opening a new Frame each time called).

from doodle.

noelwelsh avatar noelwelsh commented on July 20, 2024

In 0.9 you can draw to a given Frame, which allows animations and multiple images per frame. There is animation support, and the Reactor package provides animations in a similar style to universe/big-bang and the reactors in Pyret.

from doodle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.