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”
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.
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.