Hey I tried taking some source code from Cargo Bots menu but it didn’t work on my game. I was hoping that someone could help me with a simple menu. Just a title at top of screen, subtitle (for who it’s by), and a press play button that would take you to the game. Any help would be appreciated! I know how to make a menu, I just don’t how to make it appear before the game and dissapear and load the game when you press play.
Here are a couple of tutorials
http://coolcodea.wordpress.com/2013/05/04/47-game-template/
http://codeatuts.blogspot.com.au/2012/07/tutorial-5-finite-state-machines.html
I MADE A MENU NOW
WITHOUT ANY TUTORIALS OR HELP
It’s always nice to do it yourself >:D<
@Ignatz yep:) then u know how it really feels to do it
The menu works like this:
There are 3 labels: title,author,and instructions (touch screen to start game).
I made 3 booleans for the 3 texts and set the ships gravity and fuel to 0 (so it wouldn’t move).
When you touch the screen, text dissapears and the ships gravity is set back to -0.02 and fuel to 100. Here’s a look at my code: (of course these are just the lines for the menu)
function draw()
--This sets a dark background color
background(40, 40, 50)
timer()
if not showText then
title=true
if title then
text("space Thunder", WIDTH/2, 550)
font("Courier-Bold")
fontSize(30)
gravity=0
fuel=0
subtitle=true
if subtitle then
text("Created by One Blaster Games", WIDTH/2, 500)
end
loadit=true
if loadit then
text("Touch screen to start", WIDTH/2, 100)
gravity=0
fuel=0
end
end
end
--here I set the gravity and fuel back to their regular numbers so when you
--touch the screen, the game starts
function touched(t)
if t.state==BEGAN then
timer(15)
gravity=-0.02
fuel=100
end
end
well, good luck with the rest of it
@Kingamer Please read the FAQ on how to format code on the forum. I’ve edited a few of your posts now to fix it.