FlashPunk Forums

September 02, 2010 *
News:
 



Pages: [1] 2
  Print  
Author Topic: Freedom Bridge (open source)  (Read 1039 times)
JordanMagnuson
....................
*
Posts: 34



View Profile WWW Email
« on: May 30, 2010 »

Basically, a very small creation about Freedom Bridge, in Korea (ported from Game Maker). Takes about two minutes to play through. Not a game, so if you find things that aren't games pretentious, be forewarned Smiley.

Game's home page: here.

Play here.

Get source here.

My first effort in FP, and I rushed it, so I'm afraid the code aint too pretty Embarrassed.

The game plays fine from the swf on my computer, but I've found it seems to be a bit choppy online... can anyone confirm or deny?

Logged

Samysam
....................
*
Posts: 30



View Profile Email
« Reply #1 on: May 30, 2010 »

well, that was sad...  Sad
Logged
JordanMagnuson
....................
*
Posts: 34



View Profile WWW Email
« Reply #2 on: May 30, 2010 »

Thanks for the reply Samysam. Can you tell me whether the game seemed to run smoothly enough for you?
Logged

Mr. Trampoline
....................
*
Posts: 18


View Profile Email
« Reply #3 on: May 30, 2010 »

Ran fine for me.
Logged
spilocke
--------------

Posts: 2


View Profile
« Reply #4 on: May 31, 2010 »

 Embarrassed sad game...
it ran fine... but err... no one ever made it through the bridge I guess Sad
Logged
JordanMagnuson
....................
*
Posts: 34



View Profile WWW Email
« Reply #5 on: May 31, 2010 »

Thanks for the feedback guys. Can anyone comment on why the sound volume seems to rise in discreet steps at certain points, rather than rising in a smooth gradient?

Here's the relevant code:

Code:
distToPlayer = Math.abs(x - MyWorld.player.x) / 500 + 1;
riverVol = 1 / distToPlayer;
if (riverVol > 1)
riverVol = 1;
sndRiver.volume = riverVol;
Logged

Ultima2876
+++++++++++
***
Posts: 210

ultima@live.co.uk
View Profile WWW Email
« Reply #6 on: May 31, 2010 »

I'd try dividing by 500.0 instead of 500, also make sure distToPlayer is a Number type. This might be my C++ background speaking though...
Logged
JoshC
***********
**
Posts: 96


gnoll_man@hotmail.com
View Profile Email
« Reply #7 on: May 31, 2010 »

AS3 will do all the converting for you, as long as riverVol is a Number, which it must be as it does work well for me in your application I think. (Very nice by the way)
Logged
Ultima2876
+++++++++++
***
Posts: 210

ultima@live.co.uk
View Profile WWW Email
« Reply #8 on: May 31, 2010 »

Yeah, my main concern was that it might be doing an int division instead of a float division, since Math.abs can return an int and 500 can msot definitely be represented as an int. If it's doing an int division it'd certainly explain the problem.
Logged
JordanMagnuson
....................
*
Posts: 34



View Profile WWW Email
« Reply #9 on: May 31, 2010 »

Thanks thanks for the help. I dove into the problem a bit more, and here's what I found:


This code (original) causes the value of riverVol to "jump" in steps at certain points as the player moves forward:
Code:
distToPlayer = Math.abs(x - MyWorld.player.x) / 500 + 1;
riverVol = 1 / distToPlayer;

This code (same as above but on one line) achieves what I want (a smooth gradient):
Code:
riverVol = 1 / (Math.abs(x - MyWorld.player.x) / 500 + 1)


 Huh?

Does anyone know what's going on there?
Logged

JoshC
***********
**
Posts: 96


gnoll_man@hotmail.com
View Profile Email
« Reply #10 on: May 31, 2010 »

How did you type distToPlayer? Like Ultima said it needs to be a number to store that decimal data, else it is rounding it, causing the jumps.

Code:
var distToPlayer:Number//Instead of int
, I suppose that is the issue if changing to that other option works.  Smiley
Logged
JordanMagnuson
....................
*
Posts: 34



View Profile WWW Email
« Reply #11 on: May 31, 2010 »

Son of a... damn, I thought I had checked that! Was indeed the problem.  Embarrassed
Logged

ChevyRay
Administrator
~~~~~~~~~
******
Posts: 926


FührerPunk

happytrash@hotmail.com
View Profile WWW Email
« Reply #12 on: June 02, 2010 »

Cool man, will give it a play + feedback when I get back home later.
Logged
Rats808
....................
*
Posts: 14


<3 <3 <3 <3


View Profile Email
« Reply #13 on: June 03, 2010 »

I played this earlier and...well...
Point made. Shocked
Logged
mitsche
--------------

Posts: 1


View Profile Email
« Reply #14 on: June 07, 2010 »

I just registered on this forum to tell you that this was one of the most intense interactive experiences I've ever had. I went on and watched some short documentaries about Korea afterwards in order to process the tension it had left me with.

Thank you.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC