Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Libraries / Re: GLOOM, a new raycaster library
« Last post by Marcus on July 28, 2017 »
Here's the first area (four levels) of the game. I've added some music and sound effects, and you can now also use the arrow keys to move (the title screen explains the controls). There's even a boss at the last level, but you still can't die, so ... :)

I forgot to mention on the title screen, that you can HOLD the TAB key to show a map.
12
Suggestions, requests and demands / Re: function time()
« Last post by Marcus on July 28, 2017 »
Yeah, someone reported negative time() values. I guess that could happen if your computer had been turned on for very long. Naalaa only supports signed integers, and as C's timegettime returns a DWORD (an unsigned int) some weird stuff could occur. I've fixed it and it'll be in the next update, that will be released within two weeks (finishing up the GLOOM library).
13
Showcase / Re: Music Keyboard
« Last post by Marcus on July 24, 2017 »
I'm going to the No-Internet land for a week, but hopefully I'll be able to download it through my phone, looks interesting!
14
Showcase / Music Keyboard
« Last post by Rick3137 on July 22, 2017 »
   I have recently been working on sound files . I have finished a set of notes with Audacity and created a keyboard to play them on.
   The files would not fit on this forum, so you need to go to my website to find them.
   
     http://rb23.yolasite.com/musickeyboard.php
   


Code: [Select]
visible:
 
 
 event = 1; Sound = 0 ; button = 0 ; mzone = 0
  mx; my; z1 = 0 ; z2 = 0 ; z3 = 0
 
ky[] = [ 0,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1,1,2,1,2,1,1,2,1,2,1,2,1 ]
 
randomize time()
hidden:
set redraw off
procedure start()
 ThisIsAPlaceHolder = 1
endproc
set window 0, 0, 1350, 700
proc HowToPlay
proc Setup
proc SetupPieces
proc SetupPieces2
'proc SetupBlackKeys

proc SetupSound
proc SetupZones

   set color 0,0,0
   cls
   set color 255,255,255

    do
         wait 100
   
         set color 0,0,0
         cls;
         set color 255,255,255
                mx= mousex()
                my= mousey()
              z2 = z1
              z1 = zone(mx,my)
              if z1 <> z2 and z1 > 0
                 Sound = z1
                 play sound Sound
                 mzone = z1
              endif
 
         proc DrawBoard

         proc DisplayPieces
         proc PrintText
     
        redraw
    until event = 2
 
  end

procedure SetupZones()
       
           create zone 1,110,380,40,70
           create zone 3,150,380,40,70
           create zone 5,190,380,40,70
           create zone 6,230,380,40,70
           create zone 8,270,380,40,70
           create zone 10,310,380,40,70
           create zone 12,350,380,40,70
           create zone 13,390,380,40,70
           create zone 15,430,380,40,70
           create zone 17,470,380,40,70
           create zone 18,510,380,40,70
           create zone 20,550,380,40,70
           create zone 22,590,380,40,70
           create zone 24,630,380,40,70

           create zone 25,670,380,40,70
           create zone 27,710,380,40,70
           create zone 29,750,380,40,70
           create zone 30,790,380,40,70
           create zone 32,830,380,40,70
           create zone 34,870,380,40,70
           create zone 36,910,380,40,70
           create zone 37,950,380,40,70
           create zone 39,990,380,40,70
           create zone 41,1030,380,40,70
           create zone 42,1070,380,40,70
           create zone 44,1110,380,40,70
           create zone 46,1150,380,40,70
           create zone 48,1190,380,40,70

           create zone  2,140,300,20,80
           create zone  4,180,300,20,80

           create zone  7,260,300,20,80
           create zone  9,300,300,20,80
           create zone  11,340,300,20,80

           create zone  14,420,300,20,80
           create zone  16,460,300,20,80

           create zone  19,540,300,20,80
           create zone  21,580,300,20,80
           create zone  23,620,300,20,80

           create zone  26,140 + 560,300,20,80
           create zone  28,180 + 560,300,20,80

           create zone  31,260 + 560,300,20,80
           create zone  33,300 + 560,300,20,80
           create zone  35,340 + 560,300,20,80

           create zone  38,420 + 560,300,20,80
           create zone  40,460 + 560,300,20,80

           create zone  43,540 + 560,300,20,80
           create zone  45,580 + 560,300,20,80
           create zone  47,620 + 560,300,20,80


endproc

procedure SetupPieces()
      for a = 1 to 48
           
         if ky[a] = 1
            create image a,38,150
            set color 250,250,255
            set image a
            draw rect 0,0,38,150,1
         endif
         if ky[a] = 2
            create image a,18,80
            set color 5,10,15
            set image a
            draw rect 0,0,18,80,1
         endif

      next

  set image primary
  set color 255,255,255

