Giter Site home page Giter Site logo

supermario's Introduction

superMario

超级马里奥

我的个人博客

利用unity引擎做的超级马里奥,完全自学,现在开源

亲测可以在windows电脑、wp手机和android手机上玩

enter image description here

【注】在手机端上玩需要打开虚拟摇杆

MarioCtrl.cs

 if (Input.GetKey(KeyCode.A))
    //if (touchKey_x < -0.1f)
    {
        transform.localEulerAngles = new Vector3(0,180,0);
        if (Camera.main.WorldToScreenPoint(transform.position).x > 20)  //小玛丽不能超出坐屏幕
        {
            transform.Translate(Vector3.right * runSpeed * Time.deltaTime * Mathf.Abs(touchKey_x)); //移动位置
        }
        runAnim();
    }
    
    if (Input.GetKey(KeyCode.D))
    //else if (touchKey_x > 0.1f)
    {
        transform.localEulerAngles = new Vector3(0, 0, 0);
        transform.Translate(Vector3.right * runSpeed * Time.deltaTime * Mathf.Abs(touchKey_x));
        runAnim(); 
    }

    if (Input.GetKeyDown(KeyCode.W) && isGround)
    //if (isTouchJump()&&isGround)
    {
        World.playAudio(World.jumpAudioIndex);
        rigidbody2D.velocity = new Vector2(0, jumpSeed);
        jumpAnim();
    }

supermario's People

Contributors

halibobo avatar

Watchers

James Cloos avatar Baraka avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.