Unlimited Objects Source Code

In my old blog post I gave some idea how to implement “unlimited objects” program. In the original video I used 16 canvases with 16 images + the actual visible canvas. Two canvases only is sufficient.

In the source (Cerberus X) below, no external graphics files are needed:

The program gives different output, if the calculations are in OnUpdate() on HTML5 target.

Below is the old video I’ve made previously:

Source code license: MIT.

Good Commodore 64 games I’ve previously forgotten and which could be re-made

In my old blog post I discussed my computer gaming history with Vic 20 And Commodore 64. Of course, I forgot some nice games that as re-made could be good games even today.

First, I’d like to mention the game I have discussed before: Stix.

I’ve even started to make a remake of this game to Android. Though, I think this project will take some time to get finished.

One game we played with my friends as youngsters a lot is Artillery Duel.

This could be a nice Android game with possibility to play with others via the internet.

Omega Race has been for example to the Amiga as shareware remake game. It would be nice to make some kind of version of this game to Android, too. Below a video of the Vic 20 version of this game:

I’ve started to make a remake also from this game to Android…

Cataball is also something, that could be interesting to make to Android platform. Video of the Commodore 64 version:

With nice backgrounds with parallax scrolling, the result could be nice.

Also, a version of Gyruss to Android could be nice.

One of my online games reminds me of this game, namely Defense III.

Let’s see how the Android versions turn out to be… 🙂

 

Old School XII – Unlimited Objects

The idea to Old School XII comes from Amiga demos from the early 90’s. First there was lots of competition in the Amiga demo scene on who makes a demo with most amount of bobs (blitter objects) in one 50Hz frame. Eventually we saw bob demos with unlimited amount of bobs!

The amount of bobs is basically unlimited; only the visible area of the screen limits the amount of moving bobs. This is achieved with actually only one bob!

I made today this effect in Monkey X.

The implementation in Monkey X is done by using multiple canvases with images. One canvas is used to draw into screen, the rest of of the canvases are used to achieve the unlimited objects effect.

Below is the video of the Monkey X implementation:

I haven’t yet tested if less amount of canvases is sufficient, but in the beginning of the code I wrote the following:

The only object is drawn subsequently to each of created canvases. The following line does the magic of unlimited objects:
For the end below is one Amiga demo with unlimited bobs:

I made HD (or HQ) version of the video later today:

That’s all for now!

Starfield cube 2 and other Blitz3D demos

I haven’t done much 3D programming in Blitz3D. You can achieve quite a lot with a small effort with it. Also in Monkey2 programming language is the main functionality of Blitz3D. The idea to program a starfield cube came from an Amiga remix tune, that has speech in it: ”Starfield in a box. OMG it is rotating!” Back in the time it was hard to program things like that in assembly on Amiga. Nowadays even I can put a code together, that does the job in Blitz3D.

Starfield cube 2:

Making the starfield cube 2 program made me to create also the following video as a result of inspiration with Blitz3D:

The tiger in the cube (in some parts of the video) is from a photo of my trip to Zoo of Helsinki (Korkeasaaren eläintarha). The tiger seemed to be a bit stressed while people were watching it. Though, I remember someone saying it’s smart, because it uses the same always the same paths, when walking.

Example of Own Font Class in Monkey X

I seem to live in the past… Monkey X programming language has evolved into Monkey2, but I’m still sometimes using Monkey X.

I made an example class to use in Monkey X with bitmap fonts converted with my Font 2 PNG. The example uses old Mojo-module, but old examples on scaling bitmap font made with Font 2 PNG will give you an idea of an alternative way to implementing this.

Next, let’s take a look at a screenshot:

Next to the code:

Font 2 PNG prints the max height of the font after converting. The value is in practice just the height of the png-file.

As a reminder: Font 2 PNG produces two files, font.png and font.dat for one font. The font.dat-file holds the information for each character with two 4 byte integers, first tells the position in pixels in font, the second the width of the chatacter in pixels.

I hope this example gives you some ideas on how to use different fonts converted with Font 2 PNG.

Feel free to use the code above.

PS. I also made new version of part 1 of my Old School series demonstration in Monkey X. Video below:

From the source code in the video you’ll get an idea, how this font class could be used with Mojo2-module.

That’s it from my “hobby corner” tonight!

Old School IX

This morning I made new Old School demonstration in Monkey X. This is now 9th in the series.

Not much is changed in the code from the previous Old School demonstration. What actually required some work, was the font. As in all my Old School demonstrations, I used my Font 2 PNG program. With Mojo2-module one can use for one picture the following: “pic.png”, “pic_n.png” and “pic_s.png”. The programmer doesn’t need to worry about “_n” and “_s” versions of an image, Mojo2 takes care of them. I’ve written all I know from those extra pictures in the first old school post. I may make a better version of it in code-wise and perhaps add some extra too…

Anyway in this 9th version there are 3 versions of each character that are individual png-files.

See the magic: 🙂

I may share the Monkey X source code for these later Old School demonstrations later.

Rolling and Rotating scrolltext (Old School VIII)

I made today a little Monkey X Pro demonstration: Rolling and rotating scrolltext (Old School VIII). Now it works perfectly. Like in Old School VII, the letters fade in and out at the bottom of the circle of letters. I have used my Font 2 PNG program to grab individual characters of a ttf-font to png-images for the program. Perhaps I will later share the source code of the demonstration…

