# Gamelab question

**URL:** <https://forum.code.org/t/gamelab-question/38604>\
**Category:** CS Discoveries\
**Tags:** csd-unit-3\
**Created:** [November 1, 2023, 5:57pm UTC](https://forum.code.org/t/gamelab-question/38604 "2023-11-01T17:57:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sphillip](https://avatars.discourse-cdn.com/v4/letter/s/43a26b/32.png) [@sphillip](https://forum.code.org/u/sphillip)\
**Post date:** [November 1, 2023, 5:57pm UTC](https://forum.code.org/t/gamelab-question/38604/1 "2023-11-01T17:57:27Z")

</div>

Is there a way in game lab to tell the computer to go back to a previous line of code?

Basically, Can I tell it if I push the space bar to go back to line 10 or something??

---

<div class="post-metadata">

**Author:** ![melynn](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/melynn/32/4925_2.png) [@melynn](https://forum.code.org/u/melynn)\
**Post date:** [November 1, 2023, 7:48pm UTC](https://forum.code.org/t/gamelab-question/38604/2 "2023-11-01T19:48:17Z")

</div>

@sphillip,

You can’t tell it to go to a specific line number of code. This does sound like an if statement or function. An if statement is a little easier. For example:

if(keyDown(“space”)) {  
do something  
}  
OR

![image](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/1/1ae734402f287419295bf96f21d2a8d16942effe.png)

So each time the space key is pressed, it runs the code inside the brackets.

Hope that helps!  
~Michelle

---

<div class="post-metadata">

**Author:** ![varrience](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/varrience/32/8042_2.png) [@varrience](https://forum.code.org/u/varrience)\
**Post date:** [November 2, 2023, 7:23am UTC](https://forum.code.org/t/gamelab-question/38604/3 "2023-11-02T07:23:46Z")

</div>

if your refering to a jump command type of code top level functions are your basic goto operators for this sort of thing

```auto
function jump() {
 console.log("this is line 2");
}
var a = 0;
var b = 1;
jump();
console.log(b)
jump();

```

orrr you can use listeners which is what @melynn has suggested either way both work just have different use cases
