The fifth PortablE example (a SOTB-like scroller)+MORE!
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.

    [ Edited by ChrisH on 2011/2/24 23:47 ]

    [ Edited by ChrisH on 2011/3/2 23:34 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »17.02.11 - 12:04
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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...

    [ Edited by ChrisH on 2011/2/24 23:53 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »24.02.11 - 23:47
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »24.02.11 - 23:47
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2794 from 2006/3/21
    From: Northern Calif...
    Love all the examples and information Chris. Keep them coming, even if it seems like no one is that interested here. There are many people that read threads here that don't post many messages on the forums.
    MorphOS - The best Next Gen Amiga choice.
  • »25.02.11 - 03:41
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    koszer
    Posts: 1246 from 2004/2/8
    From: Poland
    Still no "executable" flag on binaries, eh?
  • »25.02.11 - 07:51
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @koszer Quote:

    Still no "executable" flag on binaries, eh?

    Aaargh! Sorry, I completely forgot. Now fixed for *all* examples, and I've added a reminder so I don't forget again.

    If anyone found the examples didn't run, please redownload & try again.
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »25.02.11 - 09:10
    Profile Visit Website
  • TGR
  • Butterfly
    Butterfly
    TGR
    Posts: 100 from 2009/10/27
    From: Scotland
    Quote:

    by amigadave on 2011/2/25 3:41:21

    Love all the examples and information Chris. Keep them coming, even if it seems like no one is that interested here. There are many people that read threads here that don't post many messages on the forums.


    Indeed, finding this thread interesting just wish i could find abit more time to play about.

    [ Edited by TGR on 2011/2/25 23:00 ]
    Mini Mac G4 1.25, 1gb ram, 40 gig hdd, Registered Morphos 2.6.
  • »25.02.11 - 23:00
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.

    [ Edited by ChrisH on 2011/3/2 23:43 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »02.03.11 - 23:30
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    I just tried that on my Efika - should prolly switch down from my usual full-hd display but it worked.
    PPC assembly ain't so bad... ;)
  • »03.03.11 - 04:18
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    MarK
    Posts: 641 from 2004/1/25
    From: Prague, The Cz...
    absolutely great! and AMOSPro-like development environment is really very appreciated!

    bye, MarK.
  • »03.03.11 - 06:14
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @ausPPC Quote:

    I just tried that on my Efika - should prolly switch down from my usual full-hd display but it worked.

    Heh. It would probably have run faster if the graphics module's frame-skipping was working on MorphOS (I had to disable it due to some really wierd crashes when screens were switched by the user).

    @MarK Quote:

    absolutely great! and AMOSPro-like development environment is really very appreciated!

    You are welcome! :-) It's something I've wanted like forever for the E language.

    [ Edited by ChrisH on 2011/3/3 9:04 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »03.03.11 - 09:02
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »05.03.11 - 11:39
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »05.03.11 - 11:44
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »07.03.11 - 19:21
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    ausPPC
    Posts: 543 from 2007/8/6
    From: Pending...
    I haven't looked at your latest example yet but StarsZYX.e was certainly faster than the first Stars example. I still haven't tried lower screen resolutions - but I'm sure that would help on my Efika.

    I don't know if this would be old-hat or out of your field of interest but it'd be interesting to see some E programs with MUI interfaces.
    PPC assembly ain't so bad... ;)
  • »07.03.11 - 21:34
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    amigadave
    Posts: 2794 from 2006/3/21
    From: Northern Calif...
    I am enjoying all of your examples and they motivate me to learn PortablE and use it as the primary language for my first attempt at a game for MorphOS & AmigaOS1.x to 3.x (& even 4.x & AROS if it is not too difficult to compile it for those systems as well). Keep the examples coming and thanks for all your work on PortablE. It is a great programming language and not just for beginners like me.

    I am sorry that I don't live closer to you so I could deliver in person, or ship to you one of my registered MorphOS systems, so you could do your own testing of PortablE code on MorphOS2.x.

    Perhaps one of the other MorphOS users here that live near you could lend you, or donate to you one of their registered MorphOS systems to use for testing PortablE code? I know that there were a few other members here that, like myself and Jim (who both live in the USA) support the idea of getting MorphOS systems into the hands of good programmers to promote more software development for MorphOS.
    MorphOS - The best Next Gen Amiga choice.
  • »07.03.11 - 22:15
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    @ausPPC Quote:

    I don't know if this would be old-hat or out of your field of interest but it'd be interesting to see some E programs with MUI interfaces.

    Aren't the examples in "Examples/AmigaOS/MUI" good enough? (I guess I should rename the folder from AmigaOS to just Amiga.)

    I just noticed a problem (link) with two of the MUI examples.

    [ Edited by ChrisH on 2011/3/8 10:17 ]
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »08.03.11 - 09:31
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »09.03.11 - 23:29
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    I have uploaded a new PortablE preview. This fixes a problem with the installer on MorphOS, which caused it to appear to have got stuck.
    Author of the PortablE programming language.
    It is pitch black. You are likely to be eaten by a grue...
  • »14.03.11 - 19:34
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »24.04.11 - 10:23
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    ChrisH
    Posts: 167 from 2009/11/26
    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.
    It is pitch black. You are likely to be eaten by a grue...
  • »28.04.11 - 22:51
    Profile Visit Website