Pokitto Games in JavaScript

Well, yeah. It depends on what you are used to.

Same with the properties of the button presses, there is A instead of e.g. pressedA or keyA.
Here:

        if (A)
            this.color++;
        if (B)
            this.color = 0;

Also using caps for these variables (A,B,C,UP,DOWN,LEFT,RIGHT) could lead to think they are constants (at least for C/C++ coders).

I just feel that the code would be more understandable (especially people new to coding or to javascript language) with a bit more elaborate names for functions and properties. Too long names are confusing also and make the code to look complex.

1 Like

This is the outcome of an evening coding a test game with MicoMan. Getting used to to tool and API, and refreshing Javascript skills. I chose a mini-pacman as a test game because of simple mechanics and that it can easily be extended to take a scrolling tilemap feature into use (if implemented to the API). Sorry about the choppy gif.

MicoMan

I really like how fast you can make changes in the code and immediately start it in the browser to see how it looks :slight_smile:

6 Likes

Added the animation.
MicoMan2
Here are the sources if someone needs them.
micojs-project (22).zip (14.6 KB)
You can just drag-and-drop those to MicoJS IDE to try yourself.

1 Like

Added some more objects.
Ok, I think this is all I am going to test MicoJS for now. When new features come available I can try more.
MicoMan3
micojs-project (26).zip (20.0 KB)

4 Likes

The IDE and the gaming API felt totally suitable for gamedev. There are some really nice features, like a very quickly starting web simulator and a handy way to take backups quickly.

The biggest drawbacks are that the error context info (e.g. line numbers) is missing, and that there is no way to stepwise debugging. So you will be adding to your code a lot of debug prints to find out errors.

5 Likes

@FManga On Pokitto the screen is upside down (!). The gfx also look like “washed” like it was scaled or filtered.
Pokitto binary:
pokitto_-NO0fIQOE40EZSIhSmWO.bin (165.1 KB)

1 Like

Thanks for the bug report. A small change in the build system caused it to ignore the My_settings.h flags.
Fixed it!

3 Likes

someText.charAt(10) does not work in Pokitto (returns ‘undefined’), only in Browser.
Edit: the same problem with someText[10] in Pokitto

Posting my little experiment here too:

kea

KillEmAll.zip (57.6 KB)

7 Likes

I implemented charCodeAt(10), which gives you an ascii char instead of creating a whole new string with a single char in it. Will that do?
I haven’t done the string manipulation functions yet.

2 Likes

That looks vicious! :rofl::japanese_ogre:

2 Likes

Yes, now I can read the tile codes from the ascii map and get the collision checks to work in HW too :grin:

Here are the latest sources of MicoMan:
micojs-project (30).zip (20.5 KB)

I see you are testing bitmap rotating :slight_smile: I would like to test that and zooming also.

1 Like

So I’ve played around a bit with the initial demo game:

micojs-project.zip (5.7 KB)

UP, DOWN, LEFT, RIGHT to move the Tygro character in the middle around
C and D to rotate it
A and B to shrink/grow the Tygro sprite…

The colors of the moving “wheel” sprites in the background flip around when pressing A (shrink Tygro)… I don’t understand why… Everything else seems to work okay.

But overall: I love how quickly the game compiles and runs in micojs. :slight_smile:

2 Likes

When you press A it increments color:

        if (A)
            this.color++;

Which it then uses in the render method:

        setPen(this.color);
        image(this.img, this.x, this.y);

To see the original sprite’s colors, make sure to use setPen(0); before calling image.

2 Likes

Ooops… should have read the entire example code, I guess… Thanks. :laughing:

Weird problems with the debug() command.

  • If I call it only once, it do not print anything. Try attached program. It should print “controlScheme == random” at line 169. But if I uncomment the other debug() few lines below it prints both lines (!)
    micojs-project (32).zip (25.9 KB)
  • If there are a lot of debug() commands (i.e. printed each frame), even if the game is stopped if will still be printing those for e.g. 10 seconds or more. During that time you cannot restart the game.

HINT:

If you have a long source file and the interpreter tells there is an error (it does not tell the line number ), you can spot the red error in the minimap on the right side of the editor. If the minimap is not visible you need the scroll the editor window until you see it.

This just happened to me. I called the class method (test()) from another class method (update()), but forgot to use this.test() and used only test().

Here is a default project with just test() function and (invalid) call added:
micojs-project (37).zip (3.0 KB)

The IDE debug window correctly said “Uncaught ReferenceError: test is not defined” in the debug window. But it says it only once. If I try to change something and press run again, it do not say anything. The program just starts with an empty screen. Only if I close the tab and restart MicoJS it gives the error again, but only once.

Edit: Now, when I tested it the compilation windows says “unexpected identified” (which is a correct thing to say). It did not say it when I first tried it. This is a bit random.