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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 149
» Latest member: oneworldrentalau
» Forum threads: 109
» Forum posts: 602

Full Statistics

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

Latest Threads
[help] how to debug var a...
Forum: Questions and discussions
Last Post: rolen
02-08-2019, 02:23 PM
» Replies: 5
» Views: 488
runtime error line 1 if l...
Forum: Bugs and suggestions
Last Post: rolen
02-06-2019, 10:31 PM
» Replies: 0
» Views: 145
run problems
Forum: Bugs and suggestions
Last Post: Rick3137
02-02-2019, 04:44 PM
» Replies: 3
» Views: 734
console log for debug
Forum: Bugs and suggestions
Last Post: rolen
02-01-2019, 05:27 PM
» Replies: 0
» Views: 654
How do i import a raycast...
Forum: Questions and discussions
Last Post: th3ch33z1t
02-01-2019, 12:14 AM
» Replies: 2
» Views: 300
a standalone start menu e...
Forum: Showcase
Last Post: rolen
01-31-2019, 03:53 PM
» Replies: 4
» Views: 167
array has not been initia...
Forum: Bugs and suggestions
Last Post: rolen
01-31-2019, 03:47 PM
» Replies: 2
» Views: 428
[help] dose naalaa has nu...
Forum: Questions and discussions
Last Post: rolen
01-30-2019, 09:36 AM
» Replies: 3
» Views: 230
naalaa opengl GL_QUADS do...
Forum: Questions and discussions
Last Post: rolen
01-29-2019, 10:51 PM
» Replies: 4
» Views: 533
avoider game
Forum: Showcase
Last Post: rolen
01-28-2019, 04:47 PM
» Replies: 2
» Views: 107

 
  runtime error line 1 if lib
Posted by: rolen - 02-06-2019, 10:31 PM - Forum: Bugs and suggestions - No Replies

when a runtime error happens inside a lib it only tells there's an error on line 1.

this makes developing a multi-file project a problem.

you need to be very careful with a lot of code or else you won't be able to find the problem.

Print this item

  [help] how to debug var arr values?
Posted by: rolen - 02-06-2019, 09:22 PM - Forum: Questions and discussions - Replies (5)

how do you check an object/variable/array value?

as far as I know, naalaa doesn't have console log function.

naalaa gui lib doesn't have a one line alert/popup i can put vals in.

how do I do that (debug values).
 
it's becoming hard to develop without being able to check these things.

please help.

Print this item

  console log for debug
Posted by: rolen - 02-01-2019, 05:27 PM - Forum: Bugs and suggestions - No Replies

it's very hard for me to check variables values etc without it.

this is a feature that would really help me in development in naalaa.

if it exists I would love to learn about it.

also is theres a one line dialog popup? that can be an alternetive.

javascript has alert() java swing also has one line dialogs.

Print this item

  run problems
Posted by: th3ch33z1t - 02-01-2019, 12:42 AM - Forum: Bugs and suggestions - Replies (3)

when i try to test my game out I save it then go to run it and it will flash up then disappear. it makes the game but doesn't run it. any ideas as to why?
Huh Confused Huh

Print this item

Bug array has not been initialized error for no apparent reason [solved]
Posted by: rolen - 01-30-2019, 05:43 PM - Forum: Bugs and suggestions - Replies (2)

I ran into this problem for a second time, i want to init an object using a function instead of writing alot of attributes.
and I get this error



this  code recreates the problem in a simplified way:

Code:
items?[5]

rem this works fine
items[0] = createItem(1,2)
rem this dosnt work
c = createItems(items)


rem create objects
function createItems(&its?[])

    for i=0  to sizeof(its)-1
        rem this line returns error
        b? = createItem(1,2)
        its[i] = b

    rem
    next

endfunc

rem create object
function createItem?(x,y)

    i?
    i.x=x
    i.y=y
    return i
endfunc


wait keydown

hacked my way out of this one myself (if anyone has a better way ill be glad to see it).

I leave this as a future reference.

the solution:

Code:
items?[5]


rem now it works
items?[] = createItems(5)


rem create objects
function createItems?[](objnum)
    its?[objnum]
    for i=0  to sizeof(its)-1
        b? = createItem(1,2)
        its[i] = b

    rem
    next
    return its
endfunc

rem create object
function createItem?(x,y)

    i?
    i.x=x
    i.y=y
    return i
endfunc


