it reminds me of some code i did in the past(cant remember the lang)
Show me the script and lets see I can help yah
View.Set ("graphics:1020;475")
View.Set ("offscreenonly")
var topR, btmR, topRPrev, btmRPrev, btmBOS : int
topRPrev := 11
btmRPrev := 11
var mx, my, button : int
Draw.FillBox (0, 0, 30, 30, black)
var block, lastBtmBCleared : int
block := Pic.New (0, 0, 30, 30)
var bR, tR, bRPrevX, bRPrevY, tRPrevX, tRPrevY : array 1 .. 35 of int
for fillBR : 1 .. 35
bR (fillBR) := Sprite.New (block)
end for
for fillTR : 1 .. 35
tR (fillTR) := Sprite.New (block)
end for
proc btmBlocks
if btmBOS = 34 then %-when declaring lastBtmBCleared in main program, declare btmBOS := 3
Sprite.SetPosition (bR (lastBtmBCleared), maxx, btmR div 30, false) %-draw new box here, at maxx (not centered if sprite)
end if
for btmBlockNum : 1 .. 35 %-34 = maxx div 30 -box width, 34 = max boxes on screen at once (on one row)
Sprite.SetPosition (bR (btmBlockNum), bRPrevX (btmBlockNum) - 1, bRPrevY (btmBlockNum), false)
bRPrevX (btmBlockNum) -= 1 %-hold previous bR x value
bRPrevY (btmBlockNum) := btmR %-hold previous bR y value
end for
View.Update
end btmBlocks
cls
var y : int := maxy div 2
var countDFont1, countDFont2, pauseFont : int
countDFont1 := Font.New ("impact:100:bold")
countDFont2 := Font.New ("impact:110:bold")
pauseFont := Font.New ("impact:20:bold")
var owl1, owl2 : int
owl1 := Pic.FileNew ("owl1.2.jpg")
owl2 := Pic.FileNew ("owl2.2.jpg")
owl1 := Sprite.New (owl1)
owl2 := Sprite.New (owl2)
var time0 : int := 0
var time0_1 : int := 0
var pauseBox : int
Draw.FillBox (100 + 150, maxy div 2 - 20, (maxx div 2 + 740) div 2 + 150, maxy div 2 + 40, black)
Draw.Text ("AUTOMATICALLY PAUSED, CLICK TO UNPAUSE", 110 + 150, maxy div 2, pauseFont, gray)
pauseBox := Pic.New (100 + 150, maxy div 2 - 20, (maxx div 2 + 740) div 2 + 150, maxy div 2 + 40)
pauseBox := Sprite.New (pauseBox)
Sprite.SetPosition (pauseBox, 100 + 150, maxy div 2 - 20, false)
proc moveOwl (upDown : int)
if upDown = 1 then %Moving down.
Sprite.Show (owl2)
Sprite.SetPosition (owl2, 150, y, true)
View.Update
%delay (3) -original delay time
end if
if upDown = 2 then %Moving up, flapping wings.
if time0 < 100 then %If the wings have been up for less than .1 seconds, then keep them up.
Sprite.Show (owl2)
Sprite.SetPosition (owl2, 150, y, true)
View.Update
%delay (3)
time0 += 6
end if
if time0 > 100 then %If the wings have been up for .1 seconds, then flap.
Sprite.Hide (owl1)
Sprite.Show (owl2)
Sprite.SetPosition (owl2, 150, y, true)
View.Update
%delay (3)
if time0 > 100 * 2 then %Once the wings have been down for .1 seconds, flap, and repeat.
time0 := 0
end if
end if
end if
end moveOwl
%MAIN PROGRAM
var bgColour : int
bgColour := RGB.AddColour (75 / 255, 75 / 255, 75 / 255)
Draw.FillBox (0, 0, maxx, maxy, bgColour)
moveOwl (1)
View.Update
delay (3000)
loop %Countdown, using sprites. -LATER MOVE/FADE(?) COUNTDOWN -loop to create t1, t1, and t3 temporarily for sprites
var t1, t2, t3 : int
Draw.Text ("3", maxx div 2, maxy div 2, countDFont1, red)
Draw.Text ("3", maxx div 2, maxy div 2, countDFont2, black)
t1 := Pic.New (maxx div 2, maxy div 2, maxx div 2 + 100, maxy div 2 + 150)
t1 := Sprite.New (t1)
cls
Draw.FillBox (0, 0, maxx, maxy, bgColour)
Draw.Text ("2", maxx div 2, maxy div 2, countDFont1, red)
Draw.Text ("2", maxx div 2, maxy div 2, countDFont2, black)
t2 := Pic.New (maxx div 2, maxy div 2, maxx div 2 + 100, maxy div 2 + 150)
t2 := Sprite.New (t2)
cls
Draw.FillBox (0, 0, maxx, maxy, bgColour)
Draw.Text ("1", maxx div 2, maxy div 2, countDFont1, red)
Draw.Text ("1", maxx div 2, maxy div 2, countDFont2, black)
t3 := Pic.New (maxx div 2, maxy div 2, maxx div 2 + 100, maxy div 2 + 150)
t3 := Sprite.New (t3)
cls
Draw.FillBox (0, 0, maxx, maxy, bgColour)
moveOwl (1)
View.Update
%Outputting/displaying the sprites.
Sprite.SetPosition (t1, maxx div 2, maxy div 2, true)
Sprite.Show (t1)
View.Update
delay (1000)
Sprite.Hide (t1)
Sprite.SetPosition (t2, maxx div 2, maxy div 2, true)
Sprite.Show (t2)
View.Update
delay (1000)
Sprite.Hide (t2)
Sprite.SetPosition (t3, maxx div 2, maxy div 2, true)
Sprite.Show (t3)
View.Update
delay (1000)
Sprite.Hide (t3)
exit
end loop
loop
mousewhere (mx, my, button)
if button = 1 then
y += 2
moveOwl (2)
else
y -= 2
moveOwl (1)
end if
if mx < 0 or mx > maxx or my < 0 or my > maxy then
if button = 1 then
Sprite.Show (pauseBox)
View.Update
loop
mousewhere (mx, my, button)
if mx > 0 and mx < maxx and my > 0 and my < maxy and button = 1 then
Sprite.Hide (pauseBox)
View.Update
exit
end if
end loop
end if
end if
topR := Rand.Int (1, 10)
btmR := Rand.Int (1, 10)
topR := maxx - (topR * 30)
btmR := btmR * 30
if topRPrev = 11 or topR > topRPrev + 2 then
topR := topRPrev + 2
elsif topR < topRPrev - 2 then
topR := topRPrev - 2
end if
if btmRPrev = 11 or btmR > btmRPrev + 2 then
btmR := btmRPrev + 2
elsif btmR < btmRPrev - 2 then
btmR := btmRPrev - 2
end if
Pic.Draw (block, maxx + 30, btmR div 30, picMerge)
topRPrev := topR
btmRPrev := btmR
View.Update
end loop
So far that's all the code I've got for it. Adding a hell of a lot more.
Anyways, I figured out my original question, but while I'm at it, the program basically is just to make a simple game similar to that good old helicopter one, where you flying around and dodge shit. I'm making that with a lot of other stuff added to it. I know how I could make a level editor to, obviously, make your own level, but I don't quite know of a simple way of playing through that level. The level would run from left to right, and would need to be quite long, possibly looping, but I can't quite think of how I could make the level actually move, and generate properly, at least not without a hell of a sprites and arrays.
I also want to figure out how I could save a map file , and be able to use it after closing the program and reopening it if possible :L.