View Single Post
Cpp Cpp's Avatar

JCF Member

Joined: Mar 2001

Posts: 1,557

Cpp is doing well so far

Jun 30, 2009, 09:52 AM
Cpp is offline
You mean something like:
Code:
void OnGameTick() {
	...
	
	if ((player[0].x > 40 && player[0].x < 50) && (player[0].y > 25 && player[0].y < 30)) {
		if (music.filename != "cooba.mp3") music.play("cooba.mp3");
	}
	
	...
}
When player enters the zone [[40,25][50,30]], a new music starts to play. Although I'm guessing that the whole thing would be better off using an object oriented approach.
__________________
<a href="http://nmap.org/"><img border="0" alt="Nmap Security Scanner" src="http://images.insecure.org/nmap/images/prop/nmap_bnr_matrix_pfos.gif"/></a>