![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
This is a discussion on [WIP]LuaPhysics: Demo within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I was bored one day and made a small 2d physics demo for the psp. there is only one bug:The ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
![]() |
I was bored one day and made a small 2d physics demo for the psp.
there is only one bug:The box moves faster and faster rather than slower and slower(like it should be) anyway, I need Lua coders to help me develop it into a 2d physics playground. if any one would like to help PM me. |
|
|
|
|
|
#5 |
![]() |
Physics: The science of matter and energy and their interactions.
__________________
[CENTER][IMG]http://i169.photobucket.com/albums/u240/Murasaki007/3060000000056603.gif[/IMG][COLOR=Lime] [/COLOR][CENTER] [/CENTER] [URL="http://forums.qj.net/showthread.php?t=111647"]All Forum Policies[/URL] [/CENTER] [CENTER] [/CENTER] |
|
|
|
|
|
#6 |
![]() |
Have you tried the program out...pretty cool the thing it does but he said he having a problem slowing it down, I haven't really looked at it but yeah
-= Double Post =- Code:
System.usbDiskModeActivate()
object = Image.load("tux.png")
posx = 240
posy = 136
weight = 0.6
velx = 1
vely = 3
while true do
screen:clear()
pad=Controls.read()
White = Color.new(255,255,255)
oldx = posx
oldy = posy
posx = posx - velx
posy = posy - vely
velx = velx - weight
vely = vely - weight
if posx > 480 or posx < 0 then
velx = -velx
posx = oldx
weight = weight + .6
end
if posy > 272 or posy < 0 then
vely = -vely
posy = oldy
weight = weight + .6
end
screen:blit(posx,posy,object)
if pad:r() then break end
screen.flip()
screen.waitVblankStart()
end
Last edited by xpack; 07-05-2007 at 06:47 PM.. Reason: Automerged Doublepost |
|
|
|
|
|
#7 |
![]() ![]() ![]() Developer
|
Well since the velocity can be negative, when you subtract the weight from it, it'll become even more negative (meaning faster right motion). So an easy fix would be to check if the velocity is negative; in that case, just add the weight instead (and clamp it to 0);
|
|
|
|
|
|
#8 |
![]() |
Code:
System.usbDiskModeActivate()
object = Image.load("tux.png")
posx = 240
posy = 136
weight = 0.6
velx = 1
vely = 3
while true do
screen:clear()
pad=Controls.read()
White = Color.new(255,255,255)
oldx = posx
oldy = posy
posx = posx - velx
posy = posy - vely
velx = velx - weight
vely = vely - weight
if posx > 480 or posx < 0 then
velx = -velx
posx = oldx
if velx < 0 then weight = weight + .1 end
end
if posy > 272 or posy < 0 then
vely = -vely
posy = oldy
if vely < 0 then weight = weight + .1 end
end
screen:blit(posx,posy,object)
if pad:r() then break end
screen.flip()
screen.waitVblankStart()
end
Code:
System.usbDiskModeActivate()
object = Image.load("tux.png")
posx = 240
posy = 136
weight = 0.6
velx = 1
vely = 3
while true do
screen:clear()
pad=Controls.read()
White = Color.new(255,255,255)
oldx = posx
oldy = posy
posx = posx - velx
posy = posy - vely
velx = velx - weight
vely = vely - weight
if posx > 480 or posx < 0 then
velx = -velx
posx = oldx
if velx < 0 then velx = velx + weight end
end
if posy > 272 or posy < 0 then
vely = -vely
posy = oldy
if vely < 0 then vely = vely + weight end
end
screen:blit(posx,posy,object)
if pad:r() then break end
screen.flip()
screen.waitVblankStart()
end
@nataku92 - I dont really understand what you mean |
|
|
|
![]() |
| Tags |
| demo , wipluaphysics |
| Thread Tools | |
|
|