TV Tropes Org

Forums

Live Bloginations, an archived forum.:
Pacific makes a game in 24 hours
search forum titles
google site search
Total posts: [55]
1
 2 3

Pacific makes a game in 24 hours:

 1 Pacific, Thu, 25th Nov '10 1:27:39 PM from da beach house
Oh Yeah?
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.

 2 Ajbcool, Thu, 25th Nov '10 1:56:08 PM from Here, obviously.
The Omnibot
Balance.

Change.

Omniverse.

Omnisource.
 3 Wicked 223, Thu, 25th Nov '10 1:57:12 PM from Death Star in the forest
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!
 4 Pacific, Thu, 25th Nov '10 1:57:46 PM from da beach house
Oh Yeah?
This is exactly what I mean. Nice words.

 5 Jack Mackerel, Thu, 25th Nov '10 1:59:57 PM from SOME OBSCURE MEDIA
Are you making an original game, or do you not mind making a total conversion Game Mod?
 6 Pacific, Thu, 25th Nov '10 2:05:06 PM from da beach house
Oh Yeah?
I wouldn't have time. It'll be an original game. Although it'll obviously have to be pocket-size.

I demand that there be a teddy bear robot that shoots lasers from its eyes.
 
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
 
 9 Pacific, Fri, 26th Nov '10 11:04:10 AM from da beach house
Oh Yeah?
What genre should I make it?

 10 Wicked 223, Fri, 26th Nov '10 11:07:10 AM from Death Star in the forest
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!
 11 Tzetze, Fri, 26th Nov '10 11:10:14 AM from a converted church in Venice, Italy
DUMB
Programming Game. Or less ambitiously, platformers are nice.
 12 Pacific, Fri, 26th Nov '10 12:11:30 PM from da beach house
Oh Yeah?
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.

 13 Ralphrius, Fri, 26th Nov '10 1:46:11 PM from Neo-Holland
 14 Pacific, Fri, 26th Nov '10 3:05:45 PM from da beach house
Oh Yeah?
Where should it be set?

 15 balrog 1911, Fri, 26th Nov '10 3:07:18 PM from Far beneath the mountain
Valarauka
23rd-century Australia. Bonus points for kangaroo enemies.

 16 Wicked 223, Fri, 26th Nov '10 4:42:32 PM from Death Star in the forest
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!
 17 Psyga 315, Fri, 26th Nov '10 4:56:09 PM from Dungeons & Dragons No Sekai Relationship Status: watch?v=dQw4w9WgXcQ
Nanako The Narcface
Hell itself.
"An MMORPG without a logout button? That's a bold decision, man!"
 18 Pacific, Sat, 27th Nov '10 3:14:28 AM from da beach house
Oh Yeah?
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

 19 Pacific, Sat, 27th Nov '10 4:39:26 AM from da beach house
Oh Yeah?
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
bx=x
by=y
End Function

Function updatebullets()
For b.bullet=Each bullet
 bx=bx-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 ox, oy, 80, 80
Next
For b.bullet=Each bullet
 Rect bx, by, 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
ex=x
ey=y
End Function

Function updateexplosions()
For e.explosion=Each explosion
esize=esize+1
If esize>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 ex-(esize/2), ey-(esize/2), esize, esize
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
 bx=bx-2
 For o.omnisource=Each omnisource
  If Rects Overlap(bx, by, 23, 23, ox, oy, 80, 80)
   newexplosion(bx+12, by+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 ox, oy, 80, 80
Next
For b.bullet=Each bullet
 Color 100, 255, 255
 Rect bx, by, 23, 23
Next
For e.explosion=Each explosion
 Color 255, 242, 0
 Oval ex-(esize/2), ey-(esize/2), esize, esize
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.

 20 Pacific, Sat, 27th Nov '10 5:35:45 AM from da beach house
Oh Yeah?
I need to make some objects that work contextualy with what people have suggested. More steampunk stuff would work... Airships or something.

 21 BlackWolfe, Sat, 27th Nov '10 5:41:39 AM from Lost in Austin
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.
 22 Pacific, Sat, 27th Nov '10 5:51:33 AM from da beach house
Oh Yeah?
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.

 23 Pacific, Sat, 27th Nov '10 6:21:47 AM from da beach house
Oh Yeah?
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
ox=x
oy=y
ohp=100
End Function

Now it will.

Function updateexplosions()
For e.explosion=Each explosion
esize=esize+1
For o.omnisource=Each omnisource
 If Rects Overlap(ex-(esize/2), ey-(esize/2), esize, esize, ox, oy, 80, 80)
  ohp=ohp-1
 End If
Next
If esize>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 ohp=<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 ox, oy, 80, 80
 Color 0, 0, 0
 Text ox+28, oy+40, ohp
Next

I crank the amount of hp to 5000.

o.omnisource=New omnisource
ox=x
oy=y
ohp=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 bdir=0
  bx=bx-2
 Else
  bx=bx+2
 End If
 If bx<0 Then bdir=1
 If bx>1028 Then bdir=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
nx=x
ny=y
End Function

No idea what this thing is going to do.

In draw():

For n.ninja=Each ninja
 Color 50, 50, 50
 Rect bx, by, 30, 30
Next

 24 Psyga 315, Sat, 27th Nov '10 7:13:12 AM from Dungeons & Dragons No Sekai Relationship Status: watch?v=dQw4w9WgXcQ
Nanako The Narcface
What should we call this game? Omnisource?
"An MMORPG without a logout button? That's a bold decision, man!"
 25 Pacific, Sat, 27th Nov '10 8:12:23 AM from da beach house
Oh Yeah?
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
fx=x
fy=y
flife=30
fdir=dir
End Function

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

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

Total posts: 55
1
 2 3


TV Tropes by TV Tropes Foundation, LLC is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
Permissions beyond the scope of this license may be available from thestaff@tvtropes.org.
Privacy Policy