unity引擎做的超级小玛丽,运行在ios、android、windows等平台
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Assets
Library
ProjectSettings
obj/Debug
Assembly-CSharp-vs.csproj update Jun 2, 2016
Assembly-CSharp.csproj
README.md
supermario-csharp.sln update Jun 2, 2016
supermario-csharp.v11.suo update Jun 2, 2016
supermario.CSharp.csproj
supermario.sln
supermario.userprefs update Jun 2, 2016

README.md

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();
    }