Follow TV Tropes

Following

Pacific makes a game in 24 hours

Go To

Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#1: Nov 25th 2010 at 1:27:39 PM

I'm going to try this out. No doubt it will be very bad, but I want to do something new and get feedback etc.

I'll start tommorrow or Saturday depending entirely on what day I would rather do it, because this shouldn't become a chore. I'm posting in advance, so you tropers can give me some ideas/words to base it around. If there's too many (there won't be) I might not use all of them.

I won't take suggestions on a language to use, because I fear change.

Ajbcool The Omnibot from Here, obviously. Since: Sep, 2009
The Omnibot
Wicked223 from Death Star in the forest Since: Apr, 2009
#3: Nov 25th 2010 at 1:57:12 PM

Reverance.

Relief.

This is probably not what you meant, is it?

You can't even write racist abuse in excrement on somebody's car without the politically correct brigade jumping down your throat!
Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#4: Nov 25th 2010 at 1:57:46 PM

This is exactly what I mean. Nice words.

JackMackerel from SOME OBSCURE MEDIA Since: Jul, 2010
#5: Nov 25th 2010 at 1:59:57 PM

Are you making an original game, or do you not mind making a total conversion Game Mod?

Half-Life: Dual Nature, a crossover story of reasonably sized proportions.
Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#6: Nov 25th 2010 at 2:05:06 PM

I wouldn't have time. It'll be an original game. Although it'll obviously have to be pocket-size.

EnglishIvy Since: Aug, 2011
#7: Nov 25th 2010 at 11:18:18 PM

I demand that there be a teddy bear robot that shoots lasers from its eyes.

Charlatan Since: Mar, 2011
#8: Nov 25th 2010 at 11:21:05 PM

I demand that there be a teddy bear robot that shoots flaming ninjas from its three eyes, and that the ninjas shoot laser shuriken out of their mouth whilst dual-wielding chainsaw katanas.

I fixed it for you. grin

Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#9: Nov 26th 2010 at 11:04:10 AM

What genre should I make it?

Wicked223 from Death Star in the forest Since: Apr, 2009
#10: Nov 26th 2010 at 11:07:10 AM

Fantasy action-puzzle platformer-shooter with RPG Elements.

You can't even write racist abuse in excrement on somebody's car without the politically correct brigade jumping down your throat!
Tzetze DUMB from a converted church in Venice, Italy Since: Jan, 2001
Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#12: Nov 26th 2010 at 12:11:30 PM

In 24 hours?

I've never done either of those genres (But that doesn't matter, I don't want to stay in my comfort zone).

As for the other things people suggested, I've thought of a somewhat cheating way to get in even the outlandish suggestions. I'm going to start tommorrow, because I wanted to do something else today. (And it gives more time to suggest things)

Seriously, suggest as much as you want. More is better.

Ralphrius Unwinning Ranger from Neo-Holland Since: May, 2010
Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#14: Nov 26th 2010 at 3:05:45 PM

Where should it be set?

balrog1911 Since: Dec, 2009
#15: Nov 26th 2010 at 3:07:18 PM

23rd-century Australia. Bonus points for kangaroo enemies.

Wicked223 from Death Star in the forest Since: Apr, 2009
#16: Nov 26th 2010 at 4:42:32 PM

It should totally have a Steampunk setting, just for the hell of it.

You can't even write racist abuse in excrement on somebody's car without the politically correct brigade jumping down your throat!
Psyga315 Since: Jan, 2001
Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#18: Nov 27th 2010 at 3:14:28 AM

Right, time to get started. You can still suggest things now that I'm going (in fact, now that there's something here, it might be easier to think of ideas)

This is Blitz Basic. Have to set up graphics first so I can draw on the screen, I'll explain this later if you want.

Graphics 1024,768
Set Buffer Back Buffer()

I'm going to disregard all suggestions for settings unless I need one later. I'm going to try making a programming game because it's easier. (I actually might be able to complete it in a day)

