How to add a background to menu and game
Author |
Message |
Pancakes24564
|
Posted: Wed May 15, 2013 5:00 pm Post subject: How to add a background to menu and game |
|
|
What is it you are trying to achieve?
<Replace all the <> with your answers/code and remove the <>>
What is the problem you are having?
Describe what you have tried to solve this problem
<Answer Here>
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<import GUI
procedure PlayGame
cls
put "credits: an orange."
end PlayGame
View.Set ("graphics:300;200,nobuttonbar")
var draw : int := GUI.CreateButtonFull (200, 10, 0, "Quit", PlayGame, 0, '^D', true)
var quitBtn : int := GUI.CreateButton (50, 10, 0, "Play", GUI.Quit)
loop
exit when GUI.ProcessEvent
end loop
cls
setscreen ("offscreenonly")
var picID : int := Pic.FileNew ("spaceship.bmp")
var x, y, button : int
loop %needs to be in a loop to keep on reading mouse data
Mouse.Where (x, y, button) %code to find data on mouse
%locatexy (x, y) %locate the text to the same line as x&y
%check to see if button is hit
%if button > 0 then
%locatexy (maxx div 2, maxy div 2)
Pic.Draw (picID, x, y, picCopy)
View.Update
delay (2)
cls
end loop>
Turing: |
<Add your code here>
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Nathan4102
|
Posted: Wed May 15, 2013 5:01 pm Post subject: RE:How to add a background to menu and game |
|
|
You need to draw your background before you draw your foreground, and then repeat drawing both of them in a loop. |
|
|
|
|
|
|
|