endproc

procedure SetupBlackKeys()
      for a = 51 to 99
         create image a,18,80
      next
  for a = 51 to 99
     set color 10,20,30
     set image a
     draw rect 0,0,18,80,1
  next
  set image primary
  set color 255,255,255

endproc

procedure SetupPieces2()
   for a = 1 to 50
       set image a
     set color 0,0,0

     draw line 0,0,38,0
     draw line 0,0,0,150

     draw line 37,0,37,150
     draw line 0,149,38,149

    next
  set image primary
  set color 255,255,255

endproc

 

procedure Setup()
   rem Setup Variables and other things here.
   gameover = 0
   event = 1
endproc

procedure SetupSound()
     load sound 1,"data\c3.wav"
     load sound 2,"data\c3s.wav"
     load sound 3,"data\d3.wav"
     load sound 4,"data\d3s.wav"
     load sound 5,"data\e3.wav"
     load sound 6,"data\f3.wav"
     load sound 7,"data\f3s.wav"
     load sound 8,"data\g3.wav"
     load sound 9,"data\g3s.wav"
     load sound 10,"data\a3.wav"
     load sound 11,"data\a3s.wav"
     load sound 12,"data\b3.wav"
     load sound 13,"data\c4.wav"
     load sound 14,"data\c4s.wav"
     load sound 15,"data\d4.wav"
     load sound 16,"data\d4s.wav"
     load sound 17,"data\e4.wav"
     load sound 18,"data\f4.wav"
     load sound 19,"data\f4s.wav"
     load sound 20,"data\g4.wav"
     load sound 21,"data\g4s.wav"
     load sound 22,"data\a4.wav"
     load sound 23,"data\a4s.wav"
     load sound 24,"data\b4.wav"
     load sound 25,"data\c5.wav"
     load sound 26,"data\c5s.wav"
     load sound 27,"data\d5.wav"
     load sound 28,"data\d5s.wav"
     load sound 29,"data\e5.wav"
     load sound 30,"data\f5.wav"
     load sound 31,"data\f5s.wav"
     load sound 32,"data\g5.wav"
     load sound 33,"data\g5s.wav"
     load sound 34,"data\a5.wav"
     load sound 35,"data\a5s.wav"
     load sound 36,"data\b5.wav"
     load sound 37,"data\c6.wav"
     load sound 38,"data\c6s.wav"
     load sound 39,"data\d6.wav"
     load sound 40,"data\d6s.wav"
     load sound 41,"data\e6.wav"
     load sound 42,"data\f6.wav"
     load sound 43,"data\f6s.wav"
     load sound 44,"data\g6.wav"
     load sound 45,"data\g6s.wav"
     load sound 46,"data\a6.wav"
     load sound 47,"data\a6s.wav"
     load sound 48,"data\b6.wav"

     
endproc

procedure DrawBoard()
 
  rem cls
  set color 200,200,255
    draw rect 20,20,1300,665,1


endproc

procedure DisplayPieces()
   set color 255,255,255
  ' OK I may have too many images. I needed 2.  My bad habits keep me from getting confused. When I try the "right" way, confused is what I get.
           draw image 1,110,300
           draw image 3,150,300
           draw image 5,190,300
           draw image 6,230,300
           draw image 8,270,300
           draw image 10,310,300
           draw image 12,350,300
           draw image 13,390,300
           draw image 15,430,300
           draw image 17,470,300
           draw image 18,510,300
           draw image 20,550,300
           draw image 22,590,300
           draw image 24,630,300

           draw image 25,670,300
           draw image 27,710,300
           draw image 29,750,300
           draw image 30,790,300
           draw image 32,830,300
           draw image 34,870,300
           draw image 36,910,300
           draw image 37,950,300
           draw image 39,990,300
           draw image 41,1030,300
           draw image 42,1070,300
           draw image 44,1110,300
           draw image 46,1150,300
           draw image 48,1190,300

           draw image 2,140,300
           draw image 4,180,300

           draw image 7,260,300
           draw image 9,300,300
           draw image 11,340,300

           draw image 14,420,300
           draw image 16,460,300

           draw image 19,540,300
           draw image 21,580,300
           draw image 23,620,300

           draw image 26,140 + 560,300
           draw image 28,180 + 560,300

           draw image 31,260 + 560,300
           draw image 33,300 + 560,300
           draw image 35,340 + 560,300

           draw image 38,420 + 560,300
           draw image 40,460 + 560,300

           draw image 43,540 + 560,300
           draw image 45,580 + 560,300
           draw image 47,620 + 560,300

endproc

procedure PrintText()
      set caret 30,50
      write " MouseX = " ; wln str$(mx)
      write " MouseY = " ; wln str$(my)
      write " Zone = " ; wln str$( mzone )