I was thinking about what to do last night, and I have a sort of idea. The only programming game I've heard of is Conway's Game of life, and maybe I could make a ripoff thing like that, but with objects instead of pixels? I don't know. Just the idea of putting a load of objects in a room and watching them react with eachother. Maybe they could accomplish a goal from it or something.

First we need some freakin'... Objects, let's get some objects up in here

Ajbcool said "Omnisource", so I'll make an object called an omnisource. No idea what it will do yet.

Type omnisource
 Field x,y
End Type

Function newomnisource(x,y)
o.omnisource=New omnisource
ox=x
oy=y
End Function

All it has right now is an x,y location. I've given it a constructor function here so I can make one quickly. It's best to make a constructor for all types (types are "structs" in C and every other language ever, I'm told. If not, I'm sure Tzetze will correct me.).

In a 2D game, it's best to draw everything in the same freaking function, so you can control the order it's drawn (right now there's only one thing to draw, but I'm still doing it early)

Function draw()
For o.omnisource=Each omnisource
 Oval ox,oy,80,80
Next
End Function

The reason it's in a loop is so that it takes all future omnisources into account.

Now let's toss it all into a loop, so something actually happens.

While Not Key Hit(1)
Cls
draw()
Flip
Wend

End

Cls clears the backbuffer, draw draws onto the backbuffer (which I set as the main drawing buffer at the top) and flip draws the contents of the backbuffer onto the frontbuffer. The loop finishes when you hit key 1 (esc) and then hits the "end" function which ends the program.

That's not important though, these are just the basics that need to be out of the way before I can get going.

There is no omnisource on the screen yet, so now would be a good time to put one in.

I put this after the draw() function:

Function buildlevel()
newomnisource(100,100)
End Function
buildlevel()

This creates an omnisource. Putting all the objects I build into one function will be handy later on, believe me.

There it is, at location 100,100.

I think I'll settle on an idea before going any further- the best idea I have is: on the screen will be several omnisources, and you have to destroy them all by placing a certain number of objects (which presumably cost money)- there could also be omnisources you have to try and protect. Once you set all the objects, you have to sit back and watch as they react with eachother.

I'm going to need to build the objects in a way to get them to touch/react/behave in interesting ways so you need to think about what you're putting down.

edited 27th Nov '10 3:15:20 AM by Pacific

Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#19: Nov 27th 2010 at 4:39:26 AM

The first object I'm going to do is a bullet. A bullet travels left, until it hits something and explodes.

Type bullet
 Field x,y
End Type

Function newbullet(x,y)
b.bullet=New bullet
b\x=x
b\y=y
End Function

Function updatebullets()
For b.bullet=Each bullet
 b\x=b\x-2
Next
End Function

updatebullets() is called in the loop, to move them all left every time the game updates.

While Not Key Hit(1)
Cls
updatebullets()
draw()
Flip
Wend

It also needs to be drawn. It will be a rectangle for now.

Function draw()
For o.omnisource=Each omnisource
 Oval o\x,o\y,80,80
Next
For b.bullet=Each bullet
 Rect b\x,b\y,23,23
Next
End Function

Now to put one in. I'll put it opposite the omnisource so it collides.

Function buildlevel()
newomnisource(100,100)
newbullet(400,120)
End Function
buildlevel()

The bullet travels casually across the screen. This... Doesn't really come across in a screenshot. I'll put up more screenshots when it becomes visually interesting so as not to waste time.

Time for explosions.

