# Genuinely don't know where to go from here (golf game)

**URL:** https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715
**Category:** Coding Questions
**Created:** [April 29, 2021, 2:20am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715 "2021-04-29T02:20:17Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yagirl\_belle](https://avatars.discourse-cdn.com/v4/letter/y/d07c76/32.png) [@yagirl\_belle](https://discourse.processing.org/u/yagirl_belle)
#### Post date: [April 29, 2021, 2:20am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715/1 "2021-04-29T02:20:17Z")

</div>

Hey y’all I’m tryna make a golf game where when you shoot the ball, the happy face turns into a surprise face and the ball launches from the mouth. I can’t figure out what the heck I’m doing wrong.

```auto
boolean launch = true;
   if (keyPressed){
  if (keyCode == 32){
    launch = true;
    if (launch);
     drawBall();
  drawSurprise();
     yPos = yPos - ySpeed*2;
  } else{
drawPlayer();
 xPos = xPos+xSpeed;
}
  }

```

---

<div class="post-metadata">

### Author: ![Chrisir](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/chrisir/32/45_2.png) [@Chrisir](https://discourse.processing.org/u/Chrisir)
#### Post date: [April 29, 2021, 5:39am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715/2 "2021-04-29T05:39:31Z")

</div>

> [@yagirl\_belle](#):
>
> `boolean launch = true;`

This should initially be `false` I guess.

You don’t show too much of your code but I suggest that you move the code section where you draw something into `draw()` (or loop()) together with `if(launch) {...}`.

Only the `launch = true;` stays in the code where you check the key.

Does it work? Do you know why?

Hey and welcome to the forum! Great to have you here!

Regards,

Chrisir

---

<div class="post-metadata">

### Author: ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)
#### Post date: [April 30, 2021, 2:30am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715/3 "2021-04-30T02:30:21Z")

</div>

> [@yagirl\_belle](#):
>
> I can’t figure out what the heck I’m doing wrong.

Y’all can look here for resources (tutorials, examples, references, books, etc.):

- [https://processing.org/](https://processing.org/)

And Google search for:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/0/077193e00c60a541866fd598213788530fd90302.png)

`:)`

---

<div class="post-metadata">

### Author: ![yagirl\_belle](https://avatars.discourse-cdn.com/v4/letter/y/d07c76/32.png) [@yagirl\_belle](https://discourse.processing.org/u/yagirl_belle)
#### Post date: [May 2, 2021, 1:02am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715/4 "2021-05-02T01:02:02Z")

</div>

Thank you!

and yeah I realised it’s cause I never actually set the conditions for the boolean properly, so it was just “boolean = true” and nothing else to back it up and tell it how it should be true XD

---

<div class="post-metadata">

### Author: ![yagirl\_belle](https://avatars.discourse-cdn.com/v4/letter/y/d07c76/32.png) [@yagirl\_belle](https://discourse.processing.org/u/yagirl_belle)
#### Post date: [May 2, 2021, 1:02am UTC](https://discourse.processing.org/t/genuinely-dont-know-where-to-go-from-here-golf-game/29715/5 "2021-05-02T01:02:34Z")

</div>

yeah that’s what I’ve been using
