Go Back   Game Tagg Forums - PSP Games, PSP Downloads, PSP News, and PSP Themes > Playstation Chat > PSP Homebrew Discussion > PSP Homebrew Coding Discussion

Reply
 
LinkBack Thread Tools
Old 06-08-2008   #1 (permalink)
GamingCrazy Rookie
 
Join Date: Dec 2006
Posts: 193
coding issue

ok so im a little confussed when i had my psp phat this code i wrote worked on lua player fine, but then i bought a psp slim and had to find a different lua player that worked for it and im now using lua player HM v1.0 but when i tried to load my code it just gave me a black screen and shut off so do you think it is a prob with my code something possibly getting changed? or do you think its a combatibility issue?
p.s. heres my code if someone would be nice enough to read through it to see if its the thing causing the problem. (and its not the prettiest written code just so you all know)
Spoiler
Code:
System.usbDiskModeActivate()
red = Color.new(0,0,255)
green = Color.new(0,255,0)
ground =  Image.createEmpty(480,5)
ground:clear(green)
oldpad = Controls.read()
currentBullet = 0
direction = "right"
floor = Image.load("background.png")
pic1 = Image.load("enemy.png")
pic2 = Image.load("pic2.png")
shell = Image.load("bullet.png")
fallen = Image.load("killed.png")
Floor = {}
Floor.x = 0
Floor.y = 0
Dead = { }
Dead[1] = { x = 286, y = 107}
Pic = { }
Pic[1] = { x = 286, y = 107}
Mine = { }
Mine[1] = { x = 275, y = 143, h = pic2:height(), w = pic2:width() }
Pic = { }
Pic[1] = { x= 286, y = 107, h = pic1:height(), w = pic1:width() }
Player = {}
Player[1] = { oldx = 50, oldy = 107 }
Player.gravity = 107
Player.y = 10 
Player.x = 20
Player.jumpspeed = 10
Player.jumpstate = "ground"
Player.weapon = "gun"
Player.img = {
["gun"] = Image.load("player_gun.png"),
["none"] = Image.load("player.png"),
["flame"] = Image.load("player_flame.png"),
["machine"] = Image.load("player_machine.png"),
["crouch"] = Image.load("player_crouch.png"),
["kneel"] = Image.load("player_crouch2.png")}
BulletInfo = {}
BulletInfo[1] = { pic = shell, firing = false, direction = "right", x = Player.x + 32,
y = Player.y + 16, h = shell:height(), w = shell:width() }
playerHeight = 90
playerWidth = 90
function movePlayer()
pad = Controls.read()
if pad:left() then 
Player.x = Player.x - 1 
end
if pad:right() then 
Player.x = Player.x + 1 
end
end
Player.x = Player[1].oldx
Player.y = Player[1].oldy
function bulletSetup()
if direction == "left" then
BulletInfo[1].x = Player.x
BulletInfo[1].y = Player.y + 16
end
if direction == "right" then
BulletInfo[1].x = Player.x + 32
BulletInfo[1].y = Player.y + 16
end
BulletInfo[1].direction = direction
BulletInfo[1].firing = true
end
function bulletFire()
if BulletInfo[1].firing == true then
if BulletInfo[1].direction == "right" then BulletInfo[1].x = BulletInfo[1].x + 10 end
if BulletInfo[1].direction == "left" then BulletInfo[1].x = BulletInfo[1].x - 10 end
screen:blit(BulletInfo[1].x,BulletInfo[1].y,BulletInfo[1].pic)
end
if BulletInfo[1].x < 0 or BulletInfo[1].x > 480 then
BulletInfo[1].firing = false
end
end
function collision(Pic,BulletInfo)
if (Pic[1].x+Pic[1].w > BulletInfo[1].x ) and (Pic[1].x < BulletInfo[1].x + BulletInfo[1].w) and (Pic[1].y + Pic[1].h > BulletInfo[1].y) and (Pic[1].y < BulletInfo[1].y + BulletInfo[1].h) then
 return true
 else
  return false
 end
end
alpha = true
while true do
pad = Controls.read()
screen:clear()
screen:blit(0,262,ground)
screen:blit(Floor.x, Floor.y,floor)
screen:blit(Pic[1].x,Pic[1].y,pic1)
screen:blit(Player.x,Player.y,Player.img[Player.weapon])
if pad:left() and Player.x > 0 then
Player.x = Player.x - 2
end
if pad:right() and Player.x < 480 then
Player.x = Player.x + 2
end
if pad:up() then
Player.weapon = "kneel"
end
if pad:down() then
Player.weapon = "crouch"
end
if pad:r() then
Player.weapon = "gun"
end
if pad:l()
 then
Player.weapon = "machine" 
end
if pad:cross() and Player.jumpstate == "ground" then Player.jumpstate = "jumping"
end 
if Player.jumpstate == "jumping" then 
Player.jumpspeed = Player.jumpspeed - 0.5
Player.gravity = Player.gravity - Player.jumpspeed 
end
if Player.gravity < 0 then 
Player.jumpstate = "falling"
end
if Player.gravity < 107 and Player.jumpstate == "falling" then 
Player.gravity = Player.gravity + (Player.jumpspeed + 3) 
end
if Player.gravity == 107 then 
Player.jumpspeed = 10
Player.jumpstate = "ground"
end
if Player.gravity > 107 then Player.gravity = 107 
end
Player.y = Player.gravity
if collision(Pic,BulletInfo) then
screen:blit(Dead[1].x, Dead[1].y, fallen)
screen.flip()
end
if Player.x == 380 then
screen:print(200,80,"you beat level 1")
screen.flip()
screen.waitVblankStart(40)
screen:clear()
end
if Player.x == 286 then
Player.x = Player[1].oldx
Player.y = Player[1].oldy and
screen:print(210,80,"you lost")
screen.flip()
screen.waitVblankStart(30)
screen:clear()
end
if pad:circle() and oldpad:circle() ~= pad:circle() then
bulletSetup()
end
bulletFire()
screen.waitVblankStart()
screen.flip()
oldpad = pad
end

Thank you to anyone that is willing to help
p.s. if this is the wrong place to post this im sorry
chrono trigger is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Old 06-08-2008   #2 (permalink)
GamingCrazy Elite
 
SlasherX's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 3,112
Re: coding issue

I'm pretty sure it's gotta do with compatibility. Or that might be wrong, since the last time I did coding was quite a while ago. Forgot pretty much everything. I don't know how to do it so it'd work on a Slim though :/

But I do know, that for eboots you need to compile it with a 3.8+ Kernel or something. Check out the coding website

[Only registered and activated users can see links. ]

That was the forum I used when I was learning. Perhaps they can help you .. but the forum is kinda half dead.
__________________
Premium thanks to Bex ^_^

Deltahawk12 + Darkatomz = Best news poster ever for GC!

SlasherX is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-17-2009   #3 (permalink)
GamingCrazy Newbie
 
Join Date: Jan 2009
Posts: 2
Icon7 Re: coding issue

can someone tell me how to get hacks and if they are free or not..?
crosbycid8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-17-2009   #4 (permalink)
Super Moderator

 
oldgit9's Avatar
 
Join Date: Mar 2007
Location: Plymouth UK.
Age: 35
Posts: 3,062
Send a message via AIM to oldgit9 Send a message via MSN to oldgit9 Send a message via Yahoo to oldgit9
Re: coding issue

Quote:
Originally Posted by crosbycid8 View Post
can someone tell me how to get hacks and if they are free or not..?
what are you trying or wanting to do???
__________________

Click on the above picture to view our group.


oldgit9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-17-2009   #5 (permalink)
GamingCrazy Newbie
 
Join Date: Jan 2009
Posts: 2
Re: coding issue

to have like hacks like umm to get them and use them in ftb2
crosbycid8 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 01-17-2009   #6 (permalink)
Super Moderator

 
oldgit9's Avatar
 
Join Date: Mar 2007
Location: Plymouth UK.
Age: 35
Posts: 3,062
Send a message via AIM to oldgit9 Send a message via MSN to oldgit9 Send a message via Yahoo to oldgit9
Re: coding issue

sorry...but i've been off the scene for a bit...what is "ftb2" exactly???
__________________

Click on the above picture to view our group.


oldgit9 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-08-2009   #7 (permalink)
GamingCrazy Fanatic
 
MATTx360xUK's Avatar
 
Join Date: Apr 2006
Posts: 317
Re: coding issue

Quote:
Originally Posted by oldgit9 View Post
sorry...but i've been off the scene for a bit...what is "ftb2" exactly???
Socom: Fire Team Bravo 2
MATTx360xUK is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

  Game Tagg Forums - PSP Games, PSP Downloads, PSP News, and PSP Themes > Playstation Chat > PSP Homebrew Discussion > PSP Homebrew Coding Discussion

« - | - »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


visitor stats
All times are GMT. The time now is 03:00 AM.


Powered by vBulletin
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
© 2005-2007 Condor Media Network
vB Ad Management by =RedTyger=