Page 2 of 2

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Sun May 04, 2014 6:00 pm
by petri
Neikun wrote:Just started playing the Monastery. Sancsaron is kill stealing everyone! haha
Hehe, he's a badass! Please let me know what you think about the game when you have played some more!

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Sun May 04, 2014 10:29 pm
by JohnWordsworth
@petri: That's great advice. I'll probably give the next one a go and will definitely gear up for a tool-chain that can publish to the web. Did you consider using emscripten to build your C++/Lua version for the web? I've got Lua working in a browser via asm.js thanks to emscripten and it's pretty cool. I know SDL is supported too, but not sure about SDL_image and SDL_mixer.

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Mon May 05, 2014 9:14 am
by Sol_HSA
Emscripten has built-in sdl_mixer support, at least.. quite probably sdl_image too.

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Mon May 05, 2014 11:12 am
by petri
I considered using emscripten but I ended up rewriting the game in javascript, mostly for the learning experience (yay, my first javascript program!). The lack of coroutines, strange variable scoping, and trying to squeeze program flow into callbacks made me appreciate Lua even more :)

E.g. I don't know how the following can be expressed cleanly in javascript:

Code: Select all

messagePrint("Blablabla")  -- slowly prints a message to screen
waitKey()
messagePrint("blablabla")
waitKey()
encounter("small_room", "rat", 5) -- start an encounter with rats
messagePrint("You won!")

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Tue May 06, 2014 8:27 pm
by JKos
Great games, both of them, for a 48 hours effort. I also loved PoR, Secret of The Silver Blades etc. so was immediately at home when I started The Monastery. If someone someday makes a game similar than classic SSI Gold Box games, with a slightly updated graphics, UI and game mechanics I would definitely buy it.

I have some experience in JavaScript and you really can't stop the code and wait for key press, so your callback stack-solution was pretty cool and innovative (for me at least).
I have also started to develop a simple turn based strategy game and it was surprisingly tricky, with JavaScript you have to think a bit differently.

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Wed May 07, 2014 11:31 pm
by JKos
I couldn't put his away from my mind and created a simple example which demonstrates how it's possible to implement waitKey with javascript. Of course it uses callbacks, because it's the only possible way to do it and that forces you to split your code to another function every time you call waitKey, but I think it's still readable.

Code: Select all

<!DOCTYPE html>
<html><head></head>
<body>
    <script> 
var keyDownCallback = function(){};
var keyPressed = false;	

window.addEventListener('keydown',function(event){
	if (keyPressed) {
		keyPressed = false;
		keyDownCallback(event);
	}
});

function waitKey(callback){
	keyPressed = true;
	keyDownCallback = callback
}

function showMessage(msg,callback){
	//print your message slowly here
	console.log(msg)
	if (callback){
		callback();
	}
}

//Synchronous game flow starts

function start(){	
	showMessage('Wait',firstPhase)
}

function firstPhase(){
	waitKey(secondPhase)	
}

function secondPhase(){
	showMessage('Continue. Blablaba',function(){waitKey(thirdPhase)})
}
	
function thirdPhase(){
	showMessage('Third phase')
}
	
function end(){}
	
start()
	</script>
</body>
</html>
Yeah, JavaScript sucks in many cases, especially in turn based game-development :)

Re: Ludum Dare: The Monastery & Bathyscape11

Posted: Sat Aug 23, 2014 12:03 pm
by SeyProdumen
I just had my first "play-through" (well...) and reached the undead monks - total party kill. :mrgreen: