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

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 31
» Latest member: nartex
» Forum threads: 110
» Forum posts: 847

Full Statistics

Online Users
There are currently 42 online users.
» 0 Member(s) | 39 Guest(s)
Bing, Facebook, Google

Latest Threads
Happy Birthday
Forum: Everything else
Last Post: aliensoldier
13 minutes ago
» Replies: 4
» Views: 23
That 3d thing
Forum: NaaLaa 7 Code
Last Post: aliensoldier
19 minutes ago
» Replies: 16
» Views: 1,410
"A Game Jam is Coming Up"
Forum: Programming
Last Post: johnno56
Today, 08:01 AM
» Replies: 1
» Views: 22
Enchanted Forest
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
05-16-2024, 02:16 PM
» Replies: 8
» Views: 242
Scrolling
Forum: NaaLaa 7 Questions
Last Post: johnno56
05-15-2024, 06:25 PM
» Replies: 3
» Views: 100
Devil's Triangle (The Gam...
Forum: NaaLaa 7 Code
Last Post: 1micha.elok
05-15-2024, 10:51 AM
» Replies: 1
» Views: 134
S3D : the devil's triangl...
Forum: NaaLaa 7 Questions
Last Post: 1micha.elok
05-08-2024, 07:26 AM
» Replies: 9
» Views: 545
Just for the Star Wars fa...
Forum: Everything else
Last Post: johnno56
05-05-2024, 10:40 PM
» Replies: 7
» Views: 402
Convex hull, quick algori...
Forum: NaaLaa 7 Code
Last Post: johnno56
05-04-2024, 07:23 PM
» Replies: 7
» Views: 490
Wolf3D
Forum: NaaLaa 7 Questions
Last Post: johnno56
05-02-2024, 07:57 PM
» Replies: 24
» Views: 2,111

 
  Pat by JSM
Posted by: Marcus - 11-23-2023, 05:55 PM - Forum: NaaLaa 6 Code - No Replies

Here's Pat, with source code, by JSM.

[Image: pat.jpg]

Edit That dialog is lying though. You jump with arrow key up. Silly John.



Attached Files
.zip   pat.zip (Size: 1,017.54 KB / Downloads: 6)
Print this item

  Space Pooper by JSM
Posted by: Marcus - 11-23-2023, 05:33 PM - Forum: NaaLaa 6 Code - No Replies

Here's the N6 game Space Pooper, with source code, by JSM.

[Image: space_pooper.jpg]



Attached Files
.zip   space_pooper.zip (Size: 1.38 MB / Downloads: 7)
Print this item

  Old Stuff
Posted by: johnno56 - 11-23-2023, 07:32 AM - Forum: NaaLaa 6 Questions - Replies (6)

I just found the Youtube Naalaa channel....  https://www.youtube.com/channel/UCRwL0Jj...X0w/videos

Am I correct in assuming that "all" of those programs are gone? No chance that at least a few may have been tucked away on some forgotten drive somewhere? There are such a lot of cool games on that channel... It would be a shame if they were all lost... *sigh*  

I will look through my old drives, just in case, but I cannot be sure that I have any of them... I think I may have the 'example' programs for N5 and N6 but that may be all... I will still look none the less...

J

Print this item

  Temporary place for forum accident again
Posted by: luwal - 11-19-2023, 05:32 PM - Forum: Suggestions - Replies (2)

I am so pleased because the offical forum is okay again. Good job.

I have a good idea: one more forum or messageboard for NaaLaa! If forum accidents occur again at this official forum, NaaLaa users can still discuss technical topics about NaaLaa at the second forum or messageboard. In addition,  Marcus can also tell the users that an accident has happened at this NaaLaa official forum. Several BASIC languages have messageboards on Itch: Cerberus X,  BBC BASIC, Blitz3D and RCBasic. You can find their webpages on this page: https://itch.io/jam/jam-for-all-basic-dialects-5

Print this item

  Editor tab buttons
Posted by: aliensoldier - 11-18-2023, 04:24 PM - Forum: Suggestions - Replies (1)

I have realized that when there are more than 8 files with the editor starting from number 8, all the others are not visible because the other 8 take up all the space in the editor and are hidden on the right side.

The only way to see them again is by closing a few, and if the file name is long with 5 files they already take up all your tabs.

It occurred to me that you could add two buttons to move to the left and one to the right to be able to move through the tabs and be able to see those that are hidden on the right.

Print this item

  multiline comment
Posted by: aliensoldier - 11-18-2023, 04:17 PM - Forum: Suggestions - No Replies

It would be good to add the possibility of creating multiline comments, the current comments with a " ' " are a bit inconvenient to comment many lines of code.

Print this item

  global variables
Posted by: aliensoldier - 11-18-2023, 04:15 PM - Forum: Suggestions - Replies (3)

The suggestion is about adding the possibility of creating global variables, I think it would be good to create variables that manage the score, and another to save the value of objects created with tables and be able to access their values from other files in a more comfortable way.

Print this item

  My N6
Posted by: johnno56 - 11-16-2023, 07:09 PM - Forum: NaaLaa 6 Questions - Replies (3)

Not really a question... My Linux version of N6 lo longer functions... Oh, it loads and executes programs, except for the fact it no longer recognizes the keyboard... *sigh* 

N7 function flawlessly, so it is not a keyboard issue, per se. 

As N6 has not been updated in a "dogs age", I can only conclude that, something within Linux has "moved on" and has left N6 behind... I suppose it was only a matter of time really...

Can anyone remember "way back" when the Linux version of N6 was available on the website? Does anyone have a copy of the ".deb" version of N6? I would like to test that version to see if I still have a keyboard issue with N6...

Just had a thought... stop laughing... could it be a keyboard.lib problem? I have my doubts because I have never had any need to change it... thought's gone...

Do not waste a lot of time with this... Just pointing out an issue with N6 that "I" am having... Looks like I may have to get busy and attempt some N6 to N7 conversions... *gulp* (no promises) lol

Print this item

  manage objects automatically
Posted by: aliensoldier - 11-11-2023, 07:01 PM - Forum: NaaLaa 7 Questions - Replies (21)

I'm going to start from scratch with the last question I asked in the other forum and the answer was not very clear to me.

The code that I am going to show is made in blitzmax 1.50

Code:
Type Tpadre
    Field x:Int,y:Int;
    Global lista:TList = CreateList();
    
    'final es para que el metodo o funcion que lo lleva
    'no se pueda sobreescribir desde otra parte
    Method New() Final
        Self.lista.AddLast(Self);
    End Method
    'abstract es para que este metodo sea obligatorio
    'en todas las clases que hereden de esta
    Method pintar() Abstract;
    
    Function pintar_todo() Final
        For Local padre:Tpadre = EachIn lista
            padre.pintar();
        Next
    End Function
    
    Method eliminar() Final
        lista.Remove(Self);    
    End Method
    
    Method eliminar_todo() Final
        lista.Clear();
    End Method
    
    Method avanzar(distancia:Float,angulo:Float) Final
        Self.x:+ distancia * Cos(angulo);
        Self.y:+ distancia * Sin(angulo);
    End Method
    
    Method obtener_distancia:Float(x1:Float,y1:Float,x2:Float,y2:Float) Final
        Return Sqr((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));    
    End Method
    
    Method obtener_angulo:Float(x1:Float,x2:Float,y1:Float,y2:Float) Final    
        Return ATan2(y2-y1,x2-x1);
    End Method
         
End Type

Here it shows the parent class that has a global list, in the "new" method the objects that inherit from this class will be added automatically to the list, the "paint" method is to be used in the other classes, the "paint all" method will loop through the list and display the paint method of all objects, the "delete" method will delete an object from the list and the "delete all" method will delete all objects from the list.

The other methods are mathematical methods for different uses.

Code:
Strict;
AutoMidHandle(True);
Include "clasePadre.bmx";

                 
'jugador-----------------------------------------
Type Tjugador Extends Tpadre
    Field velocidad:Int,contador:Int;
    Field imagen:TImage = LoadImage("jugador.png");
    
    Function Create:Tjugador()
        Local jugador:Tjugador = New Tjugador;
        jugador.x = 320;
        jugador.y = 410;
        jugador.velocidad = 5;
        Return jugador;
    End Function
    
    Method pintar()
        SetRotation(0);
        Self.mover();
        Self.colision();
        Self.disparar();
        DrawImage(Self.imagen,Self.x,Self.y);
    End Method
    
    Method mover()
        If(KeyDown(KEY_LEFT) And Self.x > 32)
            Self.avanzar(Self.velocidad,180);
        ElseIf(KeyDown(KEY_RIGHT) And Self.x < 608)
            Self.avanzar(Self.velocidad,0);
        End If
        
        If(KeyDown(KEY_UP) And Self.y > 32)
            Self.avanzar(Self.velocidad,270);
        ElseIf(KeyDown(KEY_DOWN) And Self.y < 448)
            Self.avanzar(Self.velocidad,90);
        End If     
    End Method
    
    Method colision()
        If(Self.obtener_distancia(Self.x,Self.y,enemigo.x,enemigo.y) < 64)
            SetColor(255,255,0);
        Else
            SetColor(255,255,255);
        End If 
    End Method
    
    Method disparar()
        Self.contador:+1;
        If(KeyDown(KEY_Z) And Self.contador > 10)
            Tdisparo.Create(Self.x,Self.y);
            Self.contador = 0;
        End If
    End Method
    
