Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [SpeedHack] The Cannon Ball that Would Not Stop

This thread is locked; no one can reply to it. rss feed Print
 1   2 
[SpeedHack] The Cannon Ball that Would Not Stop
Bruce Perry
Member #270
April 2000

Introducing my SpeedHack Entry: The Cannon Ball that Would Not Stop!

{"name":"10410-1","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/9\/a9047db799eaadac85cc39cf9b5c5ce0.png","w":648,"h":428,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/a\/9\/a9047db799eaadac85cc39cf9b5c5ce0"}10410-1 {"name":"10353-1","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/5\/d5450f94ae1b61f337a61b56de15ee81.png","w":648,"h":428,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/d\/5\/d5450f94ae1b61f337a61b56de15ee81"}10353-1

It's a little bit like Nanaca Crash, but involving less chance, more skill and some horribly hacked comedy physics. It also has insane bespoke music ;D

Blog

There's one known bug: your distance is supposed to contribute to your score, but only the rightmost three digits are used. To fix it, change

static int getscore() {
  return ballx/metre+numpeople*200+numwalls*50;
}

to

static int getscore() {
  return distancesofar/10+ballx/metre+numpeople*200+numwalls*50;
}

SpeedHack version: Source-only download | Download with static Windows binary
Fixed version: Source-only download | Download with static Windows binary

I hope you all enjoy it :)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Simon Parzer
Member #3,330
March 2003
avatar

Let's see.. it's a very simple game, but you made something out of it. I like the music and the wall physics.
And it's a great feeling to see the cannon ball knocking over innocent people.

Neil Walker
Member #210
April 2000
avatar

Good to see somebody implemented widescreen (even if it's slightly flawed by just just chopping the top/bottom off and leaving the resolution the same!). Very good though :)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Simon Parzer
Member #3,330
March 2003
avatar

Quote:

Good to see somebody implemented widescreen (even if it's slightly flawed by just chopping the top/bottom off!).

Yeah, good to see, but actually the widescreen didn't work for me in this game (1280x800 laptop display, doesn't support whatever resolution the game uses in widescreen).

Bruce Perry
Member #270
April 2000

What? :-/

The widescreen mode is 640x400, which I thought was pretty well supported. I suppose you could hack the source to set 1280x800 and do a stretch_blit(), if you want to bother - but I'm amazed it can't just set 640x400. :-/

Thanks for the good comments :) Do play it a bit more and discover the magnet and its effect if you haven't already. (It does do more than look nice, given the right conditions ;) )

By the way, Neil, I didn't chop anything off ;)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

kazzmir
Member #1,786
December 2001
avatar

I feel like this is a pretty good score. I hit the tops of a lot of walls and bounced pretty high

{"name":"cannon.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/5\/95925b753d809f613f97f721b8920a40.png","w":640,"h":480,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/9\/5\/95925b753d809f613f97f721b8920a40"}cannon.png

Neil Walker
Member #210
April 2000
avatar

Quote:

The widescreen mode is 640x400

Ah, my mistake then, I was expecting widescreen to be a mode wider than the normal mode :)

btw, I like the mario party style curtains, how did you achieve that?

Once I realised you can press the space bar to jump I got to about 1800m and found it too easy, maybe you should have left out the jump option ;)

Neil.
MAME Cabinet Blog / AXL LIBRARY (a games framework) / AXL Documentation and Tutorial

wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie

Bruce Perry
Member #270
April 2000

The curtains are a bit like a mesh of points where each column of surfaces in the mesh is drawn as one unit using Allegro's polygon() function. The bottom row of points stay at the bottom of the screen and slide out, while the other points form into a series of parabolae, one for each column. See the drawcurtains() function. :)

The implementation calculates a lot of stuff repeatedly, but it wasn't performance-critical so I didn't feel the need to optimise it.

[EDIT]
Beat this!

{"name":"10441-1","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/8\/e85958ff23c25f693604f16685a32601.png","w":648,"h":428,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/8\/e85958ff23c25f693604f16685a32601"}10441-1

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Rodrigo Monteiro
Member #4,373
February 2004
avatar

BTW, this is my favourite so far, along with Dr. Madness.

_____________________________
a.k.a amz, a.k.a. ArchMage ZeratuL
[Aegisub] - [TINS05: Lord of the Stars] [SH05: Bunkermaster] [SH07: Fury of the Sky God] [TINS08: All Yar Base Arr Belong To Us (with codnik)] [SH09: Xtreme Programming: The Literal Game]

MelanomaSky
Member #7,805
September 2006

Great entry! Props for well-finished graphics and sound.

Neil Black
Member #7,867
October 2006
avatar

Awesome! It reminds me of the Kitten Cannon, but with better music. ;)

Kwame Alexander
Member #3,759
August 2003
avatar

I had to take this off of my work machine. It's an excellent time-waster.

I love the sound of the thug dying.

--------------------------
"Be yourself and it'll just happen," - Traditional litany against success

Bruce Perry
Member #270
April 2000

Kitten Cannon! Now that brings back memories :)

Thanks for the comments :)

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

microcat
Member #9,025
September 2007

Another awesome game as usually. Your polish objective was definitelly reached, it's one of the most polished SH games I've played so far. It's also pretty fun to play and the physics are not as unrealistic as you portray them. The graphics and music are pleasant and the the way that the tutorial was done is also very good.
Also, I guess I'll take the opportunity to say good things about your DUMB library. Thanks for DUMB! :)
Oh, and my highscore is a laughable 880 meters >:E

