Side Scroller Motocross - Moto McSteed - Early Dev

Hello folks,

Moto McSteed - Playable Demo

UPDATE: Moto McSteed is nearly done! I’m looking to submit it to the App Store for final approval this week. The demo will be up until release day.

New Trailer Up.

I’m working on a iOS Side Scroller Motocross game because none of the ones I’ve found work the way I would want.

Most of the motocross games are about Not Crashing. Advanced level are made needlessly difficult, have frustrating time limits and force you to restart after a crash.

Moto McSteed is about You vs The Clock. The goal is to learn the fastest way to ride the tracks, knowing when to slow down and when to be a throttle masher. If you crash you lose time but keep going.

It will have cartoony painted graphics featuring characters from the McSteed TV universe.

Additionally I will be sharing some of the scripts I’ve created (or modified) to get the game to work. I’ve come up with some very simple solutions for commonly asked questions regarding side scroller games. Other than Unity 4.3 I’m using Easy Hills 2D and I’m thinking about getting Sound Manager Pro because codding the audio is making me suicidal.

Thanks,

Chris

Please post the scripts I have been trying to make a game similar to this for quiet some time but I have been struggling with the physics. Also do you use the 2D Side Scroller Prefab Unity provides
-Thanks

So here’s my 2D Parallax script. The script is added to each level of BG or FG elements.
Chris Neuhahn / McSteed Inc
Add to empty game object. Parent your BG objects to the empty game object. The Parallax Factor should be set between 0.0 and 1.0 for BG layers.

1.0 follow the camera exactly. The closer to 0.0 you get the less the BG moves with the camera. Use 0.0 to -1.0 for foreground elements.
Use the X and Y Offsets to make adjustments to the placement of your layers. Useful if you are copying BGs from other scenes.
Rock on!

using UnityEngine;
using System.Collections;

public class BG_Parallax : MonoBehaviour {

	// Chris Neuhahn / McSteed Inc
	// Add to empty game object. Parent your BG objects to the empty game object. The Parallax Factor should be set between 0.0 and 1.0 for BG layers.
	// 1.0 follow the camera exactly. The closer to 0.0 you get the less the BG moves with the camera. Use 0.0 to -1.0 for foreground elements.
	// Use the X and Y Offsets to make adjustments to the placement of your layers. Useful if you are copying BGs from other scenes.
	// Rock on!

	public Transform Target; //Drop Main Camera in
	public float ParallaxFactor = 1.0f; //Set in inspector. 1.0 follows camera exactly. 
	private float TheX;
	private float TheY;
	public float X_Offset = 0f;
	public float Y_Offset = 0f;

	void Start(){


	
	}

	void Update(){
		TheX = Target.transform.position.x *ParallaxFactor + X_Offset;
		TheY = Target.transform.position.y *ParallaxFactor + Y_Offset;
		transform.position = new Vector3 (TheX, TheY, transform.position.z);
		}



}

Okay thanks that should help

This is the script I made for powering the rear wheel. The script is added to the rear wheel object which has a hinge joint 2D on it. It also has a breaks function.

using UnityEngine;
using System.Collections;

public class WheelPower : MonoBehaviour {
	
	private float WheelTorque = 7000f;
	public GameObject FrontWheel;
	public bool Grounded = false;
	public bool SendToRoost = false;

	void Start () {


		//manager = camera.GetComponent<GameManager> ();
	}

	// Test whether the rear wheel is on the ground.
	void OnCollisionStay2D(Collision2D other)
	{
		Grounded = true;
	}
	// Test whether the rear wheel is off the ground.
	void OnCollisionExit2D(Collision2D other)
	{		
		Grounded = false;
	}

	void FixedUpdate()
	{
		//Sets a public boolean for the particles tell the particles to be on if the wheel is on the ground
		if (Grounded)
			SendToRoost = true;
		else
			SendToRoost = false;

		//gass
		if (Input.GetAxisRaw ("Horizontal") > 0.1f) 
		{
			rigidbody2D.AddTorque (-WheelTorque);
		}

		//breaks
		if (Input.GetAxisRaw("Horizontal")<-0.1f)
		{
			// this method is not perfect. It doesn't always stop all rotation.
			rigidbody2D.angularVelocity = 0f;
			FrontWheel.rigidbody2D.angularVelocity = 0f;
		}
	}


}