(let's go a little faster)

Type explosion
 Field x,y
 Field size
End Type

Function newexplosion(x,y)
e.explosion=New explosion
e\x=x
e\y=y
End Function

Function updateexplosions()
For e.explosion=Each explosion
e\size=e\size+1
If e\size>60 Then Delete e
Next
End Function

The explosion increases in size, until it hits its size cap, and erases itself.

In the draw function, it is drawn at the top.

For e.explosion=Each explosion
 Oval e\x-(e\size/2),e\y-(e\size/2),e\size,e\size
Next

It's drawn so it's centred, which is why size/2 (its radius) is subtracted from each location.

I'll put one in the level to see if it works.

Function buildlevel()
newomnisource(100,100)
newbullet(400,120)
newexplosion(300,300)
End Function
buildlevel()

And actually call the update function:

While Not Key Hit(1)
Cls
updatebullets()
updateexplosions()
draw()
Flip
Wend

I tested it and it works. Here's a picture.

The updatebullets() function now looks like this.

Function updatebullets()
Local freebullet=0
For b.bullet=Each bullet
 freebullet=0
 b\x=b\x-2
 For o.omnisource=Each omnisource
  If Rects Overlap(b\x,b\y,23,23,o\x,o\y,80,80)
   newexplosion(b\x+12,b\y+12)
   freebullet=1
  End If
 Next
 If freebullet=1 Then Delete b
Next
End Function

Essentially, when the bullet collides with the omnisource (which is, erroneously, being detected as a rectangle in this function, but I might be able to change it later- (there's no rectovaloverlap function or anything.) and an explosion is created. That local variable is needed to make sure the bullet is deleted only after everything else has happened.

It works. Everything is white though, making it a little hard to parse.

I take the explosion out of buildlevel(), because it was just for testing.

Function buildlevel()
newomnisource(100,100)
newbullet(400,120)
End Function
buildlevel()

I edit the draw() function to change everything's colours. The explosion is now yellow, and bullets blue.

Function draw()
For o.omnisource=Each omnisource
 Color 255,255,255
 Oval o\x,o\y,80,80
Next
For b.bullet=Each bullet
 Color 100,255,255
 Rect b\x,b\y,23,23
Next
For e.explosion=Each explosion
 Color 255,242,0
 Oval e\x-(e\size/2),e\y-(e\size/2),e\size,e\size
Next
End Function

There's the explosion looking nicer.

Now the first object is in, I'll set up the placement system that I mentioned. In other words, the part before the game begins, where you set everything up.

Global setup=0

While Not Key Hit(1)
Cls
Local msx=Mouse X()
Local msy=Mouse Y()
Select setup
 Case 0
  Color 255,255,255
  Rect msx,msy,10,10
 Case 1
  updatebullets()
  updateexplosions()
End Select
draw()
Flip
Wend

Simply, this cuts the loop into two loops. When the global variable "setup" is 0, you're in setting up mode. When it's 1, the game's running (in other words, everything updates as normal, since that part of the loop contains all the stuff you have already seen) Notice how everything is still drawn regardless of which loop you're in- if it wasn't we wouldn't be able to see where the omnisource was, or what we were putting down. Notice I've also put a cursor in setting up mode, so you know where you're going to place something.

I've made it so enter leaves setting up mode, and sets the game running.

 Case 0
  Color 255,255,255
  Rect msx,msy,10,10
  If Key Hit(28) Then setup=1

Clicking places a bullet (only going to place bullets for the time being, since we don't want to get too complex)

 Case 0
  Color 255,255,255
  Rect msx,msy,10,10
  If Mouse Hit(1) Then newbullet(msx-12,msy-12)
  If Key Hit(28) Then setup=1

And now we'll take away our test bullet.

Function buildlevel()
newomnisource(100,100)
End Function

I can now place bullets freely all over the map!

I back the game up at this point.

Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#20: Nov 27th 2010 at 5:35:45 AM

I need to make some objects that work contextualy with what people have suggested. More steampunk stuff would work... Airships or something.

BlackWolfe Viewer Gender Confusion? from Lost in Austin Since: Jun, 2010
#21: Nov 27th 2010 at 5:41:39 AM

Fun suggestion you can take or leave because it's pretty damn late in the game: I once came up with a concept for a steampunk jetpack. It wouldn't work in real life - but wasn't required to, it was for a pulp adventure themed MUCK - and jetpacks on video game main characters are distilled fun.

But soft! What rock through yonder window breaks? It is a brick! And Juliet is out cold.
Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#22: Nov 27th 2010 at 5:51:33 AM

It's not late at all, I've just started, and It'll be for nearly two days, since I'm not staying up all night. Jet packs: I might try that if I have time to put a playable character in here somewhere. Since I went with a programming game, I need to have lots of objects that react with one another, like chemicals.

Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#23: Nov 27th 2010 at 6:21:47 AM

The omnisource doesn't actually take any damage from the bullet yet.

Type omnisource
 Field x,y
 Field hp
End Type

Function newomnisource(x,y)
o.omnisource=New omnisource
o\x=x
o\y=y
o\hp=100
End Function

Now it will.

Function updateexplosions()
For e.explosion=Each explosion
e\size=e\size+1
For o.omnisource=Each omnisource
 If Rects Overlap(e\x-(e\size/2),e\y-(e\size/2),e\size,e\size,o\x,o\y,80,80)
  o\hp=o\hp-1
 End If
Next
If e\size>60 Then Delete e
Next
End Function

if an explosion touches an omnicore, it loses 1 point of health. But note this is for every loop the omnicore and the explosion are touching, so it'll do 60 damage at the least. (100 might not be enough health for the omnicore overall).

Also, the omnisource must delete itself when out of hp.

Function updateomnisource()
 For o.omnisource=Each omnisource
  If o\hp=<0 Then Delete o
 Next
End Function

 Case 1
  updatebullets()
  updateexplosions()
  updateomnisource()

The amount of hp is also drawn on the side.

Function draw()
For o.omnisource=Each omnisource
 Color 255,255,255
 Oval o\x,o\y,80,80
 Color 0,0,0
 Text o\x+28,o\y+40,o\hp
Next

I crank the amount of hp to 5000.

o.omnisource=New omnisource
o\x=x
o\y=y
o\hp=5000

There! Unfortunatley now it takes an immense number of bullets and explosions to finish it off. I'll balance it later.

If a bullet hits the side of the screen, it should turn around and go the other way, until it hits something.

I add the field "dir" to the bullet, and this to updatebullets()

Function updatebullets()
Local freebullet=0
For b.bullet=Each bullet
 freebullet=0
 If b\dir=0
  b\x=b\x-2
 Else
  b\x=b\x+2
 End If
 If b\x<0 Then b\dir=1
 If b\x>1028 Then b\dir=0

This has the desired effect. But it's not very interesting. I really need to put in more objects in order to create some interesting reactions.

Type ninja
 Field x,y
End Type

Function newninja(x,y)
n.ninja=New ninja
n\x=x
n\y=y
End Function

No idea what this thing is going to do.

In draw():

For n.ninja=Each ninja
 Color 50,50,50
 Rect b\x,b\y,30,30
Next

Psyga315 Since: Jan, 2001
#24: Nov 27th 2010 at 7:13:12 AM

What should we call this game? Omnisource?

Pacific Oh Yeah? from da beach house Since: Jan, 2001
Oh Yeah?
#25: Nov 27th 2010 at 8:12:23 AM

Tried making some fire. When an explosion deletes, it creates some new fire where it was.

Type fire
 Field x,y
 Field life
End Type

Function newfire(x,y)
f.fire=New fire
fx=x
fy=y
flife=30
End Function

Function updatefire()
For f.fire=Each fire
 flife=flife-1
 If flife=10 Then newfire(fx+2,fy-2)
 If flife=20 Then newfire(fx-2,fy-2)
 If flife<0 Then Delete f
Next
End Function

It was going to spread or something, but this ended up causing too much of it, and it looked more like a snake than fire. I'll see if I can get it to spread more naturally.

Here's a revised version- this slowly crawls to the top of the screen, but looks like an image toggling backwards and forwards. I'll show you how it works in a while.

Type fire
 Field x,y
 Field life
 Field dir
End Type

Function newfire(x,y,dir)
f.fire=New fire
f\x=x
f\y=y
f\life=30
f\dir=dir
End Function

Function updatefire()
For f.fire=Each fire
 f\life=f\life-1
 If f\life=20
  If f\dir=1
   newfire(f\x+5,f\y-5,0)
  Else
   newfire(f\x-5,f\y-5,1)
  End If
 End If
 If f\life<0 Then Delete f
Next
End Function

edited 27th Nov '10 8:22:55 AM by Pacific


Total posts: 55
Top