Bruce Perry
Member #270
April 2000

microcat, "as usual"? That implies you've seen my previous entries, but it says you only signed up to allegro.cc this month :)

But anyway, thanks :D

--
Bruce "entheh" Perry [ Web site | DUMB | Set Up Us The Bomb !!! | Balls ]
Programming should be fun. That's why I hate C and C++.
The brxybrytl has you.

Thomas Harte
Member #33
April 2000
avatar

Quote:

The widescreen mode is 640x400, which I thought was pretty well supported.

It's definitely not supported on Mac. I think 720x480 is the lowest resolution widescreen mode available in OS X, and 640x480 is the lowest resolution mode available at all.

Matthew Leverton
Supreme Loser
January 1999
avatar

I found the game more interesting after I realized I could press space to "jump." :-X

StevenVI
Member #562
July 2000
avatar

Bruce Perry said:

"as usual"? That implies you've seen my previous entries

You're so conceited! Perhaps he meant "just like all the other SH games", which in fact was an insult because some of these games really aren't that good. ;)

I just got around to playing this game. I've been playing them in alphabetical order. I actually skipped a few because I was tired of playing crummy games or games that didn't work.

I loved the music! The graphics reminded me of South Park, which I don't particularly care for. The game overall is quite fun and addictive, though. It is one of the few games which I wanted to run in fullscreen, but using Windows Vista, the palette went to something funky and gray when I tried. Kudos for having it windowed by default, though. (Everyone else take note of this, please!)

My records are as follows:
Distance: 2239.0 m
People: 25
Walls: 10
Score: 7739

(Note that all of these were from the same game.)

Excellent job, entheh!

__________________________________________________
Skoobalon Software
[ Lander! v2.5 ] [ Zonic the Hog v1.1 ] [ Raid 2 v1.0 ]

Matthew Leverton
Supreme Loser
January 1999
avatar

Quote:

but using Windows Vista, the palette went to something funky and gray when I tried

That's a common problem with full screen palettes under Vista/Allegro.

Quote:

Kudos for having it windowed by default, though. (Everyone else take note of this, please!)

While I didn't participate, I did do extensive tests on full/wide screen before coming up with the final wording. I originally wanted to require proper detection of the aspect ratio and keep the game in line with that, but it would have been a huge chore for a three day competition where there obviously is no room for testing.

Some of the games did a few things that I found were a bad thing. At least one used a forced *_FULLSCREEN. That's really not good at all, despite the resolution. Some tried to set a mode that mimicked the current aspect ratio exactly. That's not good because 1280x1024 is the only 5:4 mode that is supported; you may end up with something like 600x480 when there's no reason to just set 640x480.

The best approach to set a fullscreen (non-window) resolution would have been to use a 4:3 resolution if a 4:3 or 5:4 ratio was found, and then to stick with the native desktop resolution if a 16:9 or 16:10 ratio was found and crop and scale accordingly. A wide screen display can typically only set its native 16:9/16:10 mode along with the popular 4:3 modes (with bars).

But yeah, Ben's game was one of the few that did a good job with wide screen. My 16:10 laptop was actually able to set the wide screen mode properly.

daspore
Member #9,088
September 2007

This is definitely a great entertainer. The music really drives this game, and I especially enjoy magnet physics. However, I noticed with widescreen + fullscreen enabled, the game became very jittery.

In the way of statistics, a 'highest bounce' high score would be nice. I hit two wall tops in a row.
'Highest Bounce': 2206.4 m

Distance: 6121.6 m
People: 50
Walls: 19
Score: 17071

MiquelFire
Member #3,110
January 2003
avatar

My game (when ran fullscreen) just uses your desktop res (or it should) and adjust the ratio on it's own. The only odd thing about my game is that internally, the height is forever set to 768, and the width is based of the ratio it's running off of (which is Match Desktop, 4:3, and 16:9, which the last two (unless your desktop is already it) is only for windowed mode).

---
Febreze (and other air fresheners actually) is just below perfumes/colognes, and that's just below dead skunks in terms of smells that offend my nose.
MiquelFire.red
If anyone is of the opinion that there is no systemic racism in America, they're either blind, stupid, or racist too. ~Edgar Reynaldo

microcat
Member #9,025
September 2007

Bruce Perry said:

microcat, "as usual"? That implies you've seen my previous entries, but it says you only signed up to allegro.cc this month :)

I've been lurking for quite some time now.

kenmasters1976
Member #8,794
July 2007

Well, what can I say?, I think I hate your game.

It is... SO DAMN ADDICTIVE!!!. I just can't stop playing it.

Congratulations!, your game is AWESOME!.

My current records:
Distance: 18212.9 People: 134 Walls: 68 Score: 45012 Highest Bounce: ~2400 m Longest Distance Whitout Pressing Space: ~4000 m

My best single game:
Distance: 18212.9 People: 117 Walls: 68 Score: 45012

By the way, I love the 'magnetizer'.

Daniel McKinnon
Member #7,364
June 2006

This game was addictive, I played it for about 30 minutes and got a really high score over 6,000 points.

Good Job, I like the curtain effect ;)

CGamesPlay
Member #2,559
July 2002
avatar

Of the random SpeedHack entries that I've played, this is one of my favorites so far :)

--
Tomasu: Every time you read this: hugging!

Ryan Patterson - <http://cgamesplay.com/>

 1   2 


Go to: