-
• #2
Awesome - thanks! Are you thinking of turning that into an app that can be installed?
Just to add - I notice that Mario (and maybe some other stuff?) is a high res bitmap of something pixellated. If RAM usage becomes a problem you could just use the low-res image and do:
g.drawImage(mario,90,130,{scale:4});
Or something like that to make Bangle.js do the scaling for you.
-
• #3
Hi,
It was just a work of few hours so I didn’t think more about performance. So yes I will take your suggestions.
This is an BangleJs app and as of now hosted on my Bangle App Store. Will do a PR .
-
• #4
Thanks everyone for having look on my watch face.
@Gordon, thanks for your suggestion, I have reduced the image size and it is now much lower.As a next step I am trying to animate mario jump. My code is available as APP here .
When you press BTN1, mario will jump. But I am not happy with the jump animation performance on actual clock. It is bit flickering.
An in othr example, like Flappy Bird, Horse Race, or in Trex, animation is smooth.
Any suggestions to make it better?
-
• #5
I'd say the best bet would be to use
Bangle.setLCDMode("120x120")
- this uses an offscreen buffer and doubles pixels. You then just callg.flip()
when you're ready and it updates without flicker.It also means that you could hopefully avoid having to use
scale
- because everything is basically already scaled by 2 anyway. There's also80x80
for 3x scalingIt does mean that you can't use Widgets, but you weren't using those anyway.
-
• #6
Just a note but after uploading the app and jumping, I see:
Uncaught ReferenceError: "brick" is not defined at line 8 col 21 g.drawImage(brick,i,200);
in the console
-
• #7
Sorry!! just fixed the issue.
-
• #8
Ok, great!! I will modify my code for 120x120 mode.
-
• #9
Hello everyone,
I am happy to share my updated version on Super Mario Clock 2.
https://abhigkar.github.io/BangleApps/index.html
This is a performance improved version for LDC mode 120x120. Added some animation in BTN1 click.
Image resources are new further optimized for size and improved for quality.
https://youtu.be/xRdNjOT7BtA
-
• #10
That's great! Looks a lot better!
Just wanted to publish my work.
Source code is available
https://abhigkar.github.io/BangleAppsDev/index.html
Check on emulator:
https://www.espruino.com/ide/emulator.html?codeurl=https://raw.githubusercontent.com/abhigkar/banglejs-pacman-clock/master/supermario.js&upload
YouTube Demo: https://www.youtube.com/watch?v=RHXvka_Jxj0
1 Attachment