massimo

massimo

Scenic as a game dev tool

I’ve tweeted this yesterday and it’s getting some attention, so I decided to post it here to share comments, ideas and answer questions, if anybody got some :slight_smile:

The tweet can be found here
https://twitter.com/wstucco/status/1046485501774057473

What I did is write a custom Scene module and a custom Component model on top of Scenic, reusing and extending Scenic’s own Scene and Component modules, that automatically keep track of component creation and can communicate.
The Scene has an internal list of children components and send to each of them an :animation_frame message on regular intervals, the interval is the amount of milliseconds coming out from the formula

trunc(1_000 / FPS * multiplier)

Note:
The timing is not perfect yet, 60 FPS generate an interval of 16ms, which is actually 62.5 FPS
I’m starting a series of posts on this argument and the first one will about writing a Timer that has resolution in the microseconds instead of milliseconds (I’ve managed to have an std deviation of about 30 microseconds at 60 FPS)

You can find some more information on this thread
https://twitter.com/BoydMulterer/status/1046497642442678272

I will use this post as placeholder to post about progresses in the area of pixel animation without having access to pixels

I’ll post the code of the project as soon as I’ll be back home on my couch

With Scenic Elixir enters in the arena of GUI applications and it does in a pretty spectacular way

Most Liked

massimo

massimo

I’ve just completed another little challenge

This time I’ve implemented the color cycling effect natively in Elixir and Scenic

All the code, including decoding and re-encoding the PNGs and their palettes is pure Elixir

I will release it soon on Gitlab

For those who don’t know what color cycling is

Color cycling , also known as palette shifting , is a technique used in computer graphics in which colors are changed in order to give the impression of animation. This technique was mainly used in early computer games, as storing one image and changing its palette required less memory and processor power than storing the animation as several frames

I was heavily inspired by this demo

https://twitter.com/wstucco/status/1051168787347705856

16
Post #9
massimo

massimo

Code is online for those interested :slight_smile:

massimo

massimo

@AstonJ @amnu3387

The code is online :slight_smile:

Where Next?

Popular in Questions Top

tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: The documentation above suggests that while ...
New
nobody
Hi! In PHP: $_SERVER[‘SERVER_ADDR’] - in Elixir? Searched the docs for ip address and the web, no good results. Thanks!
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

electic
Hi, I am new to Elixir. I am trying to use the DateTime component to insert a date into MySQL however the there seems to be no way to fo...
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
danschultzer
None of the current solutions worked well for me, so I went ahead and built a user management system from scratch. This project took far...
548 29703 241
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
komlanvi
Hi everyone, I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

We're in Beta

About us Mission Statement