dcsimg
A Flash Developer Resource Site

Page 15 of 21 FirstFirst ... 5111213141516171819 ... LastLast
Results 281 to 300 of 407

Thread: MarioKart style flash engine

  1. #281
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    to andré: too bad,that would rock badly,hope mm speeds up the next flash player a bit more
    (by the way: i´m working together with a c++ coder who creates a standalone wrapper which accelerates swfs using the 3d card/open gl,might be a good project for that )
    Last edited by tomsamson; 04-04-2004 at 11:26 AM.

  2. #282
    Junior Member
    Join Date
    Dec 2002
    Posts
    6
    AndreMichelle, have you considered trying Flasm? It is simply wonderful. With it I have been able to make a 3D engine I'm working on experience a 360% performance boost. Just a suggestion...

  3. #283
    Ihoss
    Guest
    doesnt flasm just decompile it or something

  4. #284
    Junior Member
    Join Date
    Dec 2002
    Posts
    6
    It both decompiles and compiles. Actually, I should say that it assembles and disassembles. I'd love to explain, but the author of Flasm has already done a better job of it than I probably could if I tried. The jist of it is that you can make optimizations to the low-level, Assembly-like commands that the Flash Player executes. Basically, you can optimize your scripts into a form that is impossible for the Flash compiler to produce.

  5. #285
    Junior Member
    Join Date
    Feb 2004
    Location
    Munich
    Posts
    2

    z_mapping vs. Flash Player 7

    Hi folx,

    this one's got nothing to do with the recent posts, it's just a small but very helpful hint I got from Strille. I was wondering why all z_mapping codes (e.g. those of Strille and BlinkOK) won't work if "Publishing Preferences" is set to "Flash Player 7" (I'm using Flash MX 2004 Professional). Seems as if FP7 has a "major" problem with the z_mapping code - all older players worked fine.

    But things are far more easier than I thought: Strille (thanx a lot to him... ) gave me the reason and a solution too: FP7 cannot add to undefined variables - they have to be set to zero first. That means adding the following line to the 6th frame (before _root.onEnterFrame = main):

    xPos = yPos = rotation = lean = skyOffset = fr = speed = 0;

    to the source code (here I'm talking about Strille's codex, http://www.strille.net/works/misc/z.../z_mapping.html).

    Works perfectly!

    Thanx again to Strille and BlinkOK who replied immediately to my mails - you helped me a lot!

    Sorry if this information was already evident for some of you - I spent two days of searching the boards for a problem solution...

    Flash on,
    Lindyz

  6. #286
    Member
    Join Date
    Feb 2004
    Posts
    96
    If it says, "Please insert topic" or somthing like that. That means that you pushed the new topic button. BTW, is there anywhere i can find this engine, links are down.

  7. #287
    Member
    Join Date
    Jun 2002
    Posts
    38

    error 404!!!!!

    i can't access your page...
    i wanna see!!!
    but i really can't access your page...
    and i really wanna see...
    wala lang...

  8. #288
    Untitled-1.fla strille's Avatar
    Join Date
    Mar 2001
    Location
    Sweden
    Posts
    1,626
    The original version by PercyPea seems to be gone. You can still view my version though (the url a couple of posts ago was wrong):

    Flash MX "Constant Z Mapping" Example

    (I've edited it so it I should now work in MX 2004 correctly)

  9. #289
    Member
    Join Date
    May 2002
    Posts
    51
    Thanx for the nice engine,I try to attach it in AS2.0,but when i finished it i saw there was some bugs,i just almost copy and paste the codes from z_mapping.I try to fix it but i failed after two days.I posted it here,hope some good guys can help me.
    Thanx in advance.
    The importance code is MapView3D.as:

    PHP Code:
    import iiley.mode.View3D;
    import iiley.mode.IUnit3D;

    /**
     * @author        iiley
     */
     

    class iiley.mode.MapView3D extends View3D{

        private var 
    mainMC:MovieClip;
        private var 
    strips:Array;
        private var 
    width:Number;
        
        private var 
    topH:Number        1;  // top strip height
        
    private var bottomH:Number     8;  // bottom strip height
        
    private var groundScale:Number 10// the "height" above the ground
        
    private var totalHeight:Number 205// the minimum total height of all strips

        
    public function MapView3D(camera:IUnit3DmainMC:MovieClip,
                                  
    width:Number,
                                  
    topH:NumberbottomH:NumbergroundScale:Number,totalHeight:Number){

            
    super(camera);
            
    this.mainMC mainMC;
            
    this.strips = new Array();
            
    this.widthwidth;

            
    this.topH topH;
            
    this.bottomH bottomH;
            
    this.groundScale groundScale;
            
    this.totalHeight totalHeight;

        }

        public function 
    init():Void{
            
    clearStrips();

            var 
    averageH:Number = (topH bottomH)/2// average strip height
            
    var maskY:Number 0;

            for (var 
    a:Number=1<= totalHeighta++) {
                var 
    strip:MovieClip mainMC.attachMovie("strip"aa*2); // create strip
                
    strip._y 220;
            
                
    strip.mask mainMC.attachMovie("mask""m"+aa*2+1);
            
                var 
    scale:Number Math.pow(/ (totalHeight averageH), 1.5); // exponential function to make strips exponentially smaller near horizon
                
    var height:Number Math.round(topH + (bottomH topH) * scale); // current strip height
                
    strip.mask._height height 1// add 1 to strip height in order to prevent gaps when scale the flash movie
                
    strip.mask._width width// set mask width to something a bit larger than the movie width (because of leaning)
            
                
    maskY += height;
        
                
    strip._xscale strip._yscale = (maskY/totalHeight)*totalHeight groundScale;
        
                
    strip.mask._y maskY// place strip egde to edge with the previous strip in y pos
            
                
    strip.setMask(strip.mask);
                
    strip._rotation 0;// -(camera.getHeading()/Math.PI*180+90);
                
    strip.m._y 0;//-camera.getY();
                
    strip.m._x 0;//-camera.getX();
            
                
    strips.push(strip);   //add this strip to array

                
    if (maskY+height*totalHeight) { // exit when we have filled totalHeight with strips
                    //trace("a="+a+" masky="+maskY); 
                    
    break;
                }
            }

        }

        public function 
    update():Void{
                var 
    x:Number camera.getX();                   // define xPos as a local variable for faster access
                
    var y:Number camera.getY();                   // define yPos as a local variable for faster access
                
    var r:Number = -(camera.getHeading()/Math.PI*180+90); // define rotation as a local variable for speed
                
    var s:MovieClip mainMC;                       // define s_mc as a local variable for faster access
                
    s.sky._x 3*512;
                for (var 
    n:Number 0strips.length; ++n) {
                    var 
    rC:MovieClip strips[n];
                    var 
    mC:MovieClip rC.m;
                    
    rC._rotation r;
                    
    mC._y = -y;
                    
    mC._x = -x;
                }
        }

        private function 
    clearStrips():Void{
            while(
    strips.length 0){
                var 
    strip strips.pop();
                
    strip.mask.removeMovieClip();
                
    strip.removeMovieClip();
            }
        }


    and the files are here:
    http://www.robochina.org/member/iiley/test3dcar.zip

  10. #290
    Member
    Join Date
    May 2002
    Posts
    51
    You can see the demo runs here:
    http://www.robochina.org/member/iiley/test3dcar.html

    You can easily see the bugs -- the several strips at bottom views wrongly.

  11. #291
    ism BlinkOk's Avatar
    Join Date
    Aug 2001
    Location
    , location, location
    Posts
    5,002
    did you see Lindyz's post? if his suggestion does not work then mabey you could email/pm him.
    Graphics Attract, Motion Engages, Gameplay Addicts
    XP Pro | P4 2.8Ghz | 2Gb | 80Gb,40Gb | 128Mb DDR ATI Radeon 9800 Pro

  12. #292
    Member
    Join Date
    May 2002
    Posts
    51
    Thanks for your reply BlinkOk.
    I had seen Lindyz's post before i post,and i know what his post meaning,he pointed the undefined variables problem(thanx him).

    The bug in my testing is the different problem i think.I cannot find the bug's cause, so i post here hope some advanced ASer can give me some tips,however i am in thinking and testing to look for the solution too,when i find it i will post here(But i dont when).
    Last edited by iiley0; 03-24-2004 at 03:17 AM.

  13. #293
    I'm feeling supersonic kdsh7's Avatar
    Join Date
    Jul 2002
    Posts
    356
    You'll kick yourself - you really will. Looks like a video mem/display problem - if you'll forgive the subtle pun. Set quality to low and those strips will magically appear.

  14. #294
    Member
    Join Date
    May 2002
    Posts
    51
    Oh,god,it works well when i set quality to low.
    Thank you kdsh7.

  15. #295
    Junior Member
    Join Date
    Mar 2004
    Posts
    6
    hi,
    need some feed back about : http://www.k-yoo.com/yokiyoki/

    it's a bit laggy on mid config, in other words it's better to have a good computer
    there is a lot of work in order to optimise that

    main programming ezekyel@k-yoo.com
    design & graphic programming al@k-yoo.com

    a big thank to BlinkOk and AM for their help

    i would like to be able to put some houses and I still have a problem with that
    :
    PHP Code:
    var = -ry 200 /( 100 ry ); 
    this._x rx 100 * ( ( 100 ) * ); 
    this._y 

    in this code we just can't change the z value of the object (setted at 0) anyone knows how to get rid of that ?
    Last edited by ghettopacman; 03-30-2004 at 06:22 PM.

  16. #296
    Member
    Join Date
    Apr 2004
    Location
    PA
    Posts
    65

    buildings

    How do i put a building in this engine that you can drive around and see all the sides?
    Time Consuming Productions Presents

    www.maxbag.net
    (in the works)

  17. #297
    Yes we can tomsamson's Avatar
    Join Date
    Sep 2001
    Location
    Team Titan Secret Lair
    Posts
    4,666
    basically you have to draw (or render and export) the building in a full rotation around own axis animation,then you place it into the scenary with script and tell it which frame to display based on the player´s position to it

  18. #298
    Member
    Join Date
    Apr 2004
    Location
    PA
    Posts
    65

    coding

    What coding would i have to use to do that though?
    Time Consuming Productions Presents

    www.maxbag.net
    (in the works)

  19. #299
    Amiga freak Ironclaw's Avatar
    Join Date
    Jan 2001
    Location
    Sweden
    Posts
    1,651
    Cool.

  20. #300
    Junior Member
    Join Date
    Mar 2004
    Posts
    6
    well...ironclaw...amazing !!! make a wish !
    (i really master irony better than AS)

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