A Flash Developer Resource Site

Page 9 of 21 FirstFirst ... 567891011121319 ... LastLast
Results 161 to 180 of 407

Thread: MarioKart style flash engine

  1. #161
    Illuminatus! fospher.com's Avatar
    Join Date
    Jan 2002
    Location
    5th Dimension
    Posts
    2,185
    Originally posted by funkydonkey2000
    HILLSSS.. I can smell them, I know they are coming soon.
    the monkeys

  2. #162
    #
    Join Date
    Apr 2002
    Location
    berlin - germany
    Posts
    107
    with 5 points along the top for the 'lineTo's and then again for 2 pixels below to close the mask.

    in the version i just put up, the points y position simply follow a sine wave as you turn.

    Im sure theres a way though to make the points match a predefined landscape and move and adjust with it.

    but ya, theres gonna be a big performance hit :)

    If i had time i might explore it more, but unfortunatly I dont
    Yeah, i could be work with a tilemap, where the heights are set.
    I developed a lineOfSight Algorithm, which can be modified for that.

    But I did not have the time at all. After finishing our game, I will see, how it could be done.

    Who is first ? :o)

  3. #163
    Senior Member
    Join Date
    Aug 2001
    Posts
    101
    Who is first ?
    well.... im not planning on working on the mario kart engine anymore, at least for the forseeable future.

    Time constraints and other engine ideas are the main reason

    so u'll be first

  4. #164
    #
    Join Date
    Apr 2002
    Location
    berlin - germany
    Posts
    107
    well.... im not planning on working on the mario kart engine anymore, at least for the forseeable future.
    Time constraints and other engine ideas are the main reason :)
    just kidding :o)

    but a landscape engine will have more options for a complexer gameplay.
    very interesting stuff.

  5. #165
    Junior Member
    Join Date
    Sep 2001
    Location
    world.getCountry("france").getCity("grenoble")
    Posts
    14
    hi ,

    I probably post an engine with hills toonigth ... but it seems that it doesn't allowed y rotations because we must draw a straigth scanline. i think that the method is to get y coords for n points on the z axis (z = 10, 20, 30 ... for example). with z and y coords it will be possible to determine the y coord on the screen ( yscreen = coef * y/z) of each scanline.

  6. #166
    Senior Member
    Join Date
    Aug 2001
    Posts
    101
    i.. by scanlines do you mean the masks?

    in which case they dont have to be straight, if you make them not straight thats how the landscape is made.

    or... have i mis understood

  7. #167
    Meat Popsicle stevz©_'s Avatar
    Join Date
    Mar 2001
    Posts
    108
    right under my nose...
    you have truely inspired me
    this almost brings a tear to my eye!!!
    FANTASTIC!!!

    peace out!
    Stevz

  8. #168
    Junior Member
    Join Date
    Sep 2001
    Location
    world.getCountry("france").getCity("grenoble")
    Posts
    14
    my first attempt ... i have some strange buggs, but it gives an idea of the systeme.
    Code:
    function getHeight(z) {
    	var res =2*Math.pow(Math.cos(0.03*(5*z+zPos)),2)-z/10
    	//the formula gives an y coord for a z one
    	return res;
    }
    function setScanlines() {
    	var x = xPos;
    	// define xPos as a local variable for faster access
    	var z = zPos;
    	// define zPos as a local variable for faster access
    	var s = sM;
    	// define sM as a local variable for faster access
    	var yc = ycam;
    	var ysc = yScreen;
    	var sscl = stripScale;
    	var yprec = yscl0;
    	var scl, m;
    	var cz = dz;
    	for (var n = 1; n<=nOfS; n++) {
    		scl = s[n];
    // a clip containing both mask (.m) and bitmap (.s)
    		scl._y = (yc+getHeight(n*cz))*sscl[n]+ysc;
    		scl.m._height = yprec-scl._y+1;
    		yprec = scl._y;
    		m = scl.s.m;
    		m._y = z;
    		m._x = x;
    	}
    }
    http://www.toy-toy.net/tmp/z_mapping_hills.swf

  9. #169
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    Xavier77, that's pretty neat! I don't see how you could create hills that aren't infinitely wide using that technique... Would be great if you solved that problem though. And it will probably be difficult to make it look good when you turn.

    I've played around a bit with the engine too. I've created a map that consists of 3200x800 pixels. I use seven 800x800 images. The reason I don't use four 800x800 images is because I need them to overlap. The file size increases quite a bit, but it's nice to be able to use larger maps. And there's a small pause when the images switches, but I think I can remove that...

    http://www.strille.net/works/misc/z_...z_mapping.html

  10. #170
    Senior Member MiSSenLinX's Avatar
    Join Date
    Jan 2003
    Location
    Perth, Australia
    Posts
    260
    nice one strille, I like the jump, just thinking on what this can turn into, damn NEED TO LEARN FASTER

  11. #171
    Junior Member
    Join Date
    Sep 2001
    Location
    world.getCountry("france").getCity("grenoble")
    Posts
    14
    i think that will be possible to build a very big and detailed map by assembling X*X modules. a module could be : right turn, left turn, straight line. So, it could be a solution to reduce the swf weight ?
    Last edited by Xavier77; 07-10-2003 at 04:28 AM.

  12. #172
    Heli Attack! iopred's Avatar
    Join Date
    Jun 2003
    Location
    Sydney, Australia
    Posts
    923
    Funny. I was just about to make a post like this.

    I cbf'ed doing it, but assemble the map like mario kart, a tilemap. If you look at mario kart, the borders are all tiles, so you can do the same, then the collision detection would also be faster (tilebased) and filesize would be a fraction of the size.

  13. #173
    Senior Member
    Join Date
    Aug 2001
    Posts
    101
    i think the problem with tilebased which mean u'd have lots of mcs inside each mc thats masked, and I think (havent tested) that that would cause alot of slowdown.

    Great work strille!

  14. #174
    #
    Join Date
    Apr 2002
    Location
    berlin - germany
    Posts
    107
    Aahh. I forgot to post this little demo, we made a few weeks ago.
    Did you expect fog or nightdriving ? :o)

    3dmapping fog - night

    Nice, but another performance stuff.

  15. #175
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    great stuff andre!
    RESPEKT
    falls ihr nen coolen ed für das ganze braucht,sag bescheid
    Last edited by tomsamson; 07-10-2003 at 06:39 AM.

  16. #176
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    Yes, tile map is the next logical step. Unfortunately, as Percy pointed out, it will result in a performance hit because when I tested to combine several images the FPS dropped 25%...

    I don't see how you could do a tile based collision detection? You don't want to test against the squares but rather the curvy road in the squares. Right now the collision detection is one hitTest against a very simple shape once per frame.


    AndreMichelle, very nice! F1 nightdriving? That would be something
    I like the fact you used oval tree sprites which hide the fact that they are single frame sprites quite well.

  17. #177
    Senior Member
    Join Date
    Aug 2001
    Posts
    101
    very nice andre! cant wait till see your final game

    Strille, out of interest, why is it you've overlapped your images instead of joing them on to one another with perhaps only a 1 pixel overlap to stop gaps?

  18. #178
    #
    Join Date
    Apr 2002
    Location
    berlin - germany
    Posts
    107
    falls ihr nen coolen ed für das ganze braucht,sag bescheid ;
    Was meinst Du mit 'ED' ?

    :o)

  19. #179
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    Because that way I can use only one image at any given time. The overlapping can be seen as the minimal line of sight. Right now, they overlap 50%, which means the line of sight is never less than 50% of the 800x800 pixels. And you can still see the road slowly disappearing in the horizon and then reappear again when switching to a new image.

  20. #180
    Senior Member
    Join Date
    Aug 2001
    Posts
    101
    very clever!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center