Allegro.cc - Online Community

Allegro.cc Forums » The Depot » [Krampus Hack] Kings

This thread is locked; no one can reply to it. rss feed Print
[Krampus Hack] Kings
Elias
Member #358
May 2000

Kings

Oh, I suppose it is 2017 and we can finally post our games :) Here's my entry which was made for Derezo. I had a lot of fun making this!

{"name":"kings_screenshot.png","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/e\/fe6b14ae18ffc0969e4c3fa594bf46ba.png","w":1292,"h":755,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/f\/e\/fe6b14ae18ffc0969e4c3fa594bf46ba"}kings_screenshot.png
Windows .exe + source.

Story

Help three kings collect gifts in a snowy forest.

How to Play

Drag the kings with the mouse!

--
"Either help out or stop whining" - Evert

amarillion
Member #940
January 2001
avatar

Got to level 5 / 8 minutes so far. How did you generate the character graphics?

Eric Johnson
Member #14,841
January 2013
avatar

I've always enjoyed your distinct art style, Elias. This time is no exception. :)

So I made it a good way through level 5 before Caspar was left by the wayside. I like the music and sound effects. The yellow path indicators are especially neat. I look forward to delving into your code and seeing how you pulled that off!

You've made another fun game. Well done!

Elias
Member #358
May 2000

How did you generate the character graphics?

The below Lua script for example is the elephant, with some functions (like "make") implemented in C. It exports one .obj file for each frame. And I have a Blender Python script to import an .obj file and render into a picture.

I originally had planned to go 3D - but the original time constraints were quite short and when I started writing the code to display an .obj and creating VBOs and shaders I saw myself saving at least a day by letting Blender do that and just use al_draw_bitmap :)

#SelectExpand
1local pupil = function() 2 push() 3 move(0, -0.178, 0) 4 push() 5 size(0.095) 6 move(0, -1, 0) 7 make("ball") 8 pop() 9 pop() 10end 11 12local eyeball = function() 13 temp = color("white") 14 push() 15 size(0.165) 16 move(0, -1, 0) 17 make("ball") 18 pop() 19 color("black") 20 pupil() 21 color(temp) 22end 23 24local eye = function(x) 25 push() 26 move(0.1916 * x, -0.3239, 0.5355) 27 eyeball() 28 pop() 29end 30 31local tusk = function() 32 temp = color("white") 33 push() 34 size(0.09) 35 move(0, -1, 0) 36 make("ball") 37 move(0, -2, 0) 38 make("ball") 39 move(0, -2, 0) 40 make("ball") 41 move(0, -2, 0) 42 make("ball") 43 move(0, -2, 0) 44 make("ball") 45 pop() 46 color(temp) 47end 48 49local tusk = function(x) 50 push() 51 move(0.2164 * x, -0.2304, 0.1548) 52 tusk() 53 pop() 54end 55 56local nose = function() 57 push() 58 move(0, -0.3804, 0.2764) 59 push() 60 size(0.175) 61 move(0, -1, 0) 62 make("ball") 63 move(0, -2, 0) 64 make("ball") 65 move(0, -2, 0) 66 make("ball") 67 pop() 68 pop() 69end 70 71local ear = function(x) 72 push() 73 move(0.4018 * x, 0.1891, 0.6818) 74 push() 75 size(0.35) 76 move(0, 0, 1) 77 make("ball") 78 pop() 79 pop() 80end 81 82local leg = function(x, y, t) 83 push() 84 move(0.2 * x, 0.2 * y, 0.1172) 85 push() 86 size(0.15) 87 turn((1 + t) * 0.2 * y, 0, 0) 88 move(0, 0, -1) 89 make("ball") 90 move(0, 0, -2) 91 make("ball") 92 pop() 93 pop() 94end 95 96local head = function(eye) 97 push() 98 move(0, -0.6087, 0.2022) 99 push() 100 size(0.4) 101 move(0, 0, 1) 102 make("ball") 103 pop() 104 ear(1) 105 ear(-1) 106 nose() 107 tusk(1) 108 tusk(-1) 109 eye(1) 110 eye(-1) 111 pop() 112end 113 114local tail = function(t) 115 push() 116 move(0, 0.3982, 0.4376) 117 push() 118 turn(0.1 * (1 + t), 0, 0) 119 size(0.08) 120 move(0, 0, -1) 121 make("ball") 122 move(0, 0, -2) 123 make("ball") 124 move(0, 0, -2) 125 make("ball") 126 move(0, 0, -2) 127 make("ball") 128 pop() 129 pop() 130end 131 132local body = function(t, eye) 133 push() 134 move(0, 0, 0) 135 push() 136 size(0.4) 137 move(0, 0, 1) 138 make("ball") 139 pop() 140 tail(t) 141 head(eye) 142 leg(1, 1, t) 143 leg(-1, 1, t) 144 leg(1, -1, t) 145 leg(-1, -1, t) 146 pop() 147end 148 149graphics.elephant = function(t) 150 color("silver") 151 move(0, 0, 0.5) 152 body(t, eye) 153end

--
"Either help out or stop whining" - Evert

GullRaDriel
Member #3,861
September 2003
avatar

It worked fine here, I had a bit of troubles with the allegro modules when compiling. Tweaking the makefile was enough.

I enjoyed playing with it, particularly the path draw thing.

Well done Elias !

"Code is like shit - it only smells if it is not yours"
Allegro Wiki, full of examples and articles !!

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Elias
Member #358
May 2000

You did recognize it correctly - while I was searching for another carol and listening to the beginning of 100ds of christmas carol midis I came across it. I don't think I did know it before - but now I know it well hearing it countless times during play testing. (Also, the readme lists all the songs so you don't get a cookie :P)

--
"Either help out or stop whining" - Evert

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

I haven't had the chance to download any of the games yet, so I didn't find it in the readme... I just knew that was the song you were talking about. I didn't remember the title, but the words are in the title, which I did remember...

SiegeLord
Member #7,827
October 2006
avatar

This was pretty hard, I lost after level 7... I wish you could restart the levels, instead of going to the beginning of the game... what is this, NES? I really liked the complexity of the game though, it's like a more hectic version of 'the lost vikings'.

"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18
[SiegeLord's Abode][Codes]:[DAllegro5]:[RustAllegro]

Elias
Member #358
May 2000

Since I forgot to disable debugging you can actually jump to any level by pressing the key for it: 1 2 3... a b

--
"Either help out or stop whining" - Evert

Go to: