# Trying to make a google dinosaur game rip-off?

**URL:** <https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554>\
**Category:** Coding Questions\
**Created:** [November 15, 2018, 6:02am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554 "2018-11-15T06:02:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![CyanNi](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@CyanNi](https://discourse.processing.org/u/CyanNi)\
**Post date:** [November 15, 2018, 6:02am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/1 "2018-11-15T06:02:32Z")

</div>

Well, flappy bun??  
The problem I have is that the image instead of going up and down—it stretches…  
Here’s the code!

float bunHeight = 2;  
float speed = 1;  
PImage bun;

void setup() {  
size(500,500);  
bun = loadImage(“Bun.png”);  
}

void draw() {  
//clear the screen/background?  
background(255);  
//draw the ball  
image(bun, 10, 10, width/2, bunHeight/2);  
//modify the ball’s height  
bunHeight += speed;  
//increase speed

//bounce  
if(bunHeight/2 \> height) {  
bunHeight = height;  
}  
}

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [November 15, 2018, 7:30am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/2 "2018-11-15T07:30:07Z")

</div>

hi @CyanNi

nice try for your first game,

 ![snap-001](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/e/e45bf2d7eb0a4e88eab47b6a4d56271851c3276e.png)

but you did not format your code,  
and you did not link to

> **[Chrome Dino Game](https://chromedino.com/)**
>
> Chrome T-Rex dinosaur game online with scores (records)

and so it took some time to make that missing image

> Bun.png

now the revenge!  
you not get my code, only a picture!

 ![snap-002](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/7/7a799ccb2c383d7851135767e6e824d22d21ea1b.png)

p.s. the real game use this

 ![](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/b/b05ce54db0b45fd75051611f0ebfb7606045492c.png)  
how can we use that?  
[https://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Graphics.html#drawImage(java.awt.Image,%20int,%20int,%20int,%20int,%20int,%20int,%20int,%20int,%20java.awt.image.ImageObserver)](https://docs.oracle.com/javase/1.5.0/docs/api/java/awt/Graphics.html#drawImage(java.awt.Image,%20int,%20int,%20int,%20int,%20int,%20int,%20int,%20int,%20java.awt.image.ImageObserver))

> <https://stackoverflow.com/questions/10861852/add-a-complex-image-in-the-panel-with-buttons-around-it-in-one-customized-user/10862262#10862262>

---

<div class="post-metadata">

**Author:** ![CyanNi](https://avatars.discourse-cdn.com/v4/letter/c/34f0e0/32.png) [@CyanNi](https://discourse.processing.org/u/CyanNi)\
**Post date:** [November 15, 2018, 5:51pm UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/3 "2018-11-15T17:51:42Z")

</div>

Thank you, I’m sorry for bothering you…but wow I just wanted to know how to make it stop streching you went beyond…??

---

<div class="post-metadata">

**Author:** ![Nick](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@Nick](https://discourse.processing.org/u/Nick)\
**Post date:** [January 21, 2019, 7:36am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/4 "2019-01-21T07:36:38Z")

</div>

I want to embed this Google Chrome game on my website. Is there any advice? I don’t want to put the entire in the word press, I just need the embedded frame from another website.  
I got this code code from one of the website, but and I did try to put it on my mine, but it is showing me the error.  
“Display forbidden by X-frame options”

Code I am trying to embed is - \<h3[Google Dinosaur Game](https://www.dinogame.net/)

---

<div class="post-metadata">

**Author:** ![Sarah](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sarah/32/1675_2.png) [@Sarah](https://discourse.processing.org/u/Sarah)\
**Post date:** [January 21, 2019, 8:04am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/5 "2019-01-21T08:04:35Z")

</div>

From what I see `<iframe src="https://www.dinogame.net/game/"></iframe>`; should work.

Also, this isn’t really related to Processing, so it might be better asked on StackOverflow or similar Q&A websites.

---

<div class="post-metadata">

**Author:** ![JackWitherell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jackwitherell/32/3361_2.png) [@JackWitherell](https://discourse.processing.org/u/JackWitherell)\
**Post date:** [January 21, 2019, 8:08am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/6 "2019-01-21T08:08:53Z")

</div>

> [@Nick](#):
>
> “Display forbidden by X-frame options”

> [@Sarah](#):
>
> `<iframe src="https://www.dinogame.net/game/"></iframe>` ;

iFrame is being depricated almost universally across the web as it’s a security concern.

Sarah is right, it’s not really a good idea to jump into a thread with your own question but to make your own, and what you’re asking for is off topic.

However, far be it from me to shoot down someone’s ideas and not suggest an alternative… If you press F12 on the offline screen in google chrome you might be able to inspect and extract the html and javascript in the debugger to find more information on how to take the code of the game and use it in your own website. There’s a chance that it’s part of the browser program itself and not just a web frame though, so you may be out of luck and have to make a recreation of your own.

[p5js would be a great start for that.](https://p5js.org/)

---

<div class="post-metadata">

**Author:** ![Quillbert1](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@Quillbert1](https://discourse.processing.org/u/Quillbert1)\
**Post date:** [January 21, 2019, 4:11pm UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/7 "2019-01-21T16:11:25Z")

</div>

Your problem is this line: `image(bun, 10, 10, width/2, bunHeight/2);`. The parameters of image are this:  
(image, x position, y position, width, height). You are changing bunHeight, which is the parameter you are using to set the height, not the y position. Try replacing the second 10 with bunHeight, and setting the last parameter to a fixed number.

---

<div class="post-metadata">

**Author:** ![JackWitherell](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jackwitherell/32/3361_2.png) [@JackWitherell](https://discourse.processing.org/u/JackWitherell)\
**Post date:** [January 22, 2019, 4:18am UTC](https://discourse.processing.org/t/trying-to-make-a-google-dinosaur-game-rip-off/5554/8 "2019-01-22T04:18:24Z")

</div>

This post has already been answered by [kll](https://discourse.processing.org/u/kll) it just got bumped recently by someone else.