Enjoy the nostalgia! 🙂

The idea behind the code of the rolling and rotating scrolltext:

  • At every update frame 30 characters (png-images) from the scrolltext are drawn in a form of a circle, each character with 12 degrees step (12 *30 = 360), let angle related to this angle be angle1
  • When drawing the character images, the angle that increases in 12 steps is added to each character in addition to this angle is added other angle variable, let this be angle2, that is decreased (the direction of rolling and rotating) by 1 degrees at every update frame
  • Because of my (probably clumsy but working 🙂 )implementation:
  • in DrawImage method rotation angle is angle1 + angle2 + constant that adjusts the letters to the right place on the circle

As to he fade out and fade in for the letter images, you may adjust the letters with alpha values as you best you see it is sensible, probably somewhere at the bottom of the circle.

That’s it! Do try to make make your own version with programming language of your choice. I recommend my Font 2 PNG program for the font.

Good luck!

The first time I saw this kind of effect created was some time in the late 80s on Amiga in following demo:

Ah! Those good old Amiga demos. Kind of magic at their time.

Old School VI 2 and VII Videos

I recently made version 2 from my poor Old School VI video. Today I got finished Old School VII video. Both demonstrations are programmed in Monkey X Pro. VII has that nice demo scene style synth music like Old School V. 🙂

In the Old School VII the the new letters fade in to the screen as the scroll text goes on and when the letters have gone the whole circle, they fade out…

Let the nostalgia flow through you!

First Old School VII:

…then Old School VI 2

I hope you enjoy the videos!

Shortly about my early Amiga times

My first Amiga was Commodore Amiga 500 with Kickstart 1.3 plus TV-modulator in order to get the picture to TV. The contents on the TV were hardly readable as it comes to any text. For playing games quality of graphics output was decent.

Later I got SCART cable to connect the graphics output of Amiga to TV. That was something else, one could even read the text on the TV without getting red eyes and tears. 🙂 A bit later I finally got a 14” monitor to use with Amiga SCART cable as the connect cable for graphics and sound output.

It was 1988 when SoundTracker 2.5 was released, which was the first SoundTracker that didn’t crash on Amigas with Kickstart 1.3. I don’t have any real education on making music. The way I have learned making music was listening to ”real” music and music modules other people had composed with Amiga. As I got my Amiga 500’s audio output connected to an old Pioneer amplifier with big speakers it was simply amazing to listen to Amiga’s music that was built with 8-bit samples.

Working with an Amiga 500 with only 512kb of (CHIP) RAM was quite a limitation. Usually I didn’t use Workbench (Amiga’s graphical user interface) but AmigaDos as operating system environment when programming with Amiga. This was because Workbench of course took some of the limited amount of memory available for the user.

Here’s a video from one unfinished Amiga project I was working 2003 – 2004 (not from my early Amiga times, though 🙂 ):

You may be interested int the source code of the demonstration above.

With only one disc drive (with Amiga 500 I didn’t ever have a hard disk) all the AmigaDos commands were read from directory named ”c” – c for command. For the sake of speed (disc drives are slow) it was possible to put the most used AmigaDos commands to RAM disc or make them “permanent” to RAM memory. I don’t remember the AmigaDos command to do this, but this was faster than reading from the RAM disc anyway… Putting AmigaDos commands to RAM of course also decreased the amount of available memory for example for a text editor and testing the compiled and linked assembly program…

Later, when I bought an additional disc drive, Senator, to my Amiga 500 working got easier: It wasn’t only the question of available memory, but also the available space on a single disc. Full capacity of Amiga’s DD disc is 880kb, the space available after formatting the disc was of course a little less.

When working with the additional disc drive, I made boot disc of my own to start the system, where I had put all the needed AmigaDos commands, libraries, applications and so on. My own work was on the additional disc drive. Ah, how things got easier…

The description above compared to working with desktop systems nowadays may be a bit amusing to younger generations… 🙂

Bouncing of the ball when it touches the Bat (80s Krakout style)

It’s night when I’m writing this. I came up with a little Monkey X tutorial on how to program the bouncing of the ball, when it touches the bat in the “old school way” — like in the popular C64 game Krakout in the 80s.

In the video for the tutorial you can see, that as the ball touches the bat for the first time, delta y doesn’t change. This is because both the ball and the bat are uneven as height in pixels; now both the ball and the bat have a middle point.

This is just a short piece of code, that doesn’t handle the case, when the ball is at the horizontal top or bottom of the bat. There’s some extra work for anyone who wants to make an 80s style Krakout game. 🙂

The delta y for the ball is calculated simply how the ball’s y-position is related to the middle point to the bat. The “scale” variable is used to adjust the max y-speed of the ball.

Source code below:

Feel free to use and improve the source above in your own projects.

Here’s the graphics to download (license: public domain), except the background picture (right click and save as…):

 

 

The bat is 32 x 73 pixels as size, the ball is 16 x 17 pixels.

 

For comparing to the C64’s popular Krakout, see the video below:

Link: Monkey X (from itch.io), it’s free.

Many years ago I started to program Krakout style game in the spirit of the good old Commodore 64, but as usual, something went wrong. Three months work with multiple levels and a level editor programmed in Blitz3D were lost because I hadn’t taken backups of the files, when I, well, “fixed” the Windows installation I had at the time…