endproc


procedure HowToPlay()
  a = 1
  create font 0, "arial", 24

  set color 255,255,255
  set caret 200,100
  wln "  The object of this puzzle is : "
  wln " to move all of the pieces from the Right Side Board to the Left Side Board."
  wln " "
  wln "  Each piece has 4 colors and when you place the piece on the left side board,  "
  wln " each color should match the color of the piece that it touches. "
  wln " "
  wln " "
  wln "  "
  wln "  "
  wln "  "
  wln "  "
  wln "  "
  wln "  "
  wln "  "
  wln "  "
  wln " Hit any key to continue. "

  wln
  wln " http://rb23.yolasite.com "
 
     redraw
   wait keydown
 

endproc

procedure AfterGame()
   play sound 2
   'set color 0,0,0
   'cls
   create font 0, "arial", 48

   set caret 300,40
   set color 255,255,255
   wln "PUZZLE SOLVED !"
   create font 0, "arial", 16
   set caret 20,300
   wln "  "
   wln "  "
   wln "  My Web Sites: "
   wln " http://rb23.yolasite.com "
   wln " http://rb27.synthasite.com "
   wln " http://scratch2.yolasite.com "
   wln " http://rb26.synthasite.com "
   wln " http://rb29.yolasite.com "
   wln;wln
   set caret 300,630
   wln " Hit any key to play again "
   event = 2
   redraw
   wait keydown


endproc


procedure SetColor( a )
     if a = 1 then   set color 60,255,50
     if a = 2 then   set color 20,20,255
     if a = 3 then   set color 250,50,50
     if a = 4 then   set color 50,250,250
     if a = 5 then   set color 250,50,250
     if a = 6 then   set color 250,250,50
     if a = 7 then   set color 150,20,180
     if a = 8 then   set color 20,130,130
     if a = 9 then   set color 20,130,130
     sqrcolor = a
     quadColor = a
endproc




15
Suggestions, requests and demands / Re: function time()
« Last post by Marcus on July 14, 2017 »
Oh god, I've missed some threads :D

The function time() works just like timeGetTime in Windows (C++) and returns the time elapsed since Windows started :)

In the next update I'll change it to return the time that's passed since the program started instead, makes more sense (atleast for me).




16
Suggestions, requests and demands / Re: NaaLaa editor
« Last post by Marcus on July 14, 2017 »
Yeah, I've seen it quite often, just haven't had the time to fix it. Usually happens when you have just two files open and close the leftmost tab. An update is coming and I promise to fix the issue :)
17
General discussion / Re: String too long for window
« Last post by Marcus on July 14, 2017 »
Sorry, there's no built in way to deal with that :( Usually I only use text for displaying score and information with pretty well known length that I can split up in forhand. But here's a simple procedure you can try:

Code: [Select]
create font 0, "courier new", 28

text$ = "Hello there, this is a really long and interesting text that "
text = text + "will hopefully span over multiple rows. My uncle used "
text = text + "to write really long texts, but they weren't that funny."

_PrintLong text
wait keydown


procedure PrintLong(txt$)
do
if fwidth(0, txt) >= width(primary)
index = 0
while fwidth(0, left(txt, index)) < width(primary)
index = index + 1
wend
wln left(txt, index - 1)
txt = right(txt, index - 1)
else
wln txt
break
endif
loop
endproc

If you need a more generic way to word-wrap text at a certain x position and with a certain width I could probably write some more advanced function.
18
General discussion / String too long for window
« Last post by Larryrl on July 10, 2017 »
How do I print a string that is too long for the window width and have it wrap? Do I need to have it in smaller chunks like text1$, text2$ instead of just text$ being one long string?
19
Suggestions, requests and demands / NaaLaa editor
« Last post by Larryrl on July 09, 2017 »
Do the authors know that if you have two txt files in the editor at the same time, like if you forget to close one before opening another and you go click the X to close the first txt file, with the 2nd one still open, sometimes it says something about an bad array subscript or something and the editor closes it's self. However it does not do it all the time but I've had it do it 3 times in 2 days.

 
20
Libraries / Re: GLOOM, a new raycaster library
« Last post by Marcus on July 03, 2017 »
Looking good . Those zombies are a little hard to stop. I don't know if its me or this key board.
 I tend to get overrun. Maybe it needs an easy level . (or bigger guns). An option to use the arrow keys would be nice.

Yeah, the first zombie type should be easier. I'll remove the run-at-ya part from it and save it for the second type. Bigger guns will come too. I can add the option to use Wolfenstein 3D controls (no mouse, just arrow keys for movement).
Pages: 1 [2] 3 4 ... 10