Basically the idea is that when you click somewhere the string will go from the player to were you clicked. If double click pull the Spiderman to the position where you clicked this is done by using a joint2D+Raycast. When click again release poor Spiderman before he smash his head against the topside of the screen.
I suggest you look into raycast. you probably will need it. when the raycast hit something the string pull == true.
I ignore the fact that you want it to have button on the screen for running, It doesn’t work well with all the inputs you want to have in the game (im thinking from a mobile point of view) WE ARE MAKING AN ENDLESS RUNNER so attach a movement script on the player that should look abit like this Void Update(){vector3.left = left; int speed = 3; transform.Translate(leftspeedTime.deltaTime);.
for the jump button. make a sprite in paint or photoshop, put a circle collider2d on it and attach a jump script to it, becarefull that you make a statement when the player can jump, because it wont be fun if spiderman could jump infinite time in the air right? So you get a script named grounded a.k.a we are making a bool, a bool is to check is something is true or false so if you leave the ground OnTriggerExit the jump = false
when OnTriggerEnter the jump = true;.
for the score to make the game have a goal. We will use the x-axis as the score, our character begins at 0.0x position and the score will be the x value. If you want a highscore, look into PlayerPrefsGet and PlayerPrefsSet.
Last tips : Dont be picky about how you game looks, we can later on hire a professional for 1000$ a month and let it do all the fancy art work.
And! Never give up on improving and watching tutorials to get better at scripting. I’m scripting for about 1-2 years and I still consider myself not being adept at programming. This week I applied for an University for Art and Programming I got denied because I knew C# and little C++ also they said my potential “probably” laid at design and production, thinking about game mechanics, nah I didn’t liked that idea. I thanked them for the time and will re-try to enter the course next year. So if you ever want to make this a job in the future and join a fancy University, than I will recommend to look also at c++.
Sorry for the long story.
Have a nice day
-Hexer
Lol just joking, here the actually advise, watch tutorials and try to understand them. try to understand what a Float and an Int is, know the difference. Make small projects in the beginning, projects that you can complete within 1 day.
Game Ideas: A wall is approaching you, what will you do? Ofcourse smash it apart with the hammer of Thor. Mjonir! (Everybody loves Nordic Mythologic right?).
take the movement script I put above (check for errors as I stated Im terrible, some vars need to be defined). Put the script on the wall.
Instantiate the wall, or make a loop of objects your choice.
Instantiate(Obstacle,SpawnPosition,transform.position, Quarternion.identity);
Use the InvokeRepeating for this because we don’t want the wall to be spawning each frame with Void Update.
When click on the screen(by using Input.GetMouseDown(0){ player.GetComponent() = true;}
Then the collider got this script attached to it OnTriggerEnter(Collider other){Destroy.other}; hit BOOM wall smashed. {Score+=1;} static public int score = 0;
a value you want to access from outside another script you always want that to be a static value.
and with public you can edit the score in the inspector.
If the wall hit you, so if OnTriggerEnter(Collider other){if(other.gameobjectWithTag == WALL){invoke gameOver}
void gameOver{//put your gameover statements here, like disable some scripts and movement like disabling the instantiate script.
If you want to go further, you can also increase the speed of the Walls for each 5 score you make.
so if(Score.score >=5){speed = 10;}
if(Score.score>=10{speed = 10^100;}
Haha I still made a long post, so bored after I got denied. :3, And don’t stop getting better at something you like to do.