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 

Lua Player for PSP
Goto page Previous  1, 2, 3 ... 10, 11, 12
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
dragula96



Joined: 17 Jun 2005
Posts: 21

PostPosted: Fri Aug 19, 2005 3:21 am    Post subject: working on new project called "NORT" Reply with quote

hey everyone just thught id let everyone know im working on a project i like to call "NORT"

by looking at this picture i think you guys can guess how its gonna play :P
enyway, the thing im stuck with is the colition detection, i cant get it to work or cant figure out how to do it, can anyone point me to the right direction.

thanx
dragula96

UPDATE: NORT 0.1 is done get it here
http://www.megaupload.com/?d=23BCYZMZ


Last edited by dragula96 on Tue Aug 23, 2005 9:57 am; edited 2 times in total
Back to top
View user's profile Send private message
Evil Inside



Joined: 21 Jul 2005
Posts: 17

PostPosted: Fri Aug 19, 2005 6:20 am    Post subject: Reply with quote

Nice, looks like it will be fun.

Take a look at Shine's snake for Collision detection.

You could also look at the PSP Air Hockey for multiplayer on one PSP controls.
Back to top
View user's profile Send private message
dragula96



Joined: 17 Jun 2005
Posts: 21

PostPosted: Fri Aug 19, 2005 8:59 am    Post subject: well this is embarresing :^( Reply with quote

i cant draw just a single pixle on the screen
i can draw a line but not a single pixle
please help this noob :^(

im trying this and it dont work:
blue = (0,0,255)

screen:drawpixel(x,y,blue)
screen.waitVblankStart()
screen.flip()

"attempt to call method 'drawpixel' ( a nil value)"
also tried

screen:pixel(x, y, blue)

and still get an error.
>:(
Back to top
View user's profile Send private message
MSX



Joined: 06 Jul 2005
Posts: 12

PostPosted: Fri Aug 19, 2005 9:54 am    Post subject: Re: well this is embarresing :^( Reply with quote

dragula96 wrote:
i cant draw just a single pixle on the screen
i can draw a line but not a single pixle
please help this noob :^(

im trying this and it dont work:
blue = (0,0,255)

screen:drawpixel(x,y,blue)
screen.waitVblankStart()
screen.flip()

"attempt to call method 'drawpixel' ( a nil value)"
also tried

screen:pixel(x, y, blue)

and still get an error.
>:(


Try image:drawpixel(x, y, blue)
Back to top
View user's profile Send private message
dragula96



Joined: 17 Jun 2005
Posts: 21

PostPosted: Fri Aug 19, 2005 12:10 pm    Post subject: Reply with quote

Evil Inside wrote:
Nice, looks like it will be fun.

Take a look at Shine's snake for Collision detection.

You could also look at the PSP Air Hockey for multiplayer on one PSP controls.


ok i got good news and bad news, the good news is that i got it to work...
... the bad news is that the graphics had to take a hit :*^(

ok now for some info... looks like if i work on it overnight after i get out of work, ill have a basic working 2 player version with player 1 controling the D pad and player 2 using the buttons.

then on future releases i will include better grafics and a single player mode with an AI controlled opponent.

just dont be expecting a speed demon like squarz... at least not on the first version.

P.S. if anyone knows of a way to blit on "layers" so that the bottom layer dont blit only the first one, please let me know because the only way i see this happenning with drawing a cycle on it is to:
draw the "lines" on the bottom layer and draw the cycle on the top one then only blitting the top layer and leaving the bottom one alone so the lines dont dissapear.

-dragula96


Last edited by dragula96 on Tue Aug 23, 2005 9:58 am; edited 1 time in total
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Fri Aug 19, 2005 4:55 pm    Post subject: Re: well this is embarresing :^( Reply with quote

dragula96 wrote:
i cant draw just a single pixle on the screen
i can draw a line but not a single pixle


A pixel is a line with x0=x1 and y0=y1 (at least for Lua Player, not mathematical), but see http://www.luaplayer.org/functions.txt for the pixel function:

nil image:pixel(x, y, Color) --set

You can see the third parameter is a color object:

Code:

blue = Color.new(0, 0, 255)
screen:pixel(100, 100, blue)


dragula96 wrote:
P.S. if anyone knows of a way to blit on "layers" so that the bottom layer dont blit only the first one, please let me know because the only way i see this happenning with drawing a cycle on it is to:
draw the "lines" on the bottom layer and draw the cycle on the top one then only blitting the top layer and leaving the bottom one alone so the lines dont dissapear.


I don't understand what you mean, but sounds like it doesn't work. See the Snake game for an example with multiple layers. You have to draw your pixels to an image (which is called "snake" in the Snake game), blit this image every VSync to screen and then blit your cycles on top to the screen.
Back to top
View user's profile Send private message
alex_dsnews



Joined: 03 Aug 2005
Posts: 13

PostPosted: Fri Aug 19, 2005 8:17 pm    Post subject: Reply with quote

Quote:
just dont be expecting a speed demon like squarz... at least not on the first version.


you're not drawing every pixel each refresh, are you?
Back to top
View user's profile Send private message
dragula96



Joined: 17 Jun 2005
Posts: 21

PostPosted: Sat Aug 20, 2005 6:42 am    Post subject: Reply with quote

alex_dsnews wrote:
Quote:
just dont be expecting a speed demon like squarz... at least not on the first version.


you're not drawing every pixel each refresh, are you?


no im not, just the next one the old ones stay, but the problem is that everytime it moves, it checks to see if it is = to the past moves like this

for i = 1, CurrentNumberofMoves

if x = past_x[i] and y = past_y[i] then
crash()

end
CurrentNumberofMoves = CurrentNumberofMoves +1


so you can see that after about 50 moves this can get slow
Back to top
View user's profile Send private message
Benihana



Joined: 31 Jul 2005
Posts: 12

PostPosted: Sat Aug 20, 2005 9:54 am    Post subject: Reply with quote

Try making i a local array (outside your for loop so that Lua does not assign it every loop);
local iArray = i

You should also be able to compare both variables;
if {x,y} == {past_x[iArray],past_y[iArray]} then
...
end

And finally make sure you are running this comparison once per move cycle, not once per screen refresh. Should be able to handle it... I haven't seen the code, have you posted it yet and I just missed it?
Back to top
View user's profile Send private message
dragula96



Joined: 17 Jun 2005
Posts: 21

PostPosted: Sat Aug 20, 2005 1:53 pm    Post subject: NORT 0.1 ready for download Reply with quote

ok i mannaged to get the collition detection to compair line differences instead of pixle difference which means alot less comparisons, a variable is only added each time the cycles turn and not each time they move forward.. ok enyway here is the link
(V 0.2) is now available here
http://www.megaupload.com/?d=2519XVN9




if anyone wants to mirror it then by all means do so.

NORT 0.2 (2 player version only for right now)
by dragula96



version 0.2 changes/fixes
------------------------------------
-added cycles to playfield
-changed blue color line and cycle to yellow
-removed white line in the middle of cycle walls
-changed background to a nicer one
- fixed bug where some people were not able to run game(ihope)
-fixed bug that would let you go "out of bounds" at the top


known bugs in 0.2
-pressing diagnaly is NOT RECOMMENDED, and slows down the game indefinetly
-if game goes on to long then slow down will occur however i cant find anyone
to test this with so i dont know how much slowdown you will get


version 0.1 NOTES:
-----------------------------
0.1 very first release, with very basic graphics
will be updated very soon with better graphics
and eventualy computer AI

Select = screenshot so dont press it if you dont want to take a pretty picture of my awsome program
OBJECTIVE OF THE GAME
---------------------------
simple: just make the other player crash into your "wall of death" before he does it to you
watch out the side walls and you are not immune to your own walls either.

(note: the game still does not keep track of score , players will have to do this in their heads)

player 1 controls "blue racer" with D pad
player 2 controls "red racer" with buttons (triangle,square,circle,cross)

this is only a test build please let me know if any bugs are found.
davidmtz2000@yahoo.com
-dragula96


Last edited by dragula96 on Tue Aug 23, 2005 9:57 am; edited 1 time in total
Back to top
View user's profile Send private message
MikeHaggar



Joined: 18 Jul 2005
Posts: 116

PostPosted: Mon Aug 22, 2005 3:55 am    Post subject: Reply with quote

http://haggar.pocketheaven.com/LUAtris Beta.zip

Beta version of what I've been working on the last 2 days.

Do not post as news (if any news site ppl reads this).

If anybody finds any bugs/crashes, then tell me (and it would be nice if you also say what line of code it crashes on).
Back to top
View user's profile Send private message
Sir Harvo



Joined: 24 Aug 2005
Posts: 1

PostPosted: Wed Aug 24, 2005 6:10 am    Post subject: Lua Player Reply with quote

Is a version planned to be usable with the European models?
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Wed Aug 24, 2005 7:11 am    Post subject: Re: Lua Player Reply with quote

Sir Harvo wrote:
Is a version planned to be usable with the European models?


No. It's currently impossible to run homebrew apps on European PSPs (and all PSPs running the 2.0 firmware), and is likely to be so for a while...
Back to top
View user's profile Send private message Send e-mail Visit poster's website
F34R



Joined: 28 Jul 2005
Posts: 29

PostPosted: Fri Aug 26, 2005 12:56 pm    Post subject: Dpad converted to analog control.. Reply with quote

Ok,

I have this basic control coded. It just pushes the square in the direction you input according to the dpad. I've been trying to learn how to use the analog function instead. Can someone help me convert this to analog instead of the dpad. Any help is appreciated.

Here is the code:
Code:

-- Activate USB Mode
System.usbDiskModeActivate()

-- Get colors for text
white = Color.new(255, 255, 255)
red = Color.new(255, 0, 0)

-- Load images
square = Image.load("square.png")


-- Set starting X/Y positions
x = 200
y = 100


while true do
pad = Controls.read()



if pad:up() then
   screen:clear()
   screen:print(200,1, "You Pressed Up", white)
   y = y - 5
   if y < -4 then
      y = -4
   end
end


if pad:down() then
   screen:clear()
   screen:print(200,1, "You Pressed Down", white)
   y = y + 5
   if y > 230 then
      y = 230
   end
end


if pad:left() then
   screen:clear()
   screen:print(200,1, "You Pressed Left", white)
   x = x - 5
   if x < -4 then
      x = -4
   end
   
end


if pad:right() then
   screen:clear()
   screen:print(200,1, "You Pressed Right", white)
   x = x + 5
   if x > 440 then
      x = 440
   end
   
end


if pad:cross() then
   screen:clear()
   screen:print(200,1, "You Pressed [CROSS]", white)
end


if pad:triangle() then
   screen:clear()
   screen:print(200,1, "You Pressed [TRIANGLE]", white)
end


if pad:square() then
   screen:clear()
   screen:print(200,1, "You Pressed [SQUARE]", white)
end


if pad:circle() then
   screen:clear()
   screen:print(200,1, "You Pressed [CIRCLE]", white)
end

if pad:start() then
      break
   end

-- Draw my little square

screen:blit(x, y, square)
screen.flip()

end
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Fri Aug 26, 2005 1:48 pm    Post subject: Reply with quote

Take a look at the Tutorial.
Back to top
View user's profile Send private message
F34R



Joined: 28 Jul 2005
Posts: 29

PostPosted: Fri Aug 26, 2005 2:59 pm    Post subject: Reply with quote

Shine wrote:
Take a look at the Tutorial.


I did already. I was able to use the analog, but it wasnt correct. I wasnt sure what type of x/y stuff I'd need to use. I'll go back and try and figure it out, unless someone wants to put a little hint down for me hehe.
Back to top
View user's profile Send private message
nevyn



Joined: 31 Jul 2005
Posts: 136
Location: Sweden

PostPosted: Fri Aug 26, 2005 5:51 pm    Post subject: Reply with quote

F34R wrote:
Shine wrote:
Take a look at the Tutorial.


I did already. I was able to use the analog, but it wasnt correct. I wasnt sure what type of x/y stuff I'd need to use. I'll go back and try and figure it out, unless someone wants to put a little hint down for me hehe.


If you keep asking for help with everything, you'll never learn properly yourself. Writing an app to test the behavior of the analog stick isn't that hard, and you'll probably learn more than just the analog stick in the process.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
F34R



Joined: 28 Jul 2005
Posts: 29

PostPosted: Fri Aug 26, 2005 9:33 pm    Post subject: Reply with quote

nevyn wrote:
F34R wrote:
Shine wrote:
Take a look at the Tutorial.


I did already. I was able to use the analog, but it wasnt correct. I wasnt sure what type of x/y stuff I'd need to use. I'll go back and try and figure it out, unless someone wants to put a little hint down for me hehe.


If you keep asking for help with everything, you'll never learn properly yourself. Writing an app to test the behavior of the analog stick isn't that hard, and you'll probably learn more than just the analog stick in the process.


Well, I continued to think about it, and write different things down, test them, and do it over again lol. I got it all working properly.

Thanks for the encouragement. I only asked for help because I was becoming very frustrated with failure. Fatigue from other things wasnt helping me think about what I wanted to accomplish, and... well, I was just very tired. I wish someone would have posted something for me to look at, but I did figure it out w/o it. So I guess its possible lol.

You were right, I learned something more than just how to implement basic movemen with the A-nub... I was able to figure out how to control its speed as well. Thanks.
Back to top
View user's profile Send private message
Slopey



Joined: 31 Jul 2005
Posts: 24

PostPosted: Sat Aug 27, 2005 1:43 am    Post subject: Luaplayer windows controls question Reply with quote

Hi All,

I'm using the windows lua player to code up my app without having to copy over to the PSP all the time, but I can't get the controls to work correctly. My test program (included below) produces the following results for the following keys:

a, s, q & w all work as described ie sel, start and triggers.

But f, r, c and d don't produce the desired behaviour. Instead, e,g,d and f seem to be up, down, left and right respectively. The upshot of this is that with the exception of the triangle and cross keys (r, c), the square and circle keys (d, f) don't produce the desired results - they come out as Left and Right???

Am I missing something totally obvious here? I've been over it so many times Im worried Im missing something thats staring me in the face.

Here's an attached listing which should display some chars based on the button pressed:

Code:

color = Color.new(0,0,0)
white = Color.new(255,255,255)
black = Color.new(0,0,0)

myctrl = ""

while 1  do


   while myctrl == "" do
      screen.waitVblankStart()
      pad = Controls.read()
      if pad:up() then
         myctrl = "UP"
      elseif pad:down() then
         myctrl = "DN"
      elseif pad:left() then
         myctrl = "LF"
      elseif pad:right() then
         myctrl = "RG"
      elseif pad:l() then
         myctrl = "LS"
      elseif pad:r() then
         myctrl = "RS"
      elseif pad:circle() then
         myctrl = "CIR"
      elseif pad:triangle() then
         myctrl = "TRI"
      elseif pad:square() then
         myctrl = "SQUARE"
      elseif pad:select() then
         myctrl = "SEL"
      elseif pad:start() then
         myctrl = "START"
      elseif pad:cross() then
         myctrl = "X"
      end
   end

   screen:clear(white)
   screen:print(10,10,myctrl,black)
   screen.waitVblankStart()
   screen.flip()
   screen.waitVblankStart(30)
   myctrl = ""
   screen:clear(white)
   screen.waitVblankStart()
   screen.flip()

end
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sat Aug 27, 2005 2:12 am    Post subject: Re: Luaplayer windows controls question Reply with quote

Slopey wrote:

I'm using the windows lua player to code up my app without having to copy over to the PSP all the time, but I can't get the controls to work correctly.


There was a bug, will be fixed in the next release.
Back to top
View user's profile Send private message
JJPeerless



Joined: 20 Jun 2005
Posts: 82

PostPosted: Thu Sep 01, 2005 4:22 am    Post subject: Reply with quote

when do you expect the update that includes different color modes for png's?
Back to top
View user's profile Send private message
zhaD



Joined: 07 Sep 2005
Posts: 5
Location: Québec/Canada

PostPosted: Fri Sep 16, 2005 7:52 am    Post subject: Reply with quote

do you have an idea of when you will release the new version of the lua player for windows ? or is it : when its done..
Back to top
View user's profile Send private message MSN Messenger
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
Goto page Previous  1, 2, 3 ... 10, 11, 12
Page 12 of 12

 
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