Online Python Editor for Pokitto!

Sorry for the double-post, but it seems that operator overloading doesn’t work for *.
If I try to overload it I get the following error:

TypeError: unsupported type for operator 

With the traceback pointing to the c = a * b line.

It seems that the same applies to / and //.

For comparison I tested online in rextester and the code for * works in rextester,
but the code for / and // didn’t so those two might be a general language problem,
but * should be working and it isn’t.

It turns out I had one too many underscores, so actually /, // and * all work in rextester (and presumably other full python environments) but none are working in the pyinsky editor, they all result in a TypeError.

(In case anyone is wondering why I need this,
I decided to resort to implementing fixed points in an attempt to work around not having floats,
and a = b * c looks a lot better than a = Q8x8.multiply(b, c).)

It was there for “programmer macho bullsh*t” :grin:

1 Like

Here is some info about CPython vs. MicroPython (but nothing related to operator overloading): https://github.com/micropython/micropython/wiki/Differences

Also some MP modules are left out because of memory constraints. In the future it might be possible to select in Python editor different MicroPython configurations depending on your application needs.

Has anyone noticed that on HW too?

Yes I see the same behaviour.

1 Like

I’m in! Just do a online editor like the python one and people will join.

3 Likes

I guess there is a situation where the bitmap lands on an odd line. Because pixels are packed 2 per byte, the second pixel is either cropped out or drawn with overflow data from the source image

2 Likes

I would love to do a game in assembly. Akin to zachtronics type games.
I wonder how difficult it would be to implement something like the tec redshift on pokitto. The fictional game console in exapunks.

2 Likes

Personally I don’t like online editors. I’m still hoping for an offline version.

Real CPUs are far more complicated than Chip-8 or TIS-100.
There’s no ‘print to screen’ instruction, you have to manually push the arguments onto the call stack (or place them into the correct register(s)) before using the (correct) call instruction.

(Some stuff about the ISA used by the Pokitto’s CPU: here and here.)

I can’t find any documentation for TEC Redshift,
but from what I can tell programs are only ever distributed as source code,
so inventing a set of bytecode instructions for it shouldn’t be too hard.
The real difficulties would be the graphics and the timing.

By the way, a fun fact about TIS-100:
the challenges are actually implemented in Lua.
(This page documents where you can find the lua files for custom challenges.)

1 Like

Oh my gosh that is so awesome!!

1 Like

Lua is used a lot in video games so it’s a good scripting language to know.

It’s also used in Don’t Starve, Garry’s Mod, Psychonauts and many others.

Note: this is the official micropython IDE & competition thread. Lua and other discussions should be in a different thread.

EDIT: its no big deal, but just if you want to discuss the topic in length, then another thread is better suited

1 Like

I would like to remove my previous entries and replace with my new Game Gallery which is an all in one with the 3 games I’ve made in this amazing editor :smiley:
EDIT: Now with updated menu and sounds!
TorsGameGallery.zip (97.8 KB)
tgg.bin (173.3 KB)
Github
torsGameGallery

Instructions:
Arrows to select a game (there are only 3 currently). C to play!
On menus of game-over screens press B to return to the gallery selection page.

2 Likes

You could make a minigame collection like WarioWare, and calculate the points together. Each field has a time limit, at each round the pace is faster.

That was actually one of my main inspirations was WarioWare :smiley: the narwhal game does go faster on a timer. So I could just switch that to be used in all 3 games and update the score to also be globally used.
Not sure I’d want to speed up each game though. It is more a gallery of mini games. So one should have different scores and features than the others. But I do need to figure out saving scores.

Saving to SD or EEPROM is not yet supported, so you have to memorize your best score :stuck_out_tongue_winking_eye:

2 Likes

I’ve updated Noggin with bug fixes and sound…

Noggin.bin (188.8 KB)
NogginSource.zip (151.0 KB)

source includes permission for title screen font and license for sfx.

4 Likes

Much like some classic arcade games! Screenshot sharing for proof :wink:

1 Like

Does this mean that sound is supported now by the online editor?

1 Like

Yup :slight_smile: it sure does.

2 Likes