Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 101
» Latest member: curriculumvitae3355
» Forum threads: 81
» Forum posts: 467

Full Statistics

Online Users
There are currently 6 online users.
» 0 Member(s) | 6 Guest(s)

Latest Threads
A programming language wr...
Forum: Showcase
Last Post: Aurel
08-16-2018, 10:05 AM
» Replies: 22
» Views: 676
Any commercial game made ...
Forum: Questions and discussions
Last Post: bplus
08-10-2018, 02:56 PM
» Replies: 6
» Views: 160
So what else is not in do...
Forum: Questions and discussions
Last Post: bplus
07-24-2018, 01:15 PM
» Replies: 2
» Views: 112
A power# function for Naa...
Forum: Questions and discussions
Last Post: bplus
07-24-2018, 12:01 PM
» Replies: 2
» Views: 84
Sierpinski Circled
Forum: Showcase
Last Post: bplus
07-22-2018, 06:39 PM
» Replies: 6
» Views: 247
Help with testing joystic...
Forum: Questions and discussions
Last Post: johnno56
07-21-2018, 02:31 PM
» Replies: 4
» Views: 986
Greetings and Salutations...
Forum: Questions and discussions
Last Post: bplus
07-21-2018, 02:03 PM
» Replies: 4
» Views: 139
Suggestion
Forum: Bugs and suggestions
Last Post: bplus
07-21-2018, 01:44 PM
» Replies: 7
» Views: 229
eRATication
Forum: Showcase
Last Post: bplus
07-20-2018, 05:01 PM
» Replies: 0
» Views: 67
Color waves
Forum: Showcase
Last Post: johnno56
07-19-2018, 02:47 AM
» Replies: 15
» Views: 398

 
  Any commercial game made with NaaLaa?
Posted by: hiuwai - 08-04-2018, 09:06 AM - Forum: Questions and discussions - Replies (6)

Is there any commercial game made in NaaLaa? 

Can NaaLaa be used to make professional commercial game? 


I am curious. 
Huh

Print this item

  So what else is not in docs?
Posted by: bplus - 07-24-2018, 12:07 PM - Forum: Questions and discussions - Replies (2)

So what else isn't in docs?

So far my list includes:
cls - which sure acts funny, apparently have to reset color and caret
keydown(keycode) - which sure would be useful 
pow#(x#, y#) - which again would have nice to know

please help and add to my list!

Print this item

  A power# function for Naalaa
Posted by: bplus - 07-24-2018, 02:13 AM - Forum: Questions and discussions - Replies (2)

Don't do brain surgery with it but this power# function comes pretty close for roots other than the square ones:

Code:
' Power pack the short version.txt
' written for Naalaa 6 by bplus posted 2018-07-23
' extracted from large test of fractions, random number functions, string... in Power test.txt

' The main purpose of this code: to demo a power function for real numbers,

' I had an idea for how real numbers to the power of real numbers might be done ie x# ^ y# = ?
' This means that not only can you take SQR of a number, you can get cube or cube root, quartic, 5th 6th... roots and any multiple

' It came from this simple idea
' 2 ^ 3.5 = 2 ^ 3 * 2 ^ .5 = 8 * Sqr(2)
' 3 ^ 3.5 = 3 ^ 3 * 3 ^ .5 = 27 * Sqr(3)

' so 2 ^ 3.25 = 2 ^ 3 * 2 ^ .25
' what is 2 ^ .25 ?  It is sqr(sqr(2)) !

' likewise 2 ^ 3.125 = 2 ^ 3 * 2 ^ 1/8
' what is 2 ^ 1/8 ? It is sqr(sqr(sqr(2))) !

' any decimal can be written as a sum of fraction powers of 2, as any integer can be written in powers of 2.
' in binary expansions
' 1/2 = .1       or .5 base 10
' 1/4 = .01      or .25 base 10
' 1/8 = .001     or .125 base 10
' 1/16 = .0001   or .0625 base 10

' So with binary expansion of decimal, we can SQR and multiply our way to an estimate
' of any real number to the power of another real number using binary expansion of
' the decimal parts as long as we stay in Naalaa integer limits and are mindful of precision.

