How can make a game such as geometry dash to be able to play more than once like normal game does?

hopscotch

#1

Hi,

We've got one student he is asking, how can make a game such as geometry dash to be able to play more than once like normal game does?

thanks


#2

I would add lives, as demonstrated in one of my projects. Just go onto my account (click on my endless stream of blahs(profile pic)). My account should be there. I am on a computert currently so i cannot type the special letters. I will get the link shortly.


#3

Before I can answer your question, i'll need to know how the game works. How do you loose the game?


#4

great.

thank you very much and looking forward to it.

Ben @joyelearn


#5

@joyelearn here is the link. https://c.gethopscotch.com/p/y4o2kazhs
Note it says 3 lives when it actually 4. Its to solve a glitch.


#6

When you bump into an obstacle :D


#7

hi,

thank you for the link, but did you done that? can you pls let me know to know?

thanks

Ben @joyelearn


#8

I copied and pasted an old link from a topic.


#9

We'll have a reset button and make it so that when the button is pressed, (object) goes back into its initial position and the score resets.

This can also be helpful for adding in high scores, leaderboards and menus/unlockables to the game (by using points to buy stuff in the menus)

Let me know if you need any help with any of it!

It's @JojoDude!


#10

Ok. In that case, you could have a value set to "0" and a restart button, appearing when that value is "0". Tapping the restart button would set the value to "1", and the obstacles would only move when the value was set to "1".


#11

hi,

if i understood it correctly, the answer is, when two objects pumps each other.

thanks


#12

Ok, that's what I meant :D

In that case, you could have a value set to "1" and a restart button, appearing when that value is "0". When the objects bump, set the value to "0". Tapping the restart button would set the value to "1", and the obstacles would only move when the value was set to "1".


#13

thank you @JojoDude!


#14

thank you @CreationsOfaNoob


#15

No problems!

If you need me to explain anything further, let me know but I think it's best that you start with the reset button first :blush:


#16

yeah, try to do reset button first.

thank you again @JojoDude


#17

No problems, tag me at anytime!


#18

I'd say it could help if you had values for when the game is in play, and when it is out of play.

I'm not the best at explaining, so I'll try to just draw out the code.


I usually have a title screen for most of my games, as well as a "You Lose! Your Score Was ___" screen. I also have the gameplay screen.

Whenever I want the gameplay screen, I can set a value "gameplay" to 1.

To go from the title screen to gameplay:

[When (play) is tapped]
[Set value (gameplay) to 1]

To go from the gameplay to the "You Lose" screen:

[When (lose=1)]
[Set value (gameplay) to 2]

On any objects you want visible during gameplay, I would place these two rules on them in addition to their other rules:

[When (gameplay=1)]
[Set invisibility percent (0)]

[When {gameplay (not equals) 1}]
[Set invisibility percent (100)]

This will make them visible during gameplay, but not in the title screen or the "You Lose" screen. You'll want to do a similar thing with the items in the title screen and the "You Lose" screen, with their respective values.

To restart the game, you could add a button at the "You Lose" screen called "Retry?" You could use this button to bring you back either to the title screen or immediately to the gameplay.

To go to the title screen:

[When (Retry?) is tapped]
[Set value (gameplay) to 0]

To go straight to the gameplay:

[When (Retry?) is tapped]
[Set value (gameplay) to 1]


It might not make much sense, but I hope this helped!