Jump to content

  • Log In with Google      Sign In   
  • Create Account


imac2000

Member Since 24 Aug 2006
Offline Last Active Mar 07 2013 04:43 PM

Topics I've Started

HTML5 tile enigne

06 March 2013 - 02:32 PM

Hi all

I have a question about implementing a viewport/camera, I am playing around with the HTML5 canvas and have started to implement a tile engine. At the moment it is massively inefficient, I have a 2d array 100x100 and each frame my code is looping through the whole thing (very bad i know). I would like to use a viewport/camera to determine which area of the area in being view and reduce the rendering loop.

here is an example, I haven’t added the camera offset yet because I’m not sure how


 


    for (var y = 0; y < state.map_data.length; y++) {
        col = state.map_data[y];
        for (var x = 0; x < col.length; x++) {
            color = (state.map_data[y][x]==1)?'#fff':'#000';            
            self._draw({
                type:'rec',
                x: x * state.tile_width,
                y: y * state.tile_height,
                width: state.tile_width,
                height: state.tile_height,
                fill: color,
                visible: true
            },self.ctx);
        };
    };

 


here is a link to it

http://code-creative.net/game_test/map.html

if anyone could give me some advice or point me in right direction that would be great.

 

Thanks

 

Ian


OpenAL

21 September 2012 - 01:40 PM

Hi there

I have been playing around with OpenAL and positional sound, I am using corona sdk

is there are way to make sound, sound like it is coming from behind a player,
if for example if I have a sound positioned at

x:0 and y:10
or
x:0 and y:-10

the sound balance through each of the speakers seems to be the same.

can anyone suggest how I can get a better way to get a better sense of where the sound is emanating from.

Thank you for your help

Mac

[java] advice please

07 September 2006 - 01:16 AM

HI there It my first Post. I need your advice about java for games Dev. I have been programming for about 5 year mainly VB, web based scripting languages and Database stuff. I have also produced a game for the GBA using the HAM IDE in C and had a lot of fun doing that. But C was a little frustrating so I thought I would give java a try. I got a simple Java in 24 hours and got start on so simple apps. After that I found a book on Amazon call the black art of java game development or something like but I didn’t check the published date and found out it was printed in 1996 GUTTED. I know that the book will be useful in the sense of OOP principles but would I wasting my time learning some archaic code? If so could you recommend a good book, that wasn’t written at the beginning of time. Thanks Ian Mac

PARTNERS