wait keydown

Print this item

Question naalaa opengl GL_QUADS dosnt work [solved]
Posted by: rolen - 01-29-2019, 12:57 PM - Forum: Questions and discussions - Replies (4)

I was trying to play with naalaa opengl and ran into a wall fast. didn't even pass the first nehe tut code.

hers the code. its supposed to show a triangle and a rectangle side by side.

Code:
import "OpenGL.lib"
rem header will be in OpenGL.lib later.
import "gl_h.lib"
import "Keycodes.lib"
import "Speed.lib"


if not glInit("OpenGL Next", 64, 64, 800, 600, true) then end


do
    rem The window is not the NaaLaa window, so we need to let it
    rem deal with its messages and stuff.
    proc glUpdate

    rem clear screen and depth buffer
    _glClear GL_COLOR_BUFFER_BIT OR GL_DEPTH_BUFFER_BIT

    rem reset view
    _glLoadIdentity


    rem set xyz poz
    _glTranslatef -1.5,0.0,-6.0
    rem set color blue
    _glColor3f 0.0,0.0,1.0

    rem draw triangle
    _glBegin GL_TRIANGLES
        _glVertex3f 0.0,1.0,0.0
        _glVertex3f -1.0,-1.0,0.0
        _glVertex3f 1.0,-1.0,0.0
    _glEnd
    rem finish drawing

    _glTranslatef 3.0,0.0,0.0

    rem draw squer
    _glBegin GL_QUADS
        _glVertex3f -1.0,1.0,0.0
        _glVertex3f 1.0,1.0,0.0
        _glVertex3f 1.0,-1.0,0.0
        _glVertex3f -1.0,-1.0,0.0
    _glEnd
    rem finish drawing

    _glRender

_SPD_HoldFrame 60

loop

Print this item

Photo a standalone start menu example
Posted by: rolen - 01-28-2019, 09:35 PM - Forum: Showcase - Replies (4)

and a start screen.

not a game but an important utility. naalaa examples don't contain a standalone example for a splash screen and start menu
or screens/scenes handling.

in this file/example, I try to fix this.

about screens/scenes handling there is no game scene but I did show how to control screens with an if and boolean(the start screen).
I will create a more complex example using this code.
but it is usable as is for creating text and menu screens with a simple function and arrays.

I wanted to create a tool to do this easily. create an object array with btns and drop it into a function.
"a menu screen in one line of code" more or less.

hers the git repo with the code:

https://github.com/yoel123/naalaa-menu-screen-sample

[Image: sam.gif]

the btn images are generic but can be anything for the idle and hover states. I used the blank btns as placeholders.


also, I should make tutorials for these, maybe for total noobs.

I need to test naalaa as a teaching tool for programming/ game programming. an interesting concept.

Print this item

Photo avoider game
Posted by: rolen - 01-27-2019, 01:05 PM - Forum: Showcase - Replies (2)

a very simple game don't let enemies touch you.

this time it's not a port I thought of the idea yesterday

this is the git repo for the game:

https://github.com/yoel123/naalaa-avoider-game

[Image: av.gif]

the hardest part was figuring out naalaa doesn't have a way to check if an object attribute is null.

to go around it I just initiated everything and add a object.active =  false as a flag that this entity doesn't "exist" yet.

retro game programming is not easy, looking at the scrolls of doom again I appreciate even more the mighty Carmack and other code mages of his age.

creating the start and game over screen was also a task (not hard) I will try to improve it, maybe add a menu screen func/s (i think it will take more than one function). maybe make it its own lib so others may use it too.

off to the next one.

Print this item

  How do i import a raycaster map?
Posted by: th3ch33z1t - 01-27-2019, 01:20 AM - Forum: Questions and discussions - Replies (2)

So i looked at the examples in NaaLaa for raycasting but i still don't understand.

Print this item

Question [help] dose naalaa has null type or a way to check if null?
Posted by: rolen - 01-26-2019, 08:27 PM - Forum: Questions and discussions - Replies (3)

the title and also is there a way to check if an object attribute exists?

let's say in an object array something like:

o?[2]

if not o[1].x then return 0

that code should stop a function if o[1].x doesn't exist.

in java/cpp it will be:

if(o != null){}

in php:

if(isset(o)){}

if naalaa don't have this implemented it will be hard to find a way around it.

dose naalaa has try catch maybe?

 as always thank you for your help.

Print this item