Zeige Ergebnis 5.461 bis 5.490 von 10238
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; I cant get it to work inside homebrew games......
-
01-30-2007, 09:55 PM #5461lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
I cant get it to work inside homebrew games...
-
01-30-2007, 10:13 PM #5462words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Hmm... Maybe ask around or something? Do you not have a webcam or something?

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
01-30-2007, 10:32 PM #5463QJ 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
well Shrooms pretty much covered it, it first explodes with white pixels/particles then again with color, it goes out from the center and disappears after going so far, it kind of looks like a star field except the particles don't get bigger as they move out. Thats about it, looks like they do what there supposed to do. Hope this helpsNEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
01-30-2007, 11:53 PM #5464words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Im an idiot... Damn opaque values got mixed up in my head... Anywho... Someone tell me what they think of this. this version should fade away the particles, as well as have some take longer, and some shorter, to fade away. Now... I just need to do that color scheme method where if 2 particles are on eachother, the color on the screen turns more white...
Code:--[[ Lua Particle Demo By: SG57 No more than an eye looker... For now ;) ]] math.randomseed(os.time( )) num_particles = 499 -- # of particles to have on screen particle = {} for i=0,num_particles do -- constructs each particle with default values particle[i] = { x=240,y=136, -- x and y coordinates xspeed,yspeed, -- speed on x and y planes color=Color.new(255,255,255), -- color of particle life=255, -- life determines color ^ angle=math.random(360), -- random angle for particle movement speed=10, -- particle speed fade_speed=40, -- fading speed of particle r=255,g=255,b=255 -- so color can be changed } particle[i].xspeed = math.sin(particle[i].angle) * particle[i].speed -- set x axis vector speed particle[i].yspeed = math.cos(particle[i].angle) * particle[i].speed -- set y axis vector speed end while true do screen:clear() for i=0,num_particles do particle[i].xspeed = math.sin(particle[i].angle) * particle[i].speed -- set x axis vector speed particle[i].yspeed = math.cos(particle[i].angle) * particle[i].speed -- set y axis vector speed particle[i].x = particle[i].x + particle[i].xspeed -- Vector speeds particle[i].y = particle[i].y + particle[i].yspeed -- ^ particle[i].color = Color.new(particle[i].r,particle[i].g,particle[i].b,particle[i].life) if particle[i].life <= 0 then particle[i].r=math.random(255) particle[i].g=math.random(255) particle[i].b=math.random(255) particle[i].life = 255 particle[i].speed=math.random(3,5) particle[i].fade_speed=math.random(15,50) particle[i].x = 240 particle[i].y = 136 particle[i].angle=math.random(360) end particle[i].life = particle[i].life - particle[i].fade_speed screen:fillRect(particle[i].x,particle[i].y,2,2,particle[i].color) end screen.waitVblankStart() screen.flip() end
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
01-31-2007, 01:46 AM #5465QJ 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
Just tested it, the particles still don't fade, But they do disappear at different times/places, however most of them disappear before the last usual point, (over all, the entire particle smoke/explosion is smaller)...I'm going to try to rig up some screen shotter so you can at least take a look.
EDIT:, ok, I got a Screen..

Probably doesn't help as much as actuelly watching it, but I hope it helpsGeändert von BlackShark (01-31-2007 um 01:58 AM Uhr)
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
01-31-2007, 02:59 AM #5466
nice SG57.
-
01-31-2007, 03:37 AM #5467QJ 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
Thats it :)
hey eyece, do you mind if I ask how you got that?NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
01-31-2007, 05:04 AM #5468QJ Gamer Silver