End Type

'enemigo----------------------------------------
Type Tenemigo Extends Tpadre
    Field contador:Int;
    Field angulo:Float;
    Field imagen:TImage = LoadImage("enemigo.png");
    
    Function Create:Tenemigo()
        Local enemigo:Tenemigo = New Tenemigo;
        enemigo.x = 320;
        enemigo.y = 64;
        Return enemigo;
    End Function
    
    Method pintar()
        SetRotation(self.angulo);
        Self.angulo = Self.obtener_angulo(Self.x,jugador.x,Self.y,jugador.y);
        Self.disparar();
        DrawImage(Self.imagen,Self.x,Self.y);
    End Method
    
    Method disparar()
        Self.contador:+ 1;
        If(Self.contador > 60)
            Tdisparo2.Create(Self.x,Self.y);
            Self.contador = 0;
        End If
    End Method
    
End Type

'disparo-----------------------------------------
Type Tdisparo Extends Tpadre
    Field velocidad:Int = 5;
    Field imagen:TImage = LoadImage("disparo.png");
    
    Function Create:Tdisparo(x1:Int,y1:Int)
        Local disparo:Tdisparo = New Tdisparo;
        disparo.x = x1;
        disparo.y = y1;
        Return disparo;
    End Function
    
    Method pintar()
        SetRotation(0);
        Self.mover_eliminar();
        Self.colision();
        DrawImage(Self.imagen,Self.x,Self.y);
    End Method
    
    Method mover_eliminar()
        Self.y:- Self.velocidad;
        If(Self.y < 64)
            Self.eliminar();
        End If
    End Method
    
    Method colision()
        If(Self.obtener_distancia(Self.x,Self.y,enemigo.x,enemigo.y) < 64)
            Self.eliminar();
        End If 
    End Method
    
End Type

'disparo-----------------------------------------
Type Tdisparo2 Extends Tpadre
    Field velocidad:Int = 5;
    Field angulo:Float;
    Field imagen:TImage = LoadImage("disparo2.png");
    
    Function Create:Tdisparo2(x1:Int,y1:Int)
        Local disparo2:Tdisparo2 = New Tdisparo2;
        disparo2.x = x1;
        disparo2.y = y1;
        disparo2.angulo = disparo2.obtener_angulo(disparo2.x,jugador.x,disparo2.y,jugador.y);
        Return disparo2;
    End Function
    
    Method pintar()
        SetRotation(0);
        Self.mover_eliminar();
        Self.colision();
        DrawImage(Self.imagen,Self.x,Self.y);
    End Method
    
    Method mover_eliminar()
        Self.avanzar(Self.velocidad,Self.angulo);
        If(Self.y > 416 Or Self.x > 576 Or Self.x < 64)
            Self.eliminar();
        End If
    End Method
    
    Method colision()
        If(Self.obtener_distancia(Self.x,Self.y,jugador.x,jugador.y) < 64)
            Self.eliminar();
        End If 
    End Method
    
End Type

'------------------------------------------------
'------------------------------------------------
Graphics(640,480);

Global jugador:Tjugador = Tjugador.Create();
Global enemigo:Tenemigo =  Tenemigo.Create();


While Not KeyHit(KEY_ESCAPE)    
    'actualiza todos los objetos
    Tpadre.pintar_todo();    
    
    Flip();
    Cls();
Wend

This is the main file where I have the class player, enemy, player shot and enemy shot and they are inheriting from the parent class to use its methods.

Outside the loop we call the player and enemy objects and in the main loop we call the paint all method of the parent class that will be in charge of updating all the paint methods of the objects.

What I would like to know is how this could be done in Naalaa, I am not looking for it to be the same or similar. What I am looking for is for it to be something similar with similar results within the possibilities that Naalaa offers and for it to be as simple as possible to do.

I don't care that lists or object-oriented programming are not used, I'm just looking for something similar and if it's only with functions then perfect. I'm just looking to learn different ways to do this. If you want the code I'll upload it to try in blitzmax 1.50 which you can download here.

https://nitrologic.itch.io/blitzmax

Print this item

  The old forum is gone
Posted by: Marcus - 11-11-2023, 12:44 PM - Forum: Announcements - Replies (7)

Attempting to update and then repair the old forum didn't work out that well. Everything is gone, so here's a new forum.

Print this item