forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

2 Question : Hidding code , and help for another things...

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
spyk



Joined: 22 Mar 2006
Posts: 14

PostPosted: Wed Mar 22, 2006 10:02 pm    Post subject: 2 Question : Hidding code , and help for another things... Reply with quote

Hi all :

1°/ How can we Hide Lua source code?
Because it's note cool, when you're programming a little network game, and user can easy cheat with source code...

2°/ In this tutorial : http://wiki.ps2dev.org/psp:lua_player:tutorial

I have'nt understant this :
Code:
function drawTile(tile, x, y)
   local tileX = math.mod(tile, 4)
   local tileY = math.floor(tile / 4)
   screen:blit(16 * x, 16 * y, tiles, 17 * tileX + 1, 17 * tileY + 1, 16, 16, false)
end   



Pecisely this :


Code:
   
screen:blit(16 * x, 16 * y, tiles, 17 * tileX + 1, 17 * tileY + 1, 16, 16, false)


16*x and 16*y, OK that's the coordinates where the tile while be draw.
17*TileX +1, 17*TileY, What's this? The coordinates where the tile while be taken in the picture? Why 17*? why +1?

and this : 16, 16, false ?

Sorry, I havent found help for this function.

and why local tileX = math.mod(tile, 4)
local tileY = math.floor(tile / 4)
? Can you tell me about this?
I've found help for math function hier http://lua-users.org/wiki/MathLibraryTutorial but...


Thank you!!
Back to top
View user's profile Send private message
ShUr1k3n



Joined: 16 Oct 2005
Posts: 42

PostPosted: Thu Mar 23, 2006 12:27 am    Post subject: Reply with quote

1º - How to Hide source Code in Lua ? -> Use the Search in this forum
2º - Look at this:

Code:
nil image:blit(x, y, Image source, [sourcex, sourcey, width, height], [alpha = true])


"Paints the image, which is specified as “source” to the image on which this function is called on (or to the double buffered screen, when using the “screen:blit(...)” variable, which is a special image). “sourcex” and “sourcey” is the position in the source image, from where a rectangle of the size width/height is copied." <- http://wiki.ps2dev.org/psp:lua_player:functions#graphics

Take a look at http://wiki.ps2dev.org/psp:lua_player#psp_lua_player and u will understand the "local", "math.floor", etc...

Regards,

ShUr1k3n
Back to top
View user's profile Send private message Send e-mail
spyk



Joined: 22 Mar 2006
Posts: 14

PostPosted: Thu Mar 23, 2006 1:44 am    Post subject: Reply with quote

OK, thank for all!
Back to top
View user's profile Send private message
glynnder



Joined: 04 Sep 2005
Posts: 35

PostPosted: Mon Apr 03, 2006 10:29 pm    Post subject: Reply with quote

yea, dont forget to use search, in fact i may search tha\t just now
Back to top
View user's profile Send private message
glynnder



Joined: 04 Sep 2005
Posts: 35

PostPosted: Thu Apr 20, 2006 2:09 am    Post subject: Reply with quote

i couldnt find anything in search - can anyone shed some light?
Back to top
View user's profile Send private message
Slopey



Joined: 31 Jul 2005
Posts: 24

PostPosted: Thu Apr 20, 2006 2:16 am    Post subject: Reply with quote

I asked the same question a while back (and the search you need to do isn't particularly obvious). However, if you want to hide your code, your only option as I understand it is to compile it into a version of the player manually. Seemingly there are hints on how to accomplish this in the docs with the player source.

It might be possible to do something more cunning now that v19 supports modules, but you'd have to write those portions in C afaik.

Cheers,
S.
Back to top
View user's profile Send private message
glynnder



Joined: 04 Sep 2005
Posts: 35

PostPosted: Thu Apr 20, 2006 2:20 am    Post subject: Reply with quote

how would i build it into my eBOOT?
I can't have v0.19 - im on 2.6
Back to top
View user's profile Send private message
Slopey



Joined: 31 Jul 2005
Posts: 24

PostPosted: Mon Apr 24, 2006 7:55 pm    Post subject: Reply with quote

You can do it with any version of LuaPlayer - you recompile the player itself to load your application when it starts. Seeminly it's in this documentation for the LuaPlayer source.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group