Online Pokitto Python Editor improvement suggestions

My main suggestions are already issues on the GitHub repo but I’ll reiterate them here for the beneefit of people who haven’t seen the issues.

Firstly, a way to make the editor colour image pixels without any additional restrictions on the identifiers that people can use.
(E.g. by using special comments.)

Secondly, like @wuuff suggested, a physical button for stopping the emulator.

And thirdly, a compile-only button, so basic syntax checks can but run without having to actually run the game.

COLLAPSE ALL (or fold all) in the editor

I’d be nice if we can get sound in the emulator, not sure how that’d work online. I think I remember needing the users ‘permision’ in some way to do sound, like tying the audio playback to a button or something (it’s been a long time since I looked at sound, pre-html5 days).

No need to ask for permission. The problem with sound is that the current HTML5 API is CPU-intensive and deprecated. The replacement API is still being designed and not available yet.
It should be easier for the offline emulator, but I have to look into how audio works in SDL first.

You have to load in wav data and then use a callback to populate a buffer.
I’m pretty sure I’ve got an example somewhere, but it might be in C# rather than C++ and I’d have to dig it out.
(A long time ago I wrote a C# wrapper for SDL, but I never published it because then people would expect me to maintain it. :P)

I’ve found the example I was thinking of and it is in C#.
I can PM it to you if you think it will be useful.
(And explain any C#-specific stuff that you might not be familiar with, but most of it speaks for itself, it’s only the Marshal class that I think might be a bit confusing.)

I’ll have a dig around to see if I’ve got a C++ example of doing SDL audio, but I’m not sure if I do or not.
(I’ve got an SDL+OpenGL demo if it helps. :P)


Looks like I don’t have any C++ examples, just the C# example.

If the C# and the C++ APIs are similar, then I’m sure it will be useful. :slight_smile:

1 Like

I went out of my way to make them almost identical, so hopefully it will be useful.

I’ll PM it to you to save derailing the thread.
(If anyone else is interested they can just PM me to ask for a copy.)

Pokitto Simulator is using SDL for graphics and audio.

Edit: Python games work in the simulator with sound :slight_smile: But the environment is not nearly as friendly as in the Online Python Editor.

1 Like

I was going to ask for a ‘Tilemap.get_tile_id(x, y)’ but noticed it’s has already been added. I’m not sure about the purpose of the ‘tileSize’ argument though…

Another thing concerning the API. A way to read/write data on Pokitto’s EEPROM would be nice.

2 Likes

Here my personal wish list, order by preference

  1. I would find useful have access to some primitives drawing function:
  • DrawPixel
  • DrawLine
  • DrawRect
  • FillRect
  • DrawCircle
  • FillCircle

  1. In the editor I suggest to have tabbed files instead of the combobox selector.
  2. I think there should be a way to search (find) on all project files.
  3. I’d love to have Ctrl+Click to go to method definitions, and maybe a cross reference of the usage
2 Likes

I agree about primitives, and global search/replace. Those would be very useful.

2 Likes

These have been requested in somewhere else, so I put them here:

  • Blitting the bitmap on screen with mirrored or rotated (by 90/180/270 degrees) direction. That would save rom also.

I also would like to have a simple “music composer” functionality in the editor, a bit similar to this:

That would be a simplified version of the above and using the same “Sprite” editor feature as bitmaps and tilemaps. In addition, this “musicmap” editor would have a same kind of rolling cursor that, if the play button has been pressed, would continuously play the notes of the active musicmap as you edit it.

4 Likes

9 posts were merged into an existing topic: Playing music

@spinal’s Music player system seems like a good candidate for implementing this at low level: Playing music

1 Like

The GUI looks like a prototype, should be polished a bit, for example I’d change the fixed-width font for something more clean (except for the code editor of course).

2 Likes

I agree that some UI polish would be needed, but not many are good in that (me included). It would be great if you care to draw a mockup of your suggestions.

3 Likes

I tried to style the page a little but apparently I’m not that great at it either :slight_smile: I have some free time tonight though, so I’ll send any results if I manage to succeed.

3 Likes

Is there an easy way to transfer the color palette of the code project to piskel?

maybe a possibility to save/load code to/from github? :slight_smile: (this is probably not a priority)

3 Likes