constant:
wW 800
wH 720
hidden:
set window 100, 20, wW, wH

do
    wln "And now for the main event! We test the power#(x#, pow#) function!"
    write "(nothing) quits, Please enter a real (float) decimal number raise to some power. x# = "
    x# = rln#()
    if x# = 0.0 then break
    write "(nothing) quits, Please enter a real (float) decimal power. pow# = "
    pw# = rln#()
    if pw# = 0.0 then break
    result# = power#(x#, pw#)
    wln result#, " is what we estimate for x# raised to power of pow#"
    wln
loop
wln
wln "Far from precise of course, but this code is clear proof of concept!"
wln " OMG, it worked!!!"
wait keydown


' A power function for real numbers (small ones but still!)
' x# to the power of pow#
function power#(x#, pow#)
'this sub needs 2 other subs
'rite$
'bExpand20$

    'this is going to follow covertReal2Fraction$, first deal with integer part if any
    r$ = str$(pow#)
    s$[] = split(r$, ".")
    integer$ = s$[0]
    build# = 1.0
    if integer$ <> "0"
        p = int(integer$)
        for i = 1 to p
            build# = build# * x#
        next
    endif
    'that takes care of integer part,
    'now for the fraction part convert decimal to fraction
    n$ = s$[1]
    ld = len(n$)
    while rite$(n$, 1) = "0"
        n$ = left$(n$, ld - 1)
        ld = len(n$)
    wend
    denom = 10
    for i = 2 to ld
        denom = denom * 10    
    next
    numer = int(n$)
    'OK for bExpand20$ don't have to simplify and that saves us having to extract n and d again from n/d
    bs$ = bExpand20$(numer, denom)
    'at moment we haven't taken any sqr of x
    runningXSQR# = x#
    'run through all the 0's and 1's in the bianry expansion of the fraction part of the power float
    for i = 1 to len(bs$)
        'this is the matching sqr of the sqr of the sqr... of x#
        runningXSQR# = sqr#(runningXSQR#)
        'for every 1 in the expansion, multiple our build with the running sqr of ... sqr of x
        if mid$(bs$, i - 1, 1) = "1" then build# = build# * runningXSQR#
    next
    'our build# should be a estimate or x# to power of pow#
    return build#
endfunc

'write a series of 1s and 0s that represent the decimal fraction n/d in binary 20 places long
function bExpand20$(nOver, d)
    ' b for base
    b# = 0.5
    ' r for remainder
    r# = float(nOver)/float(d)
    ' s for string$ 0's and 1's that we will build and return for function value
    s$ = ""
    ' f for flag to stop
    f = 0
    ' c for count to track how far we are, don't want to go past 20
    c = 0
    while f = 0
        if r# < b#
            s$ = s$ + "0"
        else
            s$ = s$ + "1"
            if r# > b#
                r# = r# - b#
            else
                f = 1
            endif
        endif
        c = c + 1
        if c >= 20 then f = 1
        b# = b# * 0.5
    wend
    return s$
endfunc

'not right$
function rite$(stringy$, amount)
    return mid$(stringy$, len(stringy$) - amount, amount)
endfunc

Print this item

  Sierpinski Circled
Posted by: bplus - 07-21-2018, 11:50 PM - Forum: Showcase - Replies (6)

Sierpinski triangle done with only circles, generalized to any regular polygon and then made to move with alpha detailing:

Code:
'Sierpinski circled.txt
' written for Naalaa 6 by bplus 2018-07-21
' translated from Sierepinski Circled.bas by bplus 2018-04-04 QB64 v 11-06-2017

' A new twist on an old fractal.
'  Sierpinski triangle generalized and made dynamic for any regular poly though does not work well beyond 8 or 9.

randomize time() + rnd(100)
radians
constant:
wW 700
wH 700
visible:
pi# = acos#(-1.0)
pi2# = 2.0 * pi#
pip5# = pi# * 0.5
pi360# = pi# / 360.0
cx# = float(wW / 2)
cy# = float(wH / 2)
cr# = float(wH) / 6.0
r#
g#
b#
levels
hidden:
set window 100, 20, wW, wH
set redraw false
for n = 3 to 8
'n = 3
    a# = 0.0
    r# = float(56 + rnd(200)); g# = float(56 + rnd(200)); b# = float#(56 + rnd(200))
    levels = 12 - n
    shade = 255
    while a# <= pi2#
        set color 0, 0, 0
        draw rect 0, 0, wW, wH, true
        _recurringCircles cx#, cy#, cr#, a#, n, levels
        a# = a# + pi360#
        redraw
        wait 1
 wend
    _pause
next

procedure recurringCircles (x#, y#, rr#, ao#, n, level)
    cf# = float(12 - level) / 12.0

    'try this with alpha maybe 50 but kind of dark and blurry
    'without alpha, too much overlap to show fine pattern detail
    set color int(r#*cf#), int(g#*cf#), int(b#*cf#), 50
    draw ellipse int(x), int(y), int(rr#), int(rr#), true
    if level > 0
        pi5# = pi# * 0.5
        ra# = pi2# / float(n)
        for i = 0 to n - 1
            x1# = x# + 1.5 * rr# * cos#(float(i) * ra# + ao# - pip5#)
            y1# = y# + 1.5 * rr# * sin#(float(i) * ra# + ao# - pip5#)
            _recurringCircles x1#, y1#, rr# * 0.5, 2.0 * ao#, n, level - 1
        next
    endif
endproc

procedure pause()
    set color 200, 225, 250
    wln "Click mouse to continue..."
    redraw
    wait mousebutton
endproc

OK, copy / paste from forum ran fine for me after deleting blank first line.

Print this item

  eRATication
Posted by: bplus - 07-20-2018, 05:01 PM - Forum: Showcase - No Replies

Inspired by Asteroids, this simple shooter game is a blast.

You can rotate shooter with arrow keys: left and right for fine tuning, up and down for fast spin, the left and right mouse buttons also control the shooter spin like the left and right arrow keys. Fire bullets with space bar and the mouse now controls the shooter location, so you can play dodge rat in life #3. Johnno has a chance now to last a couple of seconds in life #3.   Big Grin

note: the shooter control here is much more satisfying to me than the QB64 version posted at Retrogamecoding.

.zip   eRATication.zip (Size: 3.07 KB / Downloads: 3)

Print this item

  Suggestion
Posted by: Gloomshroud - 07-18-2018, 02:49 PM - Forum: Bugs and suggestions - Replies (7)

Line numbers in the editor would be fantastic Big Grin

Print this item

Wink Greetings and Salutations!
Posted by: Gloomshroud - 07-18-2018, 01:28 PM - Forum: Questions and discussions - Replies (4)

Hello! I am Gloomshroud. Smile It is a pleasure to make your acquaintances.

At any rate, I downloaded this wonderful resource last night and have been happily playing with it ever since (I have not slept). I've been poking around with the examples, and NaaLaa seems quite a capable little language, despite its compactness!

I was wondering if any of ye with more experience might tell me if they believed this language might be suitable for developing a game in my own personal favorite genre: Roguelike!

I am talking REAL roguelikes, btw, not some of the more modern notions (rogue-LITES, moderate permadeath, etc). Angband, ADOM, Crawl, Rogue, etc! I love ASCII, and I love tiles! So the graphics are negotiable, though I am fond of my little "@".

There are plenty of windowing features, the font features are complete, and the language appears nimble enough to handle it all very quickly and efficiently should I choose to employ BSP procedural generation or Dijkstra pathfinding, for example. (This also begs the question as to whether or not some of the algorithmic leg work has already been done).

All that being said, I trust the opinions of the veterans and would love some insight, as it is trying to do roguelikes that brought me here in the first place. (That's an interesting story, I was looking at Richard Clark's website for his FreeBasic roguelike tutorial when I found he had done quite a bit of NaaLaa stuff, and then one thing led to another and here I am!).

I also know the language has a ton of libraries available (seeing GLOOM in action made me want to consider a FPRL) which ease and facilitate the programmer's task! That's awesome, but there is quite a bit and I'm sure I'm not seeing all there is to see, so insight is highly appreciated.

Many thanks in advance, kind users.

Print this item

  Color waves
Posted by: bplus - 07-17-2018, 03:42 AM - Forum: Showcase - Replies (15)

Code:
'wavy test fcirc.txt for Naalaa 6

' try a translation of a translation
' Wavy with Plasma.bas for QB64 fork (B+=MGA) 2017-05-05
' Wavy with Plasma Treatment.bas SmallBASIC 0.12.9 (B+=MGA) 2017-05-03
' from: animated circles started by Admin at SdlBasic 2017-05-03
' I added Plasma treatment and spacebar  changer


'===================================================================

' Instructions: press spacebar for new injection of plasma

'==================================================================

constant:
xmax 800
ymax 600
DPI# 6.283032
PHIDELTA# 0.4188688
PHISTEP# 0.1256606
largeRADIUS# 20.0
SMALL_R# 20.0
DISTANCE# 23.0
W# 800.0
H# 600.0

visible:
cN# = 1.0
pR#
pG#
pB#

hidden:

set window 200, 40, xmax, ymax
set redraw 0
radians
current_phi# = 0.0
_resetPlasma
while 1
    if inkey(1) = 32
        cN# = 1.0
        _resetPlasma
    endif
    current_phi# = current_phi# + PHISTEP#
    x# = 0.0
    while x# <= (W# + largeRADIUS#)
        y# = 0.0
        while y# <= (W# + largeRADIUS#)
            phiIndex# = float#(int(x# + y#) % int(2.0 * W#)) / largeRADIUS#
            phi# = phiIndex# * PHIDELTA# + current_phi#
            xball# = cos(phi#) * largeRADIUS# + x#
            yball# = sin(phi#) * largeRADIUS# + y#
            _changePlasma
            _DrawFilledCircle int(xball#), int(yball#), int(SMALL_R#)
            y# = y# + DISTANCE#
        wend
        x# = x# + DISTANCE#
   wend
   redraw
    wait 100
wend

function rrnd#(x)
    return float#(rnd(10000))/10000.0
endfunc

procedure changePlasma()
    cN# = cN# + 1.0
    set color int(127.0 + 127.0 * sin(pR# * cN#)), int(127.0 + 127.0 * sin(pG# * cN#)), int(127.0 + 127.0 * sin(pB# * cN#))
endproc

procedure resetPlasma()
    pR# = rrnd#(1)         
    pG# = rrnd#(1)
    pB# = rrnd#(1)
endproc

'very fast but  not round specially smaller circles
procedure DrawFilledCircle(x0, y0, radius)
    x = radius
    y = 0
    err = 0
    while x >= y
        x2 = x*2; y2 = y*2
        draw rect x0 - x, y0 + y, x2, 1, true
        draw rect x0 - y, y0 + x, y2, 1, true
        draw rect x0 - x, y0 - y, x2, 1, true
        draw rect x0 - y, y0 - x, y2, 1, true
        y = y + 1
        err = err + 1 + 2*y
        if 2*(err - x) + 1 > 0
            x = x - 1
            err = err + 1 - 2*x
        endif
    wend
endproc
Wow took awhile to get this going.

Print this item

  set window question
Posted by: pedromartins - 06-30-2018, 01:00 PM - Forum: Questions and discussions - Replies (2)

Hi Marcus

The set window command of NaaLaa, that works in windows, was done using assembler? win32? directx? opengl?
What graphics modes does it support ?
Can i get the code or a hint ? LOL [Image: smile.png]

Print this item

  NaaLaa Editor bug ???
Posted by: pedromartins - 06-29-2018, 10:41 PM - Forum: Bugs and suggestions - Replies (1)

Hi everyone

Try to open 16 files at the same time (NaaLaa limit) and then start to close them all from the last to the first. You will get an error "Line 587: array index out of range" when you delete the first one. Buggy ? [Image: bug.png][Image: smile.png] (NED version 1.1.3)

   

Print this item