Lua Programming Help Thread
This is a discussion on Lua Programming Help Thread within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Is this kind of like what you are looking for, pspaquaforce? Spoiler for function : Code: if meatwad.x > shake.x ...
-
02-25-2007, 07:28 PM #5821QJ Gamer Blue
- Registriert seit
- Jul 2006
- Ort
- Alabama
- Beiträge
- 142
- Points
- 4.241
- Level
- 41
- Downloads
- 0
- Uploads
- 0
Is this kind of like what you are looking for, pspaquaforce?
Spoiler for function:
Use trial and error (or post your code).
Zitat von %chrono trigger%
EDIT: To below:
That'd be silly.
Zitat von Anti-QJ
Geändert von Aphonia (02-25-2007 um 07:47 PM Uhr)
-
02-25-2007, 07:28 PM #5822lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Dude, It you cant edit the template i gave you, You shouldnt be coding, Unless your copying and pasting?
-
02-25-2007, 08:22 PM #5823
Give me a coder who came after evil-mana was created and doesnt do that, and I will give you a dollar.
Zitat von Anti-QJ
牧来栠摩琠敨映汩獥
PSN: youresamFrom Earth the Frozen Ipaqs shall rise and be silenced and all will live free.
--Mike Hollingsworth
-
02-25-2007, 08:46 PM #5824QJ Gamer Blue
- Registriert seit
- Jul 2006
- Ort
- Alabama
- Beiträge
- 142
- Points
- 4.241
- Level
- 41
- Downloads
- 0
- Uploads
- 0
A good coder?
Zitat von youresam
-
02-25-2007, 08:51 PM #5825lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Tactical Pinguin.
I will be waiting for my dollar :)
-
02-25-2007, 09:09 PM #5826QJ Gamer Silver

- Registriert seit
- Oct 2006
- Ort
- Pimp'en in the US F#
- Beiträge
- 1.254
- Points
- 7.278
- Level
- 56
- Downloads
- 0
- Uploads
- 0
Damn it, Anti beat me to the punch
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
02-25-2007, 09:13 PM #5827lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
NVM, I forgot about his Chase the penguin game.
Geändert von Anti-QJ (02-25-2007 um 09:30 PM Uhr)
-
02-25-2007, 09:21 PM #5828QJ Gamer Silver

- Registriert seit
- Oct 2006
- Ort
- Pimp'en in the US F#
- Beiträge
- 1.254
- Points
- 7.278
- Level
- 56
- Downloads
- 0
- Uploads
- 0
mmm I didn't copy and paste any thing with PvP Pong, but then again, its only Pong.....yup, hard to find one :S
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
02-25-2007, 09:23 PM #5829lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Sorry, You cant count :9
But your an awesome coder!
-
02-25-2007, 09:23 PM #5830QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Hey anti, I guess that chance at getting rid of the sig limit just left. FFS I was a noob back then, look what I've made/am making now.
-
02-25-2007, 09:26 PM #5831lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
But you dint arrive AFTER evilmana.com
Come on, Just put the sig limit to 150, Thats BS
-
02-25-2007, 09:31 PM #5832QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
Yea I did.
-
02-26-2007, 01:16 AM #5833
how do you find the point where 2 lines intercept?
-
02-26-2007, 02:59 AM #5834I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
That's basic math. You have to know the endpoints. Then you find the equations and set them equal to each other. Quick sample.
Zitat von eyece
There might be an easier way, I don't know. This really isn't that hard. It just looks like a lot of work.Code:Endpoints: (0,300),(300,0) - (1,1),(401,201) Slope Forumula(Find slope of lines): y2-y1 _____ x2-x1 0-300 _____ slope = -1 300-0 201-1 _____ slope = 1/2 401-1 Point Slope Forumlua: y - y1 = m(x - x1) y - 300 = -1(x - 0) y = -x + 300 y - 1 = (1/2)(x - 1) y = .5x + .5 Now set them equal to each other. -x + 300 = .5x + .5 299.5 = 1.5x 199.666 = x Now substitute that in for x to get the y coordinate: y = .5(199.666) + .5 y = 100.333 Point where they cross: (199.666,100.333)

-
02-26-2007, 03:30 AM #5835
... you killed my brain.
-
02-26-2007, 03:46 AM #5836I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
How old are you? Because this is like 7th grade stuff.

