AllBASIC

BASIC Developer & Support Resources => Interpreters => Topic started by: Marcus on April 10, 2018, 06:27:03 AM

Title: NaaLaa for Linux
Post by: Marcus on April 10, 2018, 06:27:03 AM
My Windows computer died, so I finally ported NaaLaa to Linux a while ago :)

Not much to say about it though. It's still meant mostly for retro-style games. The IDE, compiler and the programs you create needs nothing or less to run. The IDE was written in NaaLaa, not using IUP or GTK any other widget system.

http://naalaa.com (http://naalaa.com)

Title: Re: NaaLaa for Linux
Post by: John on April 11, 2018, 11:51:58 AM
Marcus,

Very nice! I'm looking forward to playing with naalaa on my Ubuntu 16.04 64 bit Linux laptop.

Code: [Select]
' ==============================================================================
' Bouncing balls.
' ==============================================================================

' This library helps us maintain constant fps.
import "Speed.lib"

' Turn of automatic redraw.
set redraw off

' Load a ball image.
load image 1, "assets/ball.png"

' Ground position.
groundY = 400

' Create a couple of ball objects, as many as fits the width of the window.
balls?[width(primary)/width(1)]

' Initialize their properties.
for i = 0 to sizeof(balls) - 1
    ' Set position, a wavey curve above ground.
    balls[i].x = i*width(1)
    balls[i].y# = float(groundY) - 150.0 + sin(float(i*45))*75.0
    ' Set vertical speed.
    balls[i].dy# = 0.0
next

do
    ' Update balls.
    for i = 0 to sizeof(balls) - 1
        ' Increase speed, gravity.
        balls[i].dy# = balls[i].dy# + 0.1
        ' Update position.
        balls[i].y# = balls[i].y# + balls[i].dy#
        ' Bounce?
        if balls[i].y# > float(groundY - height(1))
            balls[i].y# = float(groundY - height(1))
            balls[i].dy# = -6.0
        endif
    next

    ' Clear screen.
    set color 0, 0, 0
    cls

    ' Draw ground.
    set color 255, 255, 255
    draw line 0, groundY, width(primary), groundY
   
    ' Draw the balls.
    for i = 0 to sizeof(balls) - 1
        draw image 1, balls[i].x, int(balls[i].y#)
    next

    ' Update the window.
    redraw
    ' Wait enough for 60 fps.
    _SPD_HoldFrame 60
until keydown(27)

Title: Re: NaaLaa for Linux
Post by: John on April 17, 2018, 04:40:08 PM
Marcus,

I think this would be great running in naalaa.

PySolFC: a Python solitaire game collection (http://pysolfc.sourceforge.net/)

Title: Re: NaaLaa for Linux
Post by: Marcus on May 02, 2018, 08:31:04 AM
That would be interesting :)  I do believe someone made a solitaire game in naalaa som years ago.
Title: Re: NaaLaa for Linux
Post by: John on May 02, 2018, 03:19:47 PM
Naalaa seems to be the world's best kept secret. Let's change that.
Title: Re: NaaLaa for Linux
Post by: John on May 07, 2018, 08:12:28 PM
Can NaaLaa be embedded as a shared object? I would love to create an extension module for Script BASIC with it.
Title: Re: NaaLaa for Linux
Post by: AlyssonR on May 08, 2018, 01:41:30 AM
NaaLaa embedded in SB? Oh, yes please! *fingers crossed*
Title: Re: NaaLaa for Linux
Post by: John on May 09, 2018, 09:13:49 PM
NaaLaa embedded in SB? Oh, yes please! *fingers crossed*

The SDL_gfx extension module is a start for Script BASIC graphics but isn't a game engine in its current form. Just basic graphic primitives with alpha channel support.
Title: Re: NaaLaa for Linux
Post by: John on July 04, 2018, 09:21:05 PM
Quote
Naalaa doesn't use opengl or directx, just regular winapi.

That is interesting to know. Does that hold true for the Linux version as well?