Title Page

Blitz3D Forums/Blitz3D Programming/Title Page

En929(Posted 2009) [#1]
I'm working in BlitzPlus. I found out how daunting it could be to simple create a title page using an image that I made. I spent most of christmas trying to work that out.

Anyway, I was trying to make it so that the title page shows first, but when the "s" key is pressed, it disappears and doesn't come back.

Also I was trying to make it so that the BACKGROUND,HENRY, and DOOR be in the first scene after the "s" button is pressed (when I was working with it, in some cases it didn't show the scene).

I wrote notes in the code to pinpoint what and where I need help, so that it could be easier to find.

Thanks again



   

Graphics 1600,1000


;************************************************************888
							;Load Visual Images


TITLESCREEN = LoadImage ("Title Screen.png")
HENRY = LoadAnimImage ("Move2.PNG",400,370,0,13)
DOOR = LoadImage("BarberDoor.png")
BACKGROUND = LoadImage ("Store[1].jpg")
BACKGROUND2 = LoadImage ("Barber Shop.jpg")



;*************************************************************888
							;Load Game Boundries

Goinside = LoadImage ("Goinsideclutch.png")
Goback = LoadImage ("Goback.png")



;*************************************************************888
							;Miscellaneous Loads
							
MUSIC_FOR_SCENE_1 = LoadSound ("Mady.wav")
LEFTKEY = (31)							



;*************************************************************888
							;Types to Each Character


Type TITLESCREEN
	Field x,y
End Type 


Type HENRY
	Field x,y
	Field frame
End Type



Type BACKGROUND
	Field x,y
	Field Image
End Type


Type DOOR
	Field x,y
End Type 

Type Goinside
	Field x,y
	
End Type 	

Type Goback
	Field x,y
End Type 


;*********************************************************************************
									;Set Character Variables
	

t.TITLESCREEN = New TITLESCREEN
t\x = 320
t\y = 100


H.HENRY = New HENRY
H\X = 500
H\Y = 490
H\frame = 0



;The BACKGROUND for the first scene

b.BACKGROUND = New BACKGROUND
b\x = -1100
b\y = 90	
b\image = BACKGROUND




d.DOOR = New DOOR
d\x = 430
d\y = 215

gi.Goinside = New Goinside
gi\x = 430
gi\y = 200


;************************************************************************
									;Miscellaneous
									
								

			
									
									
;********************************************************************8888									




While Not KeyDown (1)






Cls





;here is the portion of my game that I'm working on now. I'm trying to make it so that the title page shows first, but when 
;the "s" key is pressed, it disappears and doesn't come back. Also I want the scene with the BACKGROUND,HENRY, and DOOR
;first (when I was working with it, in some cases it didn't even show the scene).


DrawImage (TITLESCREEN,t\x,t\y)
	

	
If KeyHit (31)
		


TileImage (BACKGROUND,b\x,b\y)

		DrawImage (HENRY,h\x,h\y)





				If (d <> Null) Then 
				
						DrawImage (DOOR,d\x,d\y)

									If h\x<=d\x+300 And h\x-150>=d\x And h\y <=d\y+200 And h\y+80 >=d\y Then 

												Delete d
				
									EndIf 
													
													
			
			
				EndIf 		 
EndIf 

;---------------------------------------------------The things above this line are the things that I need help with for now

Flip

Wend 




Midimaster(Posted 2009) [#2]
in the main loop you should have a variable Mode%. Depending on Mode%, the screens change:

Repeat
   If Mode=0 then
      DrawImage  TitleScreen...

   ElseIf Mode=1 then
      DrawImage Background...

     .....
   Endif

   If KeyHit(31) Then
      Mode=1
   ElseIf KeyHit(...) Then
      Mode=...
   Endif

   Flip
Until KeyHit(1)


To change the Variable Mode% you use the KeyHit()s. Because Mode% is 0 at the beginning, it starts with the titlescreen.


En929(Posted 2009) [#3]
Thanks MidiMaster