Game Development Community

Pong in Blockland!

by Eric Hartman · 02/12/2008 (3:07 am) · 6 comments

This weekend, I made pong in-game using the event system in the Blockland v9 Beta.

Video:
badspot.us/dumb%5Cmisc%5CBlockland_Pong_youtube.JPG

#1
02/12/2008 (3:54 am)
Nice :)
So does that mean building your own simple games or is this a mini game that can be joined in game?

looks cool..

TomFeni
#2
02/12/2008 (8:28 am)
Tell us more about the event system please Eric, I'm always interested in hearing how others implement thier engine architecture.
#3
02/12/2008 (10:34 pm)
Very awesome. I especially like the red buzzer at the end and how its lighting reflects on the player avatar when it goes off. Nice work.
#4
02/13/2008 (12:25 am)
Quality! :D
#5
02/13/2008 (6:30 pm)
@Tom: It means that you can build a device out of bricks that is, in fact, a pong game. You walk up to it and push buttons on it to play it.

The event system works via a registered list of input and output events associated with each object class. For this iteration, the only thing that can take input events is the brick class. So the input events for bricks are things like onPlayerTouch, onProjectileHit, onActivate (player clicking it), etc. Then for each of those input events, there is a list of potential targets for outputs. For example, the onPlayerTouch input event has the player, the client who owns that player, and the brick that was touched all as potential targets. Then once you choose a target, you can choose to fire any output event that is associated with that target's class. For example the player class has output events like setVelocity, damage, setScale, respawn, etc.

So if you want to make a jump pad say, you select your brick and say onPlayerTouch->Player->addVelocity 0 0 10
If you want a collapsing bridge you say OnPlayerTouch->self (thats the brick you touched)-> fakeKill 5. The brick will break on contact and respawn 5 seconds later. You can also add a delay in there for a more interesting effect.

There's a bunch of stuff you can do and I'll probably have more detailed videos when I get closer to pushing this update out.
#6
02/13/2008 (6:32 pm)
Heartwarming