Hehe, thats so cute. Gives me an idea actually...
Ok, I'm done.
I give you, MFPSC!
(The M is for mini btw)
Space is to change your object type while in the editor(top left of screen shows what type of object is selected), and F5 is to run the game. Erm, to quit... idk...
`no media monster robots by Sinistar
type robot
dx as float
dz as float
h as integer
f as integer
d as integer
obj as integer
ti as integer
endtype
type part
dx as float
dy as float
dz as float
life as float
endtype
global numrobots as integer
Editor:
`set window on
`set window title "No Media Monster Robots!"
sync on : sync rate 60
color backdrop rgb(0,0,0)
set text font "arial" : set text size 12 : set text transparent
autocam off
disable escapekey
`set up elements
global TopObject
Global MObject : MObject=1
Global GridSize : GridSize=10
MouseSpeed=10
ObjectType=1
size=15
dim Level$(size,size)
for a = 1 to size
for b = 1 to size
Level$(a,b)="0"
next a
next b
`position start camera
xrotate camera 90
move camera -100
position camera camera position x()+50,camera position y(),camera position z()+50
`create pick object
make object Cube MObject,10
`xrotate object MObject,180
`Fix object Pivot MObject
scale object MObject,101,101,101
color object MObject, rgb(1,200,1)
ghost object on MObject, 4
`initialise loop
do
`set cursor 10,10 : print object position x(MObject)
`set cursor 10,20 : print object position z(MObject)
`Stick some run fps gosub code thingie here later
if scancode()=63
delete objects 1,TopObject
TopObject=0
Exit
set window off
endif
`keep pick object with mouse
if object screen x(MObject)>mousex()+MouseSpeed then position object MObject,object position x(MObject)-MouseSpeed,object position y(MObject),object position z(MObject) : off=1
if object screen x(MObject)<mousex()-MouseSpeed then position object MObject,object position x(MObject)+MouseSpeed,object position y(MObject),object position z(MObject) : off=1
if object screen y(MObject)<mousey()-MouseSpeed then position object MObject,object position x(MObject),object position y(MObject),object position z(MObject)-MouseSpeed : off=1
if object screen y(MObject)>mousey()+MouseSpeed then position object MObject,object position x(MObject),object position y(MObject),object position z(MObject)+MouseSpeed : off=1
if object position x(Mobject)<1 then position object MObject,10,Object position y(MObject),Object position z(MObject)
if object position z(Mobject)<1 then position object MObject,Object position x(MObject),Object position y(MObject),10
if object position x(Mobject)>size*10 then position object MObject,size*10,Object position y(MObject),Object position z(MObject)
if object position z(Mobject)>size*10 then position object MObject,Object position x(MObject),Object position y(MObject),size*10
`scroll the screen with the mouse
if mousex()>screen width()-2 then position camera camera position x()+1,camera position y(),camera position z()
if mousex()<1 then position camera camera position x()-1,camera position y(),camera position z()
if mousey()>screen height()-2 then position camera camera position x(),camera position y(),camera position z()-1
if mousey()<1 then position camera camera position x(),camera position y(),camera position z()+1
`switch between types of thingie using the spacekey
`ObjectType$=wall,box,light,robot,start
set cursor 10,10 : print ObjectType$
text 10,20,"x:"+str$(int(object position x(MObject)/10))+" y:"+str$(int(object position z(MObject)/10))
if spacekey()=1
if SpaceDown=0
SpaceDown=1
if ObjectType>5
ObjectType=1
else
inc ObjectType
endif
endif
else
SpaceDown=0
endif
if ObjectType=1 then ObjectType$="wall"
if ObjectType=2 then ObjectType$="start"
if ObjectType=3 then ObjectType$="light"
if ObjectType=4 then ObjectType$="box"
if ObjectType=5 then ObjectType$="robot"
`perform actions based on mouse clicks
if mouseclick()=1 then Gosub MakeObject
if mouseclick()=2 then Gosub DeleteObject
sync
loop
Game:
sync on:sync rate 0
dim brick$(8)
create bitmap 2,32,32
global flare = 150
global s as float
global stimer
autocam off
global obj
set ambient light 0
fog on
fog color 0
fog distance 1000
create bitmap 2,32,32
make camera 1
set camera to image 1,31,32,32
set current bitmap 2:get image 32,1,1,32,32:set current bitmap 0
hide mouse
fov=62
object = 11
shift=0*(object-10)
dist#=(screen height()/2)/tan(FOV/2)-shift
make object plain object,screen width(),screen height()
ghost object on object : disable object zwrite object
set object light object,0
set object fog object,0
position object object,-20,0-1,dist#
lock object on object
texture object object,32
hide object object
dim p(100) as part
dim r(8) as robot
brick$(0)="bbccccbb"
brick$(1)="bccrrccb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(111)
brick$(0)="bbccccbb"
brick$(1)="bcccrrcb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(112)
brick$(0)="bbccccbb"
brick$(1)="bccccrrb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(113)
brick$(0)="bbccccbb"
brick$(1)="bcccccrb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(114)
brick$(0)="bbccccbb"
brick$(1)="bccccccb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(115)
brick$(0)="bbccccbb"
brick$(1)="brcccccb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(116)
brick$(0)="bbccccbb"
brick$(1)="brrccccb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(117)
brick$(0)="bbccccbb"
brick$(1)="bcrrcccb"
brick$(2)="cccccccc"
brick$(3)="cccccccc"
brick$(4)="cbccccbc"
brick$(5)="bbcbbcbb"
brick$(6)="bbcbbcbb"
brick$(7)="bccbbccb"
gettexture(118)
brick$(0)="99999999"
brick$(7)="bbb9bbb9"
brick$(2)="b9b9b9b9"
brick$(3)="bbb9bbb9"
brick$(4)="99999999"
brick$(5)="bbb9bbb9"
brick$(6)="bbb9bbb9"
brick$(7)="bbb9bbb9"
gettexture(5)
brick$(0)="10011001"
brick$(1)="11111111"
brick$(2)="10011001"
brick$(3)="10011001"
brick$(4)="10011001"
brick$(5)="11111111"
brick$(6)="10011001"
brick$(7)="10011001"
gettexture(1)
brick$(0)="11111111"
brick$(1)="10011001"
brick$(2)="10011001"
brick$(3)="11111111"
brick$(4)="11111111"
brick$(5)="10011001"
brick$(6)="10011001"
brick$(7)="11111111"
gettexture(2)
brick$(0)="10101010"
brick$(1)="01010101"
brick$(2)="10101010"
brick$(3)="01010101"
brick$(4)="10101010"
brick$(5)="01010101"
brick$(6)="10101010"
brick$(7)="01010101"
gettexture(3)
brick$(0)="11111111"
brick$(1)="11111111"
brick$(2)="00010000"
brick$(3)="11111111"
brick$(4)="01000010"
brick$(5)="11111111"
brick$(6)="10000001"
brick$(7)="11111111"
gettexture(4)
brick$(0)="00000000"
brick$(1)="11111111"
brick$(2)="00000000"
brick$(3)="11111111"
brick$(4)="00000000"
brick$(5)="11111111"
brick$(6)="00000000"
brick$(7)="11111111"
gettexture(6)
brick$(0)="11111111"
brick$(1)="11000011"
brick$(2)="10100101"
brick$(3)="10011001"
brick$(4)="10011001"
brick$(5)="10100101"
brick$(6)="11000011"
brick$(7)="11111111"
gettexture(7)
brick$(0)="22233222"
brick$(1)="23333332"
brick$(2)="23333332"
brick$(3)="33333333"
brick$(4)="33333333"
brick$(5)="23333332"
brick$(6)="23333332"
brick$(7)="22233222"
gettexture(8)
brick$(0)="bbb88bbb"
brick$(1)="b887788b"
brick$(2)="b877778b"
brick$(3)="87766778"
brick$(4)="87766778"
brick$(5)="b877778b"
brick$(6)="b888888b"
brick$(7)="bbb88bbb"
gettexture(9)
brick$(0)="bbboobbb"
brick$(1)="boonnoob"
brick$(2)="bonnnnob"
brick$(3)="onnmmnno"
brick$(4)="onnmmnno"
brick$(5)="bonnnnob"
brick$(m)="boooooob"
brick$(n)="bbboobbb"
gettexture(18)
makefloortexture()
for i = 1 to 100
ob = 200 + i
make object plain ob,10,10
set object light ob,0
set object fog ob,0
ghost object on ob
set object transparency ob,1
texture object ob,18
set object cull ob,0
hide object ob
next i
make object cylinder 15,10
position object 15,camera position x(),camera position y()-6,camera position z()+10
set object specular 15,0
scale object 15,10,100,10
xrotate object 15,90
lock object on 15
texture object 15,9
make object plain flare,20,20
texture object flare,18
position object flare,camera position x(),camera position y()-10,camera position z()+30
set object light flare,0
ghost object on flare
lock object on flare
hide object flare
make light 7
color light 7,rgb(255,0,0)
set light range 7,300
hide light 7
makelevel()
global tt as word
sprite 1,screen width()/2-16,screen height()/2-16,8
set sprite alpha 1,100
`Main loop
do
if escapekey()=1
delete object 11
Delete objects 1,TopObject
TopObject=0
undim Level$(0,0)
undim brick$(0)
undim p(0)
undim r(0)
delete camera 1
delete light 7
delete bitmap 2
delete image 1
Goto Editor
Endif
getstime()
if timer() - tr >100
tr = timer()
dorobots()
particles()
endif
`blur effect
if timer() - tt > 80
set current bitmap 2
paste image 31,1,1
blur bitmap 2,3
fade bitmap 2,90
get image 32,1,1,32,32
set current bitmap 0
tt= timer()
endif
`end blur effect
`moving
yang = wrapvalue(yang+mousemovex())
xang = wrapvalue(xang + mousemovey())
if xang>45 and xang<300 then xang = 45
if xang > 300 and xang <315 then xang = 315
xrotate camera xang
xrotate camera 1, xang
yrotate camera yang
si# = sin(yang):si2#= sin(wrapvalue(yang+90))
co# = cos(yang):co2#= cos(wrapvalue(yang+90))
ocx = camera position x():ocy = camera position y():ocz = camera position z()
cx = ocx:cz = ocz: cy = ocy
if upkey() then cx = cx + si#*4.0*s:cz = cz + co#*4.0*s
if downkey() then cx = cx - si#*4.0*s:cz = cz - co#*4.0*s
if rightkey() then cx = cx + si2#*4.0*s:cz = cz + co2#*4.0*s
if leftkey() then cx = cx - si2#*4.0*s:cz = cz - co2#*4.0*s
`end moving
`shooting
if timer()-st>500
hide light 7
hide object flare
if mouseclick()=1
position light 7,camera position x(0),camera position y(0),camera position z(0)
show light 7
show object flare
st = timer()
pobj = pick object(screen width()/2,screen height()/2,1000,1000+obj)
d = get pick distance()
move camera d
explode(camera position x(0),camera position y(0),camera position z(0),10)
move camera -d
for i2 = 1 to 8
if pobj > 0
if pobj = r(i2).obj
hitr = i2
explode(object position x(pobj),object position y(pobj), object position z(pobj),50)
hide object pobj
position object pobj,0,-500,0
goto extcheck:
endif
endif
next i2
extcheck:
endif
endif
`end shooting
position camera cx,cy,cz
col=levelcollide(ocx,5,cz)
if col=1
position camera cx,cy,ocz
endif
col=levelcollide(cx,5,ocz)
if col=1
position camera ocx,cy,cz
endif
set cursor 0,0
print obj
position camera 1,camera position x(0),camera position y(0),camera position z(0)
yrotate camera 1, camera angle y(0)
sync
loop
MakeObject:
Number=freeobject()
if FreeZone(object position x(MObject),object position y(MObject),object position z(MObject))
if ObjectType$="wall"
make object cube Number,10
color object Number,rgb(100,100,100)
Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="1"
endif
if ObjectType$="box"
make object cube Number,10
color object Number,rgb(100,100,1)
scale object Number,50,50,50
Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="b"
endif
if ObjectType$="light"
make object cube Number,10
color object Number,rgb(100,100,100)
scale object Number,20,20,20
ghost object on Number,4
Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="o"
endif
if ObjectType$="robot"
make object cube Number,10
color object Number,rgb(10,10,100)
scale object Number,20,100,20
Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="r"
endif
if ObjectType$="start"
if StartObject>0 then delete object StartObject : : Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="0"
StartObject=Number
make object cube Number,10
color object Number,rgb(10,100,10)
scale object Number,20,100,20
Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="2"
endif
if object exist(Number)
position object Number, object position x(MObject),object position y(MObject),object position z(MObject)
endif
endif
Return
DeleteObject:
Number=FullZone(object position x(MObject),object position y(MObject),object position z(MObject))
if Number>0 and Number=MObject=0 then delete object Number : Level$(int(object position x(MObject)/10),int(object position z(MObject)/10))="0"
Return
function gettexture(t)
set current bitmap 2
cls
for x1 = 0 to 7
for y1 = 0 to 7
x=x1*4
y=y1*4
co$ = mid$(brick$(y1),x1+1)
if co$ = "0" then color = rgb(200,200,200)
if co$ = "1" then color = rgb(64,64,64)
if co$ = "2" then color = rgb(0,255,0)
if co$ = "3" then color = rgb(0,0,0)
if co$ = "b" then color = rgb(0,0,0)
if co$ = "6" then color = rgb(128,128,128)
if co$ = "7" then color = rgb(88,88,88)
if co$ = "8" then color = rgb(64,64,64)
if co$ = "9" then color = rgb(32,32,32)
if co$ = "c" then color = rgb(60,80,128)
if co$ = "r" then color = rgb(255,0,0)
if co$ = "m" then color = rgb(200,0,0)
if co$ = "n" then color = rgb(100,0,0)
if co$ = "o" then color = rgb(64,0,0)
for x2 = x to x+3
for y2 = y to y+3
ink color,0
dot x2+1,y2+1,color
next y2
next x2
next y1
next x1
if t = 9 then blur bitmap 2,3
get image t,1,1,32,32
set current bitmap 0
endfunction
function makelevel()
obj = 1000
make object box 99,1500,100,1000
position object 99,750,-50,500
texture object 99,10
scale object texture 99,30,30
make object box 98,1500,100,1000
position object 98,750,150,500
texture object 98,10
scale object texture 98,30,30
for x = 0 to 14
for y = 0 to 14
co$ = Level$(x,y)
if co$ = "1"
make object cube obj,100 : TopObject=obj
texture object obj,1
position object obj,50+x*100,50,50+y*100
scale object texture obj,2,2
`set bump mapping on obj,1
obj = obj + 1
make object box obj,110,10,110 : TopObject=obj
position object obj,50+x*100,5,50+y*100
color object obj,rgb(0,0,255)
`set object light obj,0
set object specular obj,0
obj = obj + 1
make object box obj,110,10,110 : TopObject=obj
position object obj,50+x*100,95,50+y*100
color object obj,rgb(0,0,255)
`set object light obj,0
set object specular obj,0
obj = obj + 1
endif
if co$="2"
position camera 50+x*100,50,50+y*100
endif
if co$="o"
li = li + 1
make light li
position light li,50+x*100,90,50+y*100
set light range li,400
make object plain obj,300,300 : TopObject=obj
ghost object on obj
texture object obj,9
set object light obj,0
xrotate object obj,90
position object obj,50+x*100,95,50+y*100
set object fog obj,0
obj= obj+1
make object plain obj,300,300 : TopObject=obj
ghost object on obj
texture object obj,9
set object light obj,0
set object fog obj,0
xrotate object obj,90
position object obj,50+x*100,2,50+y*100
obj= obj+1
make object box obj,10,10,20 : TopObject=obj
set object light obj,0
set object fog obj,0
position object obj,50+x*100,95,50+y*100
obj = obj + 1
endif
if co$="b"
make object cube obj,40 : TopObject=obj
position object obj,50+x*100,20,50+y*100
texture object obj,7
obj = obj +1
endif
if co$="r"
make object plain obj,40,60 : TopObject=obj
position object obj,50+x*100,30,50+y*100
texture object obj,111
set object transparency obj,1
set object cull obj,0
set object light obj,0
numrobots = numrobots + 1
r(numrobots).f = 110
r(numrobots).obj = obj
obj = obj +1
endif
next y
next x
endfunction
`Level
function levelcollide(x,y,z) as integer
col=0
for i = 1000 to obj-1
x1 = object position x(i)-object size x(i)/2
x2 = object position x(i)+object size x(i)/2
y1 = object position y(i)-object size y(i)/2
y2 = object position y(i)+object size y(i)/2
z1 = object position z(i)-object size z(i)/2
z2 = object position z(i)+object size z(i)/2
if x>x1
if x<x2
if y>y1
if y<y2
if z>z1
if z<z2
exitfunction 1
endif
endif
endif
endif
endif
endif
next i
endfunction 0
function dorobots()
for i = 1 to numrobots
r(i).f = r(i).f + 1 : if r(i).f>118 then r(i).f = 111
texture object r(i).obj, r(i).f
point object r(i).obj, camera position x(),object position y(r(i).obj),camera position z()
x= object position x(r(i).obj):z = object position z(r(i).obj)
if timer() - r(i).ti >2000
cxd = abs(camera position x()-x)
czd = abs(camera position z()-z)
if cxd>czd
r(i).dx = -(camera position x()<x)+(camera position x()>x)
r(i).dz = 0
else
r(i).dz = -(camera position z()<z)+(camera position z()>z)
r(i).dx=0
endif
r(i).ti = timer()
endif
c = levelcollide(x+r(i).dx*10,5,z+r(i).dz*10)
if c= 0
position object r(i).obj,x+r(i).dx*5,30,z+r(i).dz*5
else
r(i).dx = - r(i).dx
r(i).dz = - r(i).dz
position object r(i).obj,x+r(i).dx*10,30,z+r(i).dz*10
endif
next i
endfunction
function explode(x,y,z,num)
for i = 1 to num
for i2 = 1 to 100
ob = 200+ i2
if object visible(ob) = 0
show object ob
scale object ob,100,100,100
p(i2).life = 100
p(i2).dx = rnd(8)-4
p(i2).dy = rnd(8)-4
p(i2).dz = rnd(8)-4
position object ob, x,y,z
goto extfr
endif
next i2
extfr:
next i
endfunction
function particles()
for i = 1 to 100
ob = 200+i
if object visible(ob)
position object ob,object position x(ob)+p(i).dx,object position y(ob)+p(i).dy,object position z(ob)+p(i).dz
p(i).life = p(i).life -10
scale object ob,p(i).life,p(i).life,p(i).life
p(i).dy = p(i).dy-1
point object ob, camera position x(),camera position y(), camera position z()
if p(i).life <= 0 then hide object ob
endif
next i
endfunction
function getstime()
t1# = timer() - stimer
stimer = timer()
s = t1#/20.0
endfunction
function makefloortexture()
set current bitmap 2
cls
for i = 0 to 1000
c=rnd(128)
ink rgb(c,c,c),0
dot rnd(32),rnd(32)
next i
get image 10,1,1,32,32
set current bitmap 0
endfunction
`FUNCTIONS
function freeobject()
do
inc a
if object exist(a)=0 then exit
loop
if a>TopObject then TopObject=a
endfunction a
Function FreeZone(x,y,z)
FreeZone=1
for a = 1 to TopObject
if a=MObject=0
if object exist(a)
if collide(Mobject,a,GridSize,GridSize,GridSize,0,TopObject)=1 then FreeZone=0
endif
endif
next a
Endfunction FreeZone
Function FullZone(x,y,z)
FullZone=1
for a = 1 to TopObject
if a=MObject=0
if object exist(a)
if collide(Mobject,a,GridSize,GridSize,GridSize,0,TopObject)=1 then FullZone=a
endif
endif
next a
Endfunction FullZone
`Thanks PrestonC :)
function collide(o1,o2,objectwidth,objectdepth,objectheight,nocollide,maxobjects)
yep=0
if o1<>o2
if o2>0
if object position x(o1)<object position x(o2)+objectwidth and object position x(o1)>object position x(o2)-objectwidth
if object position z(o1)<object position z(o2)+objectdepth and object position z(o1)>object position z(o2)-objectdepth
if object position y(o1)<object position y(o2)+objectheight and object position y(o1)>object position y(o2)-objectheight
yep=1
endif
endif
endif
endif
if o2=0
for j=1 to maxobjects
if object position x(o1)<object position x(j)+objectwidth and object position x(o1)>object position x(j)-objectwidth
if object position z(o1)<object position z(j)+objectdepth and object position z(o1)>object position z(j)-objectdepth
if object position y(o1)<object position y(j)+objectheight and object position y(o1)>object position y(j)-objectheight
yep=1
if j=nocollide then yep=0
endif
endif
endif
next j
endif
endif
endfunction yep
I got drunk near the end and forgot what I was doing, but I think it still works at least once per run.
Right, back to my guinness.
You are not alone.