PSP Hacks - Forums

Go Back   PSP Hacks - Forums > PSP Community > PSP Programming & Development

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2009, 12:26 AM
psp_kevin17 psp_kevin17 is offline
PSP Smarty
 

Join Date: Jun 2009
Posts: 150
psp_kevin17 has a little shameless behaviour in the past
Exclamation Question

Hey guy's trying PGE for the first time an creating a mini game. I was wondering if this is how you display an image for a few seconds then it goes to the game like a splash screen. I have attempted but no it's wrong I know it's wrong but here's the source code

Code:
white = pge.gfx.createcolor(255, 255, 255)
yellow = pge.gfx.createcolor(255, 255, 0)
 
bg = pge.texture.load("Start.png",PGE_RAM,true)
verdana16 = pge.font.load("verdana.ttf", 16, PGE_RAM)
 
if not bg then
	error("Failed to load texture.")
end
 
if not verdana16 then
    error("Error failed to load font.")
end
 
 
while pge.running() do 
pge.controls.update()
pge.gfx.clearscreen()
pge.gfx.startdrawing()
 
bg:activate()
bg:draw(0,0)

verdana16:activate()

 
 
pge.gfx.enddrawing() 
pge.gfx.swapbuffers(10) 
end
Reply With Quote
  #2  
Old 11-01-2009, 09:11 AM
pspjoke's Avatar
pspjoke pspjoke is offline
Programmer
PSP Guru
 

Join Date: Mar 2008
Location: U.S.
Posts: 1,643
pspjoke is on a distinguished road
Default

where is your few seconds delay? im guessing that would just continuously draw the bg on the screen.

think of the concept of what your doing.

draw bg
wait
clear screen
draw something else.

it shouldn't be in a loop unless you have somekind of states system to skip it when the time is right.
i just wouldn't put drawing a splash screen in a loop tho.
__________________
http://levoneprojects.net23.net/

++rep me if i helped you please.
Ahh, shit. Stupidity is on the rise again.
went legit Oct. 31, 09'
piracy is wrong, please don't do it.

Reply With Quote
  #3  
Old 11-01-2009, 01:45 PM
psp_kevin17 psp_kevin17 is offline
PSP Smarty
 

Join Date: Jun 2009
Posts: 150
psp_kevin17 has a little shameless behaviour in the past
Default

Quote:
Originally Posted by pspjoke View Post
where is your few seconds delay? im guessing that would just continuously draw the bg on the screen.

think of the concept of what your doing.

draw bg
wait
clear screen
draw something else.

it shouldn't be in a loop unless you have somekind of states system to skip it when the time is right.
i just wouldn't put drawing a splash screen in a loop tho.
Could u maybe give me an example
Reply With Quote
  #4  
Old 11-01-2009, 03:44 PM
pspjoke's Avatar
pspjoke pspjoke is offline
Programmer
PSP Guru
 

Join Date: Mar 2008
Location: U.S.
Posts: 1,643
pspjoke is on a distinguished road
Default

i don't use lua...
but the concept and implementation is the same regardless.
well, the methods called have different names.. look up what you need then do it.

what you have does draw on the screen correct?

if so then..

Code:
white = pge.gfx.createcolor(255, 255, 255)
yellow = pge.gfx.createcolor(255, 255, 0)
 
bg = pge.texture.load("Start.png",PGE_RAM,true)
verdana16 = pge.font.load("verdana.ttf", 16, PGE_RAM)
 
if not bg then
    error("Failed to load texture.")
end
 
if not verdana16 then
    error("Error failed to load font.")
end
 
 
while pge.running() do <<remove this.
pge.controls.update()
pge.gfx.clearscreen()
pge.gfx.startdrawing()
 
bg:activate()
bg:draw(0,0)

verdana16:activate()

 
 
pge.gfx.enddrawing() 
pge.gfx.swapbuffers(10) 
<<insert a wait here.
<<insert clear screen method.
end<<remove this.
__________________
http://levoneprojects.net23.net/

++rep me if i helped you please.
Ahh, shit. Stupidity is on the rise again.
went legit Oct. 31, 09'
piracy is wrong, please don't do it.


Last edited by pspjoke; 11-01-2009 at 03:48 PM.
Reply With Quote
  #5  
Old 11-02-2009, 12:11 AM
Brick Brick is offline
I am Flame Master
PSP Titan
 

Join Date: Mar 2005
Location: *this
Posts: 42,229
Brick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond reputeBrick has a reputation beyond repute
Default