-
02-26-2007, 02:20 PM #5837Your Fate is Grim...

- Registriert seit
- Oct 2005
- Beiträge
- 2.269
- Points
- 11.640
- Level
- 70
- Downloads
- 0
- Uploads
- 0
you dont understand that?
Zitat von eyece
wow, i really dont think you're ready for programming yet.
wait till 8th grade atlest. learn algebra.--------------------------------------------------------------------------------------
-
02-26-2007, 04:05 PM #5838Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
lol anyway is there a tut or do you guys have an example of how to load a file if my player collidies with an image?
**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
02-26-2007, 04:23 PM #5839I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Code:if (player collides) then file = io.open("myfile.txt","r") text = file:read() file:close() end
-
02-26-2007, 05:31 PM #5840Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
ok can you tell me what the lines of code with the arrows mean?
Zitat von Access_Denied
and what would I put in here -----> (player collides)? the 2 images?**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
02-26-2007, 05:48 PM #5841lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
You have to edit this part
myfile.txt - name of fileCode:("myfile.txt","r")
r - r means it will read the file
Heres a quick copy and paste from evilmana.comCode:*n - reads a number and returns it. ex: file.read("*n") *a - reads the entire file from the current position. ex: file.read("*a") *l - (default) - reads the next line, returns nil on End of File (EOF). ex: file.read("*l") number - returns a string with up to that many characters in it, or nil on EOF. ex: file.read(5)
http://evilmana.com/tutorials/lua_tutorial_09.php
-
02-26-2007, 06:14 PM #5842Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
i used that but it said a ')' was neaded near 'collides'
that really doesnt make sense?**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
02-26-2007, 06:59 PM #5843I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
You should honestly read some lua tuts before starting. Not knowing collision or file io tells me you either didn't read them, or only read to printing text. :/

-
02-26-2007, 07:02 PM #5844Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
what do you mean? i read all the evilmana tuts, but just had questions because they werent very in depth. Besides
i have a fully functional game with 2 images and one player the guy jumps over the 2 mines and if he touches them he returns to the beggining. i get collision i just asked for a tut on how to open a file when a collsion occurs.
forget i asked this isnt helping, but thanks to everyone foor helping me**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
02-26-2007, 07:10 PM #5845I'm Baaaack!

- Registriert seit
- May 2006
- Ort
- Nowhere
- Beiträge
- 2.186
- Points
- 17.067
- Level
- 83
- Downloads
- 0
- Uploads
- 0
Well, if you read the evilmana tut on collisions, then you shouldn't have had the need to ask this question.
Zitat von %chrono trigger%
Zitat von %chrono trigger%

-
02-26-2007, 07:13 PM #5846Look at my user title :p
- Registriert seit
- Feb 2006
- Ort
- Texas
- Beiträge
- 1.183
- Points
- 14.103
- Level
- 77
- Downloads
- 0
- Uploads
- 0
it says nothing about the function to open a file from a collision
i was assuming it was this part: (object,object2) but wasnt sure so i asked to be sure before i add my own code to my game**********, ********** :p
http://img143.imageshack.us/img143/6...boysfanij8.gif
-
02-26-2007, 07:26 PM #5847lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
You cant expect it to show you, You just have to put 2 and 2 together.
-
02-26-2007, 08:43 PM #5848QJ Gamer Blue
- Registriert seit
- Jul 2006
- Ort
- Alabama
- Beiträge
- 142
- Points
- 4.241
- Level
- 41
- Downloads
- 0
- Uploads
- 0
The best way to learn (and really understand) is to experiment. Look at the apps that come with luaplayer for reference (Snake is really good). Ask for help when you've exhausted every idea you've had and mulled over your problem for a while.
Zitat von %chrono trigger%
My advice, anyway.
-
02-27-2007, 11:56 AM #5849
yes, expirementing is the best way to understand!
-
02-27-2007, 11:57 AM #5850
:ROFL: my game is shizy and pointless:ROFL:
hey Aphonia how long did it take you to be a decent coder?Geändert von pspaquaforce (02-27-2007 um 12:10 PM Uhr)


LinkBack URL
About LinkBacks
Mit Zitat antworten

Hello everyone I am new here and I am glad to be part of this amazing community and I think there...
New to forum