помогите с кодом там когда в игру заходишь псп отрубается
вот сам код:
red = pge.gfx.createcolor(255,0,0)
white = pge.gfx.createcolor(255,255,255)
MyFont = pge.font.load("verdana.ttf",12)
zombie = pge.texture.load("zombie.png")
human = pge.texture.load("human.png")
bg = pge.texture.load("bg2.png")
house = pge.texture.load("house.png")
bullet = pge.texture.load("bullet.png")
blood_s = pge.texture.load("shot.png")
ba=0
pge.mp3.play("game_music.mp3")
pge.mp3.loop(true)
mySound = pge.wav.load("weapon.wav")
blood = false
zombie_h = 100
zombie_a = 255
start1zx = 252
start1zy = 222
x = 217
y = -17
cx = 100
cy = 100
r = 25
pi = 0
s = 0
i1 = 1.75
x1 = 0
y1 = 0
rb=i1*pi
fire=false
while pge.running() do
pi = math.pi
s = 2/(r*r*0.5)
rot=i1*pi+(pi/2)
zot=3.141+(i1*pi+(pi/2))
pge.controls.update()
pge.gfx.startdrawing()
pge.gfx.clearscreen()
myfont:fillRect(10,10,player.health,healthbar.y,red)
myfont:print(10,30,player.health,white)
bg:activate()
bg:draweasy(0,0)
house:activate()
house:draweasy(188,0)
zombie:activate()
zombie:draweasy(start1zx,start1zy,zot,255)
human:activate()
human:draweasy(x,y,rot,255)
bullet:activate()
bullet:draweasy(x1,y1,rb,ba)
if blood == true then
blood_s:activate()
if blood == true then
blood_s:draweasy(start1zx, start1zy)
end
end
pge.gfx.enddrawing()
pge.gfx.swapbuffers()
if pge.controls.held(PGE_CTRL_UP) and (y > -17) then
y=y-1
if fire==false then
cy=cy-1
end
elseif pge.controls.held(PGE_CTRL_DOWN) and (y < 254) then
y=y+1
if fire==false then
cy=cy+1
end
elseif pge.controls.held(PGE_CTRL_LEFT) and (x > 0) then
x=x-1
if fire==false then
cx=cx-1
end
elseif pge.controls.held(PGE_CTRL_RIGHT) and (x < 462) then
x=x+1
if fire==false then
cx=cx+1
end
end
if start1zx<x and start1zy>y then
start1zy=start1zy-0.5
start1zx=start1zx+0.5
else
end
if start1zx<x and start1zy>y then
start1zy=start1zy+0.5
start1zx=start1zx+0.5
else
end
if start1zx>x and start1zy<y then
start1zy=start1zy+0.5
start1zx=start1zx-0.5
else
end
if start1zx>x and start1zy>y then
start1zy=start1zy-0.5
start1zx=start1zx-0.5
end
anx = pge.controls.analogx()
if math.abs(anx) > 32 then
x = x + anx / 64
end
any = pge.controls.analogy()
if math.abs(any) > 32 then
y = y + any / 64
end
if pge.controls.held(PGE_CTRL_LTRIGGER) then
i1 = i1 -0.01
if fire==false then
x1 = cx+r*math.cos(pi*i1)
y1 = cy+r*math.sin(pi*i1)
end
elseif pge.controls.held(PGE_CTRL_RTRIGGER) then
i1 = i1 +0.01
if fire == false then
x1 = cx+r*math.cos(pi*i1)
y1 = cy+r*math.sin(pi*i1)
end
end
if pge.controls.pressed(PGE_CTRL_CROSS) and fire == false then
mySound:play()
fire = true
end
if fire == true and pge.controls.released(PGE_CTRL_CROSS) then
fire = true
end
if not pge.controls.pressed(PGE_CTRL_CROSS) and fire == false then
fire = false
end
if fire == true then
bot_h = bot_h - 50
ba = 255
cnx = (cx-x1)*0.2
cny = (cy-y1)*0.2
cx=cx+cnx
cy=cy+cny
x1=x1+cnx
y1=y1+cny
end
if fire == false then
ba = 0
x1 = cx+r*math.cos(pi*i1)
y1 = cy+r*math.sin(pi*i1)
cx=x
cy=y
cnx = (cx-x1)*0.2
cny = (cy-y1)*0.2
rb=rot
end
if zombie_h <= 0 then
blood = true
end
if blood == true then
if zombie_a >= 255 then
end
if zombie_a > 0 then
zombie_a = bot_a -3
end
end
if x1>=512 or x1<=-32 or y1>=304 or y1<=-42 then
fire = false
end
end
Добавлено спустя 1 минуту 9 секунд:некоторые части скрипта я брал из игры vladgalay'я flyer