Jump to content
xisto Community
Sign in to follow this  
IcedMetal

Game (add Your Code/ideas) This is where everyone can add their...

Recommended Posts

This is the topic where everyone can add their two-bits to this game in progress. I said in my last topic that this might be a good idea so we will see how it goes. A link to that topic is here. I can't really start the code right now because I am at my grandparents house using a Mac. So if anyone wants to start it, be my guest.

Share this post


Link to post
Share on other sites

I would love an idea of mine be included in a game but the thing isI don`t know NOTHING about programming games.I still would like to contribute eventualy with some ideas allong the way if I may.So start it of and we`ll see how far it wil go.

Share this post


Link to post
Share on other sites

You know I read through these posts and those of the other thread and haven't found what the game idea is. My interest would definitely depend on what kind of game you are thinking about and of course what kind of code. I cannot understand starting a topic which invites code ideas without explaining this first.

Share this post


Link to post
Share on other sites

I made this in DarkBASIC.... It's very simple, only took a few hours but is so addictive which, at the end of the day, makes any game work, no matter how bad they are. You simply go around turning the red lit boxes green. Simple Eh?

 

~Controls~

 

UP - increase speed

Down - decrease speed

Left - I wonder (Left)

Right - Must be go back in time? (Right)

1-5 ~ Camera views

 

