Jump to content



Photo

Suggestions


  • Please log in to reply
86 replies to this topic

#81 vanhoa

vanhoa

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 854 posts
  • Gender:Male
  • Location:Vietnam

  • Calculators:
    AFX 2.0, CP 300, CP 330, nSpire, TI 89, FX 5800

Posted 16 September 2006 - 01:08 PM

Orwell, the next ver should improve this:

require("draw")
showgraph()
fullscreen(0)
keypad(0)

function move()
local pictht,pict
pictht=draw.capture()
draw.pict(-2,-15,pictht)
draw.line(159,225,159,225-30*math.random())
draw.update()
end

repeat move() until testkey(K_EXE)

The memory will crash! I cant continue my game!

#82 far2055

far2055

    Casio Addict

  • Members
  • PipPipPip
  • 67 posts
  • Gender:Male
  • Location:Iran
  • Interests:Robotics - Programming - Mathematics - Physics - Computer <br />ANN ( Artificial Neural Network )<br />QBasic Lover-->before-->now-&gt;*CPLua&quot; Lover.

  • Calculators:
    classpad 300

Posted 16 September 2006 - 02:26 PM

The memory will crash! I cant continue my game!


there is a memory leak with pict.capture().
try to use pict.screen() or pict.buffer() until the next version of CPLua.

#83 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 24 September 2006 - 09:43 AM

I suggested something in the other topic, but I had no comments... I really would like to have your opinion about this before releasing CPLua 0.9 :

Currently, doing
require("myLib")
is the same as
require("main/myLib")
because there is no package in CPLua called "mylib", and thus it searches in the "main" folder if no folder is specified.

I just thought that it would perhaps be easier if CPLua searched in the folder of the file that calls require(). To be more precise:
Suppose you have a folder "Fol" with 2 files A and B.
If the file A requires the file B, you will have to write
require("Fol/B")
at the beginning of file A. My suggestion is that
require("B")
is equivalent to
require("Fol/B")
because A is in the folder "Fol". I think it would be easier if you want to rename folders etc, then you wouldn't have to change all the paths. :)
Note: if you call require() from a new file (not saved), and if no folder is specified, CPLua would then look in the "main" folder.

#84 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 24 September 2006 - 07:20 PM

It sounds good. I think Lua should also have a cpp-style search for required files. I mean, when you write requite("A"), first it should look in the folder that the current file is.
If the file didn't exist there, look for the file in the CP's current folder.
If the file didn't exist there, look for the file in the 'main' folder.
And so on...

The above procedure exists in the standard Lua, but I guess you have removed it in CPLua because ClassPad's folders are too much complicated.

#85 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 681 posts
  • Gender:Male
  • Location:Somewhere in Europe.
  • Interests:Computer Algebra, Numerical Analysis.

  • Calculators:
    ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 25 September 2006 - 09:23 AM

My suggestion is that

require("B")
is equivalent to
require("Fol/B")
because A is in the folder "Fol". I think it would be easier if you want to rename folders etc, then you wouldn't have to change all the paths. :)
Note: if you call require() from a new file (not saved), and if no folder is specified, CPLua would then look in the "main" folder.

Yes, it's better that way. I personally include the folder name in all require() statements, but if you omit it, the default folder should be the folder of the calling script.

What else will be included in version 0.9?

#86 Guest_georges_*

Guest_georges_*
  • Guests

Posted 13 September 2007 - 10:36 AM

:unsure: Hmmm, he said using sprites with tables would be not a great idea.... slow slow......


Hello

I just try PBLUA it is a very nice program.

What about the update ?

Are you still working on it ?

Best regards


Georges

#87 Guest_guest_hobart_*

Guest_guest_hobart_*
  • Guests

Posted 21 December 2007 - 09:34 PM

i'm a bit sad that there are only text files in which you can save data from cplua!
the mem files were better i think! ^^


1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users