The fifth PortablE example (a SOTB-like scroller) + MORE!

10 posts / 0 new
Last post
ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
The fifth PortablE example (a SOTB-like scroller) + MORE!

Here is the fifth example of the next release of PortablE:
Example 5: SOTBScroll.e

This is a pretty "Shadow Of The Beast's" like scroller.  It is based upon a DarkBASIC demo by Frederic Cordier, with music taken from the AmiDARK version.  However, I was able to drastically simplify the code thanks to PortablE's "wrapped sprites".  Wrapped sprites make parallax scrolling (& scrolling backgrounds in general) very easy to do - no need for complex & error prone maths.

I have also included the source code for the original DarkBASIC demo, and a direct "NoSprites" PortablE port of that.

Further examples will be forthcoming! And don't forget the earlier examples:
Example 1: ShootEmUp.e
Example 2: SimpleModPlayer.e
Example 3: ToySpaceshipSprite1.e
Example 4: ToySpaceshipSprite2.e

Please note that examples with music need the ptplay.library installed.  You can get it from here:
aminet.net/package/util/libs/ptplaylib_os4 (OS4)
aminet.net/package/mus/play/PTPlayLibrary (OS3 & MOS)

As a reminder:

I have released a "full preview" of the next version of the PortablE programming language. It is now aimed at beginners & those new to the E language. Previous releases of PortablE were aimed at existing AmigaE users, and those familiar with AmigaOS programming. But after more than a year of development, PortablE is much easier for beginners to pick-up & play with:

* It now comes with some nice modules for graphics, sound, music & GUIs. These require no knowledge of AmigaOS programming, and were inspired by the simplicity of BASIC languages like AMOS.

* It comes with full documentation for all of these modules, along with smaller & bigger examples. The preview release does not include these examples, but instead I will be show-casing one of these examples every few days.

* The documentation has been revamped to be more beginner friendly, and the PortablE installer has been made easier to use. If you still get stuck, then let me know, and I will see what I can do :-)

* In addition to that, I have made available a large collection of my own useful modules (in the CSH folder), which you can use if you want. These are not properly documented yet, but I will look at documenting them where there is interest.

* There are also various other improvements, and a lot of bug fixes.

* As usual it supports Amiga OS4, OS3, AROS, MorphOS & Windows. However (1) the new graphics module does not yet work on Amiga OS3, (2) the new modules do not yet work on Windows, and (3) MorphOS support is still experimental.

You can download it from PortablE's home page.

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Here is the sixth example of

Here is the sixth example of the next release of PortablE:
Example 6: SimpleCalculator.e
As more GUI examples have been requested, here is a simple calculator, in 112 lines of E code.  So that you could see the GUI code without too much klutter, I cheated a little:  The calculator only does integer maths (no floating point), which means that 3 divided by 2 equals 1 not 1.5 !  But it's not too much extra work if you want to add floating-point support...


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Here is the seventh example

Here is the seventh example of the next release of PortablE:
Example 7: ToySketch.e
Someone wanted to know how to handle mouse input, so this example is a very simple drawing program, in 79 lines of E code.  (It could have been even smaller, but I got carried away adding features!)  I think you could have great fun expanding this into a fairly fully-featured drawing program... the only real draw back being that at the moment you won't be able to save the picture (I need to add a feature to the cGfx module to allow this - if you really want this then let me know & it might make it into the next Preview release!).


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Here is the Eighth example of

Here is the Eighth example of the next release of PortablE:
Example 8: StarsXY.e
This is the first of several pretty "stars" examples.  They are not so much examples of the graphics module as they are examples of  general PortablE code, and what can be achieved with a little bit of clever maths.

This example shows stars moving across the screen (in the X/Y plane), with depth parallax, in 87 lines of E code.  Although it is fairly well optimised, I have avoided a few obvious optimisations to keep the code clearer.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Here is the Ninth example of

Here is the Ninth example of the next release of PortablE:
Example 9: StarsZ.e

After writing the first "stars" example, I got to wondering how a lowly A500 could manage to "zoom into" stars...  After some fiddling I came-up with an algorithm which has low memory & CPU usage, and only uses integer maths.  So it could quite plausibly be the same algorithm as used by some A500 demos (albiet in E not 68k assembler).

This example shows stars moving out of the screen (in the Z plane), in 92 lines of code.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Here is the Tenth example of

Here is the Tenth example of the next release of PortablE:
Example 10: StarsZYX.e

Some A500 demos did more than just zooming straight into stars, they actually moved around inside them (in 3 dimensions).  After some thinking, I realised I could use a trick from StarsXY.e to do this with my StarsZ.e code.

This example shows stars moving out of the screen, while also moving across the screen, in 108 lines of E code.  It could however do any movement within the star field, by just changing how x/y/zOrigin are updated.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
Here is the Eleventh example

Here is the Eleventh example of the next release of PortablE:
Example 11: StarsDemo.e

OK, you are probably sick of "stars" examples now, so this is the last one... I promise!  After doing the rather demo-like StarsZYX.e example, I realised it wouldn't take much more to make it feel like a real demo or bootblock loader.  So what I did was add some demo-like music (very easy!), and a wavy text scroller (less easy but it was fun to work out how to do it).  It comes to 234 lines of E code.

NOTE:  The performance isn't as good as I'd hoped (I haven't had time to investigate why), so it needs to use frame skipping on my 667MHz Sam440.  As I had to disable frame skipping for MorphOS, this means it may run a bit slowly on something like an Efika.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
I have uploaded a new

I have uploaded a new PortablE preview. Most important is an improved installer, but the documentation also contains some small improvements.

The installer will now create a PEmodules folder, rather than assuming you have created one. The installation of the necessary C header files is now improved, also done for OS3 & MOS in addition to OS4.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
I have uploaded a new

I have uploaded a new PortablE preview. The most important change is that reading & writing of files now works using the 'std/cPath' module. (Thanks to "mrdarek" for reporting the problem!)


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

ChrisH
ChrisH's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2010-12-07 20:22
I have now released an

I have now released an UPDATED preview of PortablE. You can download it from PortablE's homepage.

This fixes some fairly serious bugs with the GUI module, which would stop many parts of a complex GUI from responding to the user.


Author of the PortablE programming language.

I love using Amiga OS4.1 on my X1000 & Sam440 :-D

Log in or register to post comments