 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Mon Oct 03, 2005 1:18 pm Post subject: Obligatory Matrix Simulator |
|
|
So I just started tinkering with Lua / LuaPlayer this evening, since I bought my USB-PSP cable a few days ago. Everyone and his dog has probably already done this but here's my attempt, first time with a new language and all, so be gentle! Comments / Feedback appricated, even flames ;)
| Code: | mtdark = Color.new(83, 186, 0)
mtlight = Color.new(191, 234, 0)
scrollcount = 5
mtrand = math.random(30, 40)
scrollx = {}
scrolly = {}
scrollorigy = {}
scrollspeed = {}
function setVars(i)
scrollx[i] = math.random(0, 58)
scrolly[i] = math.random(0, 26 / 2)
scrollorigy[i] = scrolly[i]
scrollspeed[i] = math.random(1, 2)
end
for i = 0, scrollcount do
setVars(i)
end
while true do
screen:clear()
for i = 0, scrollcount do
screen:print(6 + (8 * scrollx[i]), 2 + (10 * scrolly[i]), math.random(0, 9), mtlight)
if scrolly[i] > scrollorigy[i] then
for j = 0, scrolly[i] - scrollorigy[i] do
red = (j / (scrolly[i] - scrollorigy[i])) * 191
green = (j / (scrolly[i] - scrollorigy[i])) * 234
screen:print(6 + (8 * scrollx[i]), 2 + (10 * (scrolly[i]-j)), math.random(0, 9), Color.new(191 - red, 234 - green, 0))
end
end
scrolly[i] = scrolly[i] + scrollspeed[i]
if scrolly[i] > 30 then
setVars(i)
if scrollcount < 15 then
scrollcount = scrollcount + 1
setVars(scrollcount)
end
end
end
screen:fillRect(200, 260, 280, 10, Color.new(0, 0, 0))
screen:print(207, 264, "Matrix Simulator for PSP by Zenurb", Color.new(255, 255, 255))
screen.waitVblankStart()
screen.flip()
pad = Controls.read()
if pad:start() then
break
end
end |
edit - Screenshot!
 _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
flattspott
Joined: 22 Aug 2005 Posts: 22
|
Posted: Mon Oct 03, 2005 3:45 pm Post subject: |
|
|
| Nooooo. I wanted to do that one to |
|
| Back to top |
|
 |
booger
Joined: 03 Jul 2005 Posts: 16 Location: El Segundo CA
|
Posted: Mon Oct 03, 2005 4:06 pm Post subject: |
|
|
| Heh. That's pretty good. |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Mon Oct 03, 2005 6:05 pm Post subject: |
|
|
nice one!
colors (first one was white then followed by green if i am right)
greets
Lumo
PS: did you find a phonce yet? ;) _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Mon Oct 03, 2005 8:03 pm Post subject: |
|
|
| LuMo wrote: | nice one!
colors (first one was white then followed by green if i am right)
greets
Lumo
PS: did you find a phonce yet? ;) |
phonce?
What about the colors?
(In college right now, qwerty sucks.) _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Mon Oct 03, 2005 8:58 pm Post subject: |
|
|
original matrix effect was white, followed by green, wich was getting lighter, thats what i meant
lumo
PS: they used phones to get out of the matrix ;) _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Mon Oct 03, 2005 9:07 pm Post subject: |
|
|
| LuMo wrote: | original matrix effect was white, followed by green, wich was getting lighter, thats what i meant
lumo
PS: they used phones to get out of the matrix ;) |
Ohhhhh hehe. :) _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
Zenurb
Joined: 30 Sep 2005 Posts: 106 Location: United Kingdom
|
Posted: Mon Oct 03, 2005 10:39 pm Post subject: |
|
|
I was working off this image.
The colour on the photo is a bit off as I was taking the picture at four am =) _________________ Proud Dvorak User
US 1.5 PSP (Original) |
|
| Back to top |
|
 |
|
|
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
|