Sorry I can't include the media but if you like the sound of it or you understand BASIC and want to see the game then please E-mail me. It's very much work in progress. This here is a link to it at a very early stage in development. (I am called Vusay with the 'Master of Puppets' Avatar - kool!

 

Well here it is:

 

`-------This is a very BAISC gamey thingy bob intended only for newbies!

`-------This is not exactly platinum material!

 

`set up sync

sync on

sync rate 0

 

`hide annoying cursor

hide mouse

 

`variables

score#=0

speed#=0.125

time#=6000

 

`set font properties

set text font "Impact"

set text to bold

smalltext=14

bigtext=60

 

`Set up initial waypoint

waypoint#=1

 

`Set camera range

set camera range 1,100000

 

`Make a light

make light 1

 

`Make players cube

make object cube 1,2

color object 1,RGB(255,0,0)

`load object

 

`Load Images

load image "red_light.bmp",1

load image "green_light.bmp",2

 

`load crowd sounds

load sound "crowd.wav",1

loop sound 1

load sound "cheer.wav",2

load sound "scifi4.wav",5

 

`position and rotate listener

position listener object position x(1),object position y(1),object position z(1)

rotate listener object angle x(1),object angle y(1),object angle z(1)

 

`Make waypoints

for t=2 to 11

make object box t,1.5,1.5,1.5

position object t,rnd(100)+25,0,rnd(100)

texture object t,1

next t

 

`Make arrows

load image "Arrow Up.jpg",3

SPRITE 1,270,1,3

SET SPRITE 1,1,1

`scale sprite 1,50

 

load image "Arrow Down.jpg",4

SPRITE 2,270,420,4

SET SPRITE 2,1,1

`scale sprite 2,50

 

load image "Arrow Left.jpg",5

SPRITE 3,1,210,5

SET SPRITE 3,1,1

`scale sprite 3,50

 

load image "Arrow Right.jpg",6

SPRITE 4,590,210,6

SET SPRITE 4,1,1

`scale sprite 4,50

 

`Make speed dial

load image "Speed.bmp",10

SPRITE 5,1,373,10

SET SPRITE 5,1,1

`scale sprite 5,420

 

 

`load banner image

load image "banner.bmp",7

load image "bannerback.bmp",11

 

`make top wall

make object plain 12,100,5

position object 12,75,0,100

texture object 12,7

 

`make bottom wall

make object plain 13,100,5

position object 13,75,0,0

yrotate object 13,180

texture object 13,7

 

`make bottom wall crowd side

make object plain 26,100,5

position object 26,75,0,-0.2

texture object 26,11

 

`make left wall

make object plain 14,100,5

position object 14,25,0,50

yrotate object 14,270

texture object 14,7

 

`make right wall

make object plain 15,100,5

position object 15,125,0,50

yrotate object 15,90

texture object 15,7

 

`make crowd top

make object plain 16,150,40

xrotate object 16,45

position object 16,70,0,115

load image "crowd empty.bmp",9

texture object 16,9

scale object texture 16,2.5,1.25

 

`make crowd right

make object plain 17,150,40

yrotate object 17,90

fix object pivot 17

zrotate object 17,135

position object 17,135,0,50

texture object 17,9

scale object texture 17,2.5,2.5

 

`make crowd left

make object plain 18,150,40

yrotate object 18,90

fix object pivot 18

zrotate object 18,45

position object 18,15,0,50

texture object 18,9

scale object texture 18,2.5,2.5

 

`make top wall2

make object box 19,145,5,20

position object 19,75,18,135

texture object 19,7

 

`make floor

make object plain 20,400,400

xrotate object 20,90

position object 20,25,-2.5,0

load image "floor_U5_01.BMP",8

texture object 20,8

scale object texture 20,40,40

 

`make crowd top2

make object plain 21,150,40

xrotate object 21,45

position object 21,70,30,150

texture object 21,9

scale object texture 21,2.5,1.25

 

`make sky sphere

load object "cm.x",22

scale object 22,10,10,10

 

`make top collision bang

make object plain 23,10,10

position object 23,75,0,98

 

`make building right

make object box 29,250,20,20

yrotate object 29,90

fix object pivot 29

position object 29,155,8,60

load image "wall_U2_01.BMP",12

texture object 29,12

scale object texture 29,40,2

 

`make matrix

make matrix 1,100,100,1,1

position matrix 1,25,-1.9,0

load image "Matrix Floor dEMO.BMP",7

prepare matrix texture 1,7,1,1

ghost matrix on 1

 

`make matrix 2

make matrix 2,100,100,5,5

position matrix 2,25,-2,0

load image "Grass.BMP",8

prepare matrix texture 2,8,1,1

 

`load COOL music

load music "Rammstein - Bück Dich.mp3",1

`loop music 1

 

`load marshall 1

load object "H-Zombie-Idle.3DS",24

position object 24,50,-2.5,-2

scale object 24,450,450,450

yrotate object 24,180

set object speed 24,5

loop object 24

 

`load marshall 1

load object "H-Zombie-Idle.3DS",25

position object 25,80,-2.5,102

scale object 25,450,450,450

set object speed 25,5

loop object 25

 

`starting position for player

position object 1,30.9,0,4.9

 

`get initial variables

x#=object position x(1)

y#=object position y(1)+20

z#=object position z(1)

yAng#=wrapvalue(object angle y(1)+180)

 

targetX#=newxvalue(object position x(1),yAng#,15)

targetZ#=newzvalue(object position z(1)-50,yAng#,15)

targetY#=get ground height(1,targetX#,targetZ#)+10

 

camX#=475

camY#=250

camZ#=425

 

`initial camera positions

position camera 118,62.5,-100

point camera x#+50,y#+20,z#+50

 

`wait and admire scenery

`wait 5000

 

`smooth move to the players position

do

 

`count time elapsed

inc counter

if counter=120 then exit

 

`work out camera position

camX#=curvevalue(targetX#,camX#,19)

camY#=curvevalue(targetY#+20,camY#,19)

camZ#=curvevalue(targetZ#+20,camZ#,19)

 

`update camera position

position camera camX#,camY#,camZ#

point camera x#,y#,z#

 

`update listener

position listener camera position x(),camera position y(),camera position z()

rotate listener camera angle x(),camera angle y(),camera angle z()

 

`turn sync off

sync

 

`end loop

loop

 

`resent counter

counter=0

 

set text size bigtext

 

`count down

do

 

`position and rotate listener

position listener object position x(1),object position y(1),object position z(1)

rotate listener object angle x(1),object angle y(1),object angle z(1)

 

`count time elapsed

inc counter

if counter=120 then exit

 

`display count down

if counter>0 and counter<=40 then center_write(screen width()/2, (screen height()/2)-30,"3")

if counter>40 and counter<=80 then center_write(screen width()/2, (screen height()/2)-30,"2")

if counter>80 and counter<=120 then center_write(screen width()/2, (screen height()/2)-30,"1")

 

` if counter=1 then play sound 3

` if counter=40 then play sound 3

` if counter=80 then play sound 3

 

sync

 

loop

 

````````````````````````````````````````````````````````````````````````````````````````

do

 

`player variables

x#=object position x(1)

y#=object position y(1)

z#=object position z(1)

 

`print x,y,z positions for developing help

`set cursor 100,100 : print x#

`set cursor 100,140 : print y#

`set cursor 100,180 : print z#

 

`Move players box

move object 1,speed#

 

`Handle speed

if upkey()=1 and speed#<0.545 then inc speed#,0.005

if downkey()=1 and speed#>0.125 then dec speed#,0.005

 

`Print score

`set cursor 10,10 : print score#

 

`Print speed

`set cursor 10,50 : print (speed#*100)

 

`Speed Box

ink RGB(32,126,221),255

box 20,450-(speed#*100),30,450

 

ink rgb(255,255,255),rgb(255,255,255)

line 30,450-(speed#*100),30,450

line 20,450-(speed#*100),20,450

line 20,450,30,450

line 20,450-(speed#*100),30,450-(speed#*100)

 

`here we gonna print the timer

set cursor 0,0

print "Time Left : "; (time#/45)

 

`**here we gonna start the timer

time# = time#-1

 

`Now if the timer is = 0 then you lose

if time# = 0

end

endif

 

`position and rotate listener

position listener object position x(1),object position y(1),object position z(1)

rotate listener object angle x(1),object angle y(1),object angle z(1)

 

`set the camera

if camera#=0 then default_cam(id)

if camera#=1 then chase_cam(1)

if camera#=2 then crowd_cam(id)

if camera#=3 then top_cam(id)

 

`allow the player to scroll through camera

if keystate(2)=1 then camera#=0

if keystate(3)=1 then camera#=1

if keystate(4)=1 then camera#=2

if keystate(5)=1 then camera#=3

 

`Spin blocks

if spin2#=1 then turn object right 2,2

if spin3#=1 then turn object right 3,2

if spin4#=1 then turn object right 4,2

if spin5#=1 then turn object right 5,2

if spin6#=1 then turn object right 6,2

if spin7#=1 then turn object right 7,2

if spin8=1 then turn object right 8,2

if spin9=1 then turn object right 9,2

if spin10#=1 then turn object right 10,2

if spin11#=1 then turn object right 11,2

 

`Waypoint 1

if waypoint#=1

if object collision(1,2)=1

spin2#=1

play sound 5

score#=score#+100

texture object 2,2

waypoint#=2

play sound 2

endif

endif

 

`Waypoint 2

if waypoint#=2

if object collision(1,3)=1

spin3#=1

play sound 5

score#=score#+100

texture object 3,2

waypoint#=3

play sound 2

endif

endif

 

`Waypoint 3

if waypoint#=3

if object collision(1,4)=1

spin4#=1

play sound 5

score#=score#+100

texture object 4,2

waypoint#=4

play sound 2

endif

endif

 

`Waypoint 4

if waypoint#=4

if object collision(1,5)=1

spin5#=1

play sound 5

score#=score#+100

texture object 5,2

waypoint#=5

play sound 2

endif

endif

 

`Waypoint 5

if waypoint#=5

if object collision(1,6)=1

spin6#=1

play sound 5

score#=score#+100

waypoint#=6

play sound 2

texture object 6,2

endif

endif

 

`Waypoint 6

if waypoint#=6

if object collision(1,7)=1

spin7#=1

play sound 5

score#=score#+100

waypoint#=7

play sound 2

texture object 7,2

endif

endif

 

`Waypoint 7

if waypoint#=7

if object collision(1,8)=1

spin8#=1

play sound 5

score#=score#+100

waypoint#=8

play sound 2

texture object 8,2

endif

endif

 

`Waypoint 8

if waypoint#=8

if object collision(1,9)=1

spin9#=1

play sound 5

score#=score#+100

waypoint#=9

play sound 2

texture object 9,2

endif

endif

 

`Waypoint 9

if waypoint#=9

if object collision(1,10)=1

spin10#=1

play sound 5

score#=score#+100

waypoint#=10

play sound 2

texture object 10,2

endif

endif

 

`Waypoint 10

if waypoint#=10

if object collision(1,11)=1

spin11#=1

play sound 5

score#=score#+100

waypoint#=11

play sound 2

texture object 11,2

endif

endif

 

`What happens when you win

if waypoint#=11

play sound 5

texture object 11,2

play sound 2

sleep 4000

end

endif

 

`spin blocks

if hit#=0

for t=2 to 11

turn object left t,2

next t

endif

 

`turn block left/right with left/right keys

if rightkey()=1 then turn object right 1,0.8

if leftkey()=1 then turn object left 1,0.8

 

`Work out whether or not to show top arrow

if object position z(1)+5<object position z(waypoint#+1)

show sprite 1

else

hide sprite 1

endif

 

`Work out whether or not to show bottom arrow

if object position z(1)-5>object position z(waypoint#+1)

show sprite 2

else

hide sprite 2

endif

 

`Work out whether or not to show left arrow

if object position x(1)-5>object position x(waypoint#+1)

show sprite 3

else

hide sprite 3

endif

 

`Work out whether or not to show right arrow

if object position x(1)+5<object position x(waypoint#+1)

show sprite 4

else

hide sprite 4

endif

 

`If you hit the top wall

if object collision(1,12)=1

position object 1,object position x(1),object position y(1),object position z(1)-0.5

position object 23,object position x(1),0,98

if object angle y(1)<180 then turn object right 1,50

if object angle y(1)=>180 then turn object left 1,50

show object 23

else

hide object 23

endif

 

`Refresh

sync

 

loop

``````````````````````````````````````````````````````````````````````````````````

sync off

 

`---------------------------------------------

`write text to screen with a border (centered)

`---------------------------------------------

function center_write(x,y,string$)

 

ink rgb(255,255,255),0

 

`draw outline

center text x+1,y+1,string$

center text x-1,y-1,string$

center text x+1,y-1,string$

center text x-1,y+1,string$

 

ink RGB(0,128,255),0

 

`draw actual letter/number

center text x,y,string$

 

endfunction

 

`---------

`chase cam

`---------

function chase_cam(id)

 

`work out the angle of the object being chased

yAng#=wrapvalue(object angle y(id)+180)

 

`grab the cameras current position

xPos#=object position x(id)

yPos#=object position y(id)

zPos#=object position z(id)

 

`other variables

camDist=15

camHeight=3

 

`work out new position

xCamPos#=newxvalue(xPos#,yAng#,camDist)

zCamPos#=newZvalue(zPos#,yAng#,camDist)

 

`camera collision

if xCamPos#>499 then xCamPos#=499

if zCamPos#>499 then zCamPos#=499

if xCamPos#<1 then XCamPos#=1

if zCamPos#<1 then zCamPos#=1

 

`work out camera height

yCamPos#=get ground height(1,xCamPos#,zCamPos#)+camHeight

if yCamPos#<yPos#+camHeight then yCamPos#=yPos#+camHeight

 

xCamPos#=curvevalue(xCamPos#,camera position x(),4)

yCamPos#=curvevalue(yCamPos#,camera position y(),4)

zCamPos#=curvevalue(zCamPos#,camera position z(),4)

 

`update camera position

position camera xCamPos#,yCamPos#,zCamPos#

point camera xPos#,yPos#+camHeight,zPos#

 

endfunction

 

 

`---------

`default cam

`---------

function default_cam(id)

 

 

position camera object position x(1),object position y(1)+20,object position z(1)-50

point camera object position x(1),object position y(1),object position z(1)

 

endfunction

 

`---------

`crowd cam

`---------

function crowd_cam(id)

 

 

position camera 10.5,15,89

point camera object position x(1),object position y(1),object position z(1)

 

endfunction

 

`---------

`top down cam

`---------

function top_cam(id)

 

 

position camera 50,100,50

point camera object position x(1),object position y(1),object position z(1)

 

endfunction

 

I hope I'm allowed to do this. I'm new here so please tell me if I'm not. Thanks.

Share this post


Link to post
Share on other sites

Thank you. You understand the word anything. I would try it out but I do not have dark basic. But this is what this topic is for. But, one suggestion for next time. Use the BBCode

your code here
Thx!
Keep it up guys. I'll post some of my stuff.

Uhh, woops. I lost all my Blitz stuff when I reinstalled Windows. I guess when I learn C++ I'll post some stuff.

Share this post


Link to post
Share on other sites

No Problem. I'll use that BBCode next time. Sorry. Just one question. What is Blitz like? I was thinking of getting it. It looks cool, and seems very similar to DarkBASIC in coding.

Share this post


Link to post
Share on other sites

I looked at DarkBasic and they seem very similar. Blitz to me was very easy to learn and had enormous potential. You could do basically anything with it. I just wish I had saved the files that I had been working on. I had a battle engine going and a few other things. So yes Blitz is a good buy.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.