what if i use modify code?
hey i'm using unity and i found a car script on a forum and i modify it to get rid of the input for forward and back and i was wondering if that was okey?
hey i'm using unity and i found a car script on a forum and i modify it to get rid of the input for forward and back and i was wondering if that was okey?
this is the first ludum dare game i made and it's not good but i made it and thats all that matters https://armyant-studios.itch.io/thinkfast if you wondering where i got movement code here's the link https://answers.unity.com/questions/686025/top-down-2d-car-physics-1.html also i copy and paste the code for the questions because i added a lot of easter eggs
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI;
public class Learn : MonoBehaviour {
public Text Question;
public int TypeOfQuestion;
public int ActualQuestion;
public Button button1;
public Button button2;
public Button button3;
public Button button4;
public Text score;
public float ScoreFloat;
public float CurrentScore;
public Text text;
public Text text2;
public Text text3;
public Text text4;
public CarScript carscript;
public float numberGoesUpBy;
public FinishLine Line;
public Transform spawnpoint;
public GameObject feedbackpoint;
public GameObject Canvas;
// Use this for initialization
public void Button3(){
if (TypeOfQuestion == 1) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 2) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 3) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 4) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 5) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 6) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 7) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 8) {
carscript.acceleration++;
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "3";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 9) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
}
public void Button4(){
if (TypeOfQuestion == 1) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 2) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 3) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 4) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 5) {
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.color = Color.green;
tex.text = "speed is up by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 6) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 7) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 8) {
carscript.acceleration++;
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "3";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 9) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
}
public void Button2(){
if (TypeOfQuestion == 1) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 2) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 3) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 4) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 5) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 6) {
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.color = Color.green;
tex.text = "speed is up by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 7) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 8) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 9) {
carscript.acceleration++;
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "3";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion = 1;
return;
}
}
public void Button1(){
if (TypeOfQuestion == 1) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 2) {
carscript.acceleration++;
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is up by " + "2";
tex.color = Color.green;
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 3) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 4) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 5) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 6) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (320, 200, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 7) {
carscript.acceleration++;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.color = Color.green;
tex.text = "speed is up by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 8) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
if (TypeOfQuestion == 9) {
carscript.acceleration--;
GameObject points = Instantiate (feedbackpoint, Canvas.transform.position, spawnpoint.rotation);
points.transform.parent = Canvas.transform;
points.transform.position = new Vector3 (800, 400, 0);
Text tex = points.GetComponent<Text>();
tex.text = "speed is down by " + "1";
Destroy (points, 3);
TypeOfQuestion++;
return;
}
}
// Update is called once per frame
void Update () {
score.text = "" + ScoreFloat.ToString();
if (Line.IsFinish == false) {
ScoreFloat += Time.deltaTime;
}
if (TypeOfQuestion == 9) {
Question.text = "9/20 = ?";
text2.text = "0.45";
//if you reverse this answer and discover the easter egg you must be disapointed after the last few easter eggs or just really confuse if so maybe you just need water
text3.text = "0.7";
text.text = "1.25";
//again if you reverse this answer the 1 is 4/4 and the 1.25 is 5/4 it's from the song Schism by Tool the joke is that the time signatures at the start is a 5/4 then move on to a 4/4
text4.text = "1";
}
if (TypeOfQuestion == 8) {
Question.text = "what is Hey in swedish?";
text3.text = "Halla";
//"i'll be the roundabout"
text4.text = "Jag kommer att vara rondellen";
//"Maynard is Awesome"
text2.text = "Maynard ar Fantastisk";
//"rest in peace Cliff Burton"
text.text = "Vila i fred Cliff Burton";
}
if (TypeOfQuestion == 7) {
Question.text = "whats No in german?";
text.text = "Nien";
//"i love Quake"
text3.text = "Ich Liebe Quake";
// every personal and inside joke i added it because it sounds funny
text2.text = "Gebruik Von Cookies";
//"i want" in german from the Song Ich Will by Rammstein
text4.text = "Ich Will";
}
if (TypeOfQuestion == 6) {
Question.text = "when did World War2 broke out?";
text2.text = "1939";
// date of the 911 attack
text.text = "September 11, 2001";
// year of when the holocaust started
text3.text = "1941";
//date of the world trade center bombing
text4.text = "February 26, 1993";
}
if (TypeOfQuestion == 5) {
Question.text = "when did the great plague of london happen?";
text4.text = "1665";
text3.text = "the start of the universe";
text.text = "2018";
text2.text = "1980";
}
if (TypeOfQuestion == 4) {
Question.text = "9 * 7 = ?";
text4.text = "45";
text3.text = "63";
//translate this you'll get Nerd and add the 3 at the end you'll get Nerd3
text.text = "145184,3";
//if you translate the number into english you'll get Jim Sterling
text2.text = "10913 1920518129147";
}
if (TypeOfQuestion == 3) {
Question.text = "9 + 5 + 3 =?";
text3.text = "17";
text4.text = "18";
text.text = "12";
text2.text = "15";
}
if (TypeOfQuestion == 1) {
Question.text = "2 + 2 = ?";
text3.text = "4";
text2.text = "3";
text4.text = "10";
text.text = "50";
}
if (TypeOfQuestion == 2) {
Question.text = "5 + 3 + 7 = ?";
text.text = "15";
text4.text = "13";
text3.text = "9";
text2.text = "3";
}
}
}