Yo Kervin ... what's up??

Quote:
Hey guy's trying PGE for the first time an creating a mini game
First=>Last<=First<~kthxbye<=?
It doesn't matter , still , the logic is pretty simple...
Let me guess , you still haven't learned the basics ... right?....................

Spoiler:

//=edit=//
Tell me how """hard""" is this :
Code:
//if you want it state driven , forget about loops , just push/pop states.
func "delay" : params : "destTime" : returns : "nothing"
while ( dt < destTime )
{
    currTime = get time
    dt += currTime - lastTime
    lastTime = currTime
}
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
Spoiler:

????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????


Last edited by Brick; 11-02-2009 at 12:17 AM.
Reply With Quote
  #6  
Old 11-02-2009, 08:22 PM
psp_kevin17 psp_kevin17 is offline
PSP Smarty
 

Join Date: Jun 2009
Posts: 150
psp_kevin17 has a little shameless behaviour in the past
Default

Yo brick what up I haven't learnt that yet but thanks could you maybe explain the code a little


Quote:
Originally Posted by Brick View Post
Yo Kervin ... what's up??



First=>Last<=First<~kthxbye<=?
It doesn't matter , still , the logic is pretty simple...
Let me guess , you still haven't learned the basics ... right?....................

Spoiler:

//=edit=//
Tell me how """hard""" is this :
Code:
//if you want it state driven , forget about loops , just push/pop states.
func "delay" : params : "destTime" : returns : "nothing"
while ( dt < destTime )
{
    currTime = get time
    dt += currTime - lastTime
    lastTime = currTime
}
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
Spoiler:

????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????

Reply With Quote
  #7  
Old 11-02-2009, 09:53 PM
psp_kevin17 psp_kevin17 is offline
PSP Smarty
 

Join Date: Jun 2009
Posts: 150
psp_kevin17 has a little shameless behaviour in the past
Default

OK got it but it keep looping and I took of the pge.running() do off and now it wont work so here's the working code

Code:
--COLORS
white = pge.gfx.createcolor(255, 255, 255)
yellow = pge.gfx.createcolor(255, 255, 0)
 
--PICTURES
bg = pge.texture.load("./pictures/start.png")
if not bg then
	error("Failed to load texture.")
end

--FONTS
verdana16 = pge.font.load("verdana.ttf", 16, PGE_RAM)
if not verdana16 then
    error("Error failed to load font.")
end
  
        while pge.running() do
	pge.controls.update()
	pge.gfx.startdrawing()
	pge.gfx.clearscreen()

		bg:activate()
		bg:draw(0,0)
		pge.gfx.swapbuffers()
		pge.delay(3000000)
end
Why could this be??
Reply With Quote
  #8  
Old 11-02-2009, 11:14 PM
pspjoke's Avatar
pspjoke pspjoke is offline
Programmer
PSP Guru
 

Join Date: Mar 2008
Location: U.S.
Posts: 1,643
pspjoke is on a distinguished road
Default

its keeps looping cause its in a loop....

thought that would be an obvious thing..
__________________
http://levoneprojects.net23.net/

++rep me if i helped you please.
Ahh, shit. Stupidity is on the rise again.
went legit Oct. 31, 09'
piracy is wrong, please don't do it.

Reply With Quote
  #9  
Old 11-03-2009, 05:47 PM
psp_kevin17 psp_kevin17 is offline
PSP Smarty
 

Join Date: Jun 2009
Posts: 150
psp_kevin17 has a little shameless behaviour in the past
Default

Quote:
Originally Posted by pspjoke View Post
its keeps looping cause its in a loop....

thought that would be an obvious thing..
it is obvious but when I take out the while pge.running() do it messes up the code it's so weird
Reply With Quote
  #10  
Old 11-03-2009, 08:02 PM
pspjoke's Avatar
pspjoke pspjoke is offline
Programmer
PSP Guru
 

Join Date: Mar 2008
Location: U.S.
Posts: 1,643
pspjoke is on a distinguished road
Default

pge.running() may do something to start off the pge engine.
call it by itself out of the loop and see what happens.
__________________
http://levoneprojects.net23.net/

++rep me if i helped you please.
Ahh, shit. Stupidity is on the rise again.
went legit Oct. 31, 09'
piracy is wrong, please don't do it.

Reply With Quote
Reply

 



Thread Tools
Display Modes

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

Forum Jump


All times are GMT -4. The time now is 09:05 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©