- Registriert seit
- Jun 2006
- Ort
- UK
- Beiträge
- 2.326
- Points
- 10.263
- Level
- 67
- Downloads
- 0
- Uploads
- 0
I take a look at it when I get some time tonight but you looking for these type of particle effects?
http://www.youtube.com/watch?v=gh5RzfDU_ew
The reason for the ring like explosion at the beginning is because of this line
This should be random between 15 and 50.Code:fade_speed=40, -- fading speed of particle
[Blog] [Portfolio]
[Homebrew Illuminati - Serious Homebrew Development Forums]
[I want to make Homebrew FAQ] [How I broke into the Games Industry]
[Programming Book List] [Programming Article List]
-
01-31-2007, 12:56 PM #5469QJ Gamer Silver
- Registriert seit
- Oct 2006
- Ort
- 貴方
- Beiträge
- 1.159
- Points
- 7.371
- Level
- 57
- Downloads
- 0
- Uploads
- 0
my ai isnt moving...
thank you for ur help
Zitat von ai code
-
01-31-2007, 01:00 PM #5470
I put a screen:save() after screen.flip() and put all the frames into a gif.Thats it
hey eyece, do you mind if I ask how you got that?
@head shot, how is "elseif ufo1.x < ufo1.x then" meant to work?, don't you mean player x?.Geändert von eyece (01-31-2007 um 01:17 PM Uhr)
-
01-31-2007, 01:08 PM #5471QJ 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
mm, i don't think your using that math random right...
Give that a try, not sure if it works, but its worth a try, ( I eliminated the stall variable itself cuz you didn't really need it in that code, but you can always add it in again if you'd like. What I did with the math.random is ever loop it will come up with, either a 1 or a 2, if it comes up as a 1, your if statements will come into play, Hope this helpsCode:math.randomseed(os.time() ) Player = { x = 205, y = 120, img = earth} ufo1 = { x = 0, y = 120, img = ufo } function chasePlayer() if math.random(1,2) == 1 then if ufo1.x > 205 then ufo1.x = ufo1.x - 2 elseif ufo1.x < ufo1.x then ufo1.x = ufo1.x + 2 end if ufo1.y > ufo1.y then ufo1.y = ufo1.y - 2 elseif ufo1.y < 120 then ufo1.y = ufo1.y + 2 end end end end
-= Double Post =-
ahh, cool, how did you get it to save as different names?
Zitat von eyece
Geändert von BlackShark (01-31-2007 um 01:08 PM Uhr) Grund: Automerged Doublepost
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
01-31-2007, 01:23 PM #5472
i putahh, cool, how did you get it to save as different names?
above the while loop andCode:imgc = 0
below the flip.Code:if Controls.read():start() then break end screen:save("screen"..imgc..".png") imgc = imgc + 1
-
01-31-2007, 01:31 PM #5473QJ 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
ah, i see, cool, Thanks :)
NEWMy New BLOG!NEWThe Wentire Worls in two Sectors....When did I get dev statz?
Spoiler for my PSP homebrewReleases:Spoiler for Great Quotes:
-
01-31-2007, 02:00 PM #5474QJ Gamer Silver
- Registriert seit
- Oct 2006
- Ort
- 貴方
- Beiträge
- 1.159
- Points
- 7.371
- Level
- 57
- Downloads
- 0
- Uploads
- 0
still not moving...
-
01-31-2007, 02:05 PM #5475lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
In your main loop add
chasePlayer()
This calls the chase player function
-
01-31-2007, 02:13 PM #5476QJ Gamer Silver
- Registriert seit
- Oct 2006
- Ort
- 貴方
- Beiträge
- 1.159
- Points
- 7.371
- Level
- 57
- Downloads
- 0
- Uploads
- 0
i know that
obviously i have that in my main loop
-
01-31-2007, 02:21 PM #5477lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Then post your whole code, It will really help.
-
01-31-2007, 02:36 PM #5478QJ Gamer Silver
- Registriert seit
- Oct 2006
- Ort
- 貴方
- Beiträge
- 1.159
- Points
- 7.371
- Level
- 57
- Downloads
- 0
- Uploads
- 0
Zitat von game.lua
there it is
Zitat von ai.lua
-
01-31-2007, 02:47 PM #5479lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Ok, Before i start seeing what your problem is, Why is your AI in another file? You dont need a dofile for that.
-
01-31-2007, 03:14 PM #5480words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
yaustar - I know why the explosion is at the start, andsince people complemented it, i kept it in.
Ill taek a look at that vid right now - and what im looking for is basiclly:
The j would be a for loops incrementing variable, and would be right inside the first for loop.... That SHOULD make it turn more greenish, if 2 particles or more over lap... STill needs work i know.Code:if particle[i].x == particle[j].x and particle[i].y == particle[j].y and i~=j then particle color.g += 3 else particle color.g -= 3 end

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
01-31-2007, 03:28 PM #5481QJ Gamer Silver
- Registriert seit
- Oct 2006
- Ort
- 貴方
- Beiträge
- 1.159
- Points
- 7.371
- Level
- 57
- Downloads
- 0
- Uploads
- 0
there u go
Zitat von game.lua
-
01-31-2007, 11:13 PM #5482words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Wow... this is a sight to be hold ;) Lua Help Thread without an unanswered question :)

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-01-2007, 02:09 AM #5483QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
quite beautiful isnt it SG?
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]
-
02-01-2007, 02:18 AM #5484
it's almost like a little community up in this thread
-
02-01-2007, 01:42 PM #5485lol

- Registriert seit
- Aug 2006
- Ort
- Whittier, CA
- Beiträge
- 5.791
- Points
- 20.859
- Level
- 91
- Downloads
- 0
- Uploads
- 0
Loading an image from memory, Is this a good idea? I know it involves more code but does it improve anything to your game? Or does it just take up memory?
Code:jpegFile = io.open("anim0.jpg", "rb") data = jpegFile:read("*a") jpegFile:close() image = Image.loadFromMemory(data)
-
02-01-2007, 02:24 PM #5486QJ Gamer Green
- Registriert seit
- Jul 2006
- Ort
- Middle Europe
- Beiträge
- 1.281
- Points
- 11.800
- Level
- 71
- Downloads
- 0
- Uploads
- 0
ive seen this on wiki.ps2dev too... anyone can answer?
[1 Year QJ Member]
[LUA Coder and C Learner]
[Ball Revamped Clone v0.1]
[Phil's Shooting Range v0.3]
[HideFile PRX v2]
[SSR PRX v1.1]
-
02-01-2007, 03:34 PM #5487words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
This would be good, im guessing, if you wanted to reload an image. It should be muuuuch faster than loading from memory stick.

...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-01-2007, 03:56 PM #5488QJ Gamer Gold
- Registriert seit
- Aug 2006
- Beiträge
- 1.633
- Points
- 11.629
- Level
- 70
- Downloads
- 0
- Uploads
- 0
But when you set an image to nil it drops from memory.
-
02-01-2007, 04:03 PM #5489words are stones in my <3

- Registriert seit
- Jul 2005
- Ort
- Spokane
- Beiträge
- 5.008
- Points
- 35.274
- Level
- 100
- My Mood
-
- Downloads
- 1
- Uploads
- 0
Why would you free than load an image? Im sure you can load an image into another one....
Im too lazy to test that out.Code:image = Image.load("blah.png") image = Image.load("blah2.png") while true do screen:blit(0,0,image) screen.waitVblankStart() screen.flip() end
...at what speed must I live.. to be able to see you again?...
Projects
You can support my Open World 3D RPG for PSP by voting for it here
-
02-01-2007, 04:11 PM #5490QJ Gamer Green
- Registriert seit
- Dec 2005
- Ort
- Here
- Beiträge
- 2.715
- Points
- 13.310
- Level
- 75
- Downloads
- 0
- Uploads
- 0
faster maybe...but how many images would you need so that a noticable difference in speed occurs?
-= Double Post =-
lol
Zitat von SG57
like that, its like you never loaded "blah.png" at all. but i'm sure you know that. :)
Geändert von EminentJonFrost (02-01-2007 um 04:13 PM Uhr) Grund: Automerged Doublepost
[CENTER][IMG]http://img148.imageshack.us/img148/6985/siglw8.jpg[/IMG][/CENTER]


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