Click here for free DL of the app version that can save data.
No:18472 61
Prev Next
Successfully land the plane on the aircraft carrie..ALL
Developer User7431|Date and time 23/9/29 16:06:47
Build time 53.911 sec|Game capacity 4.966KB|Script






In this HTML file, a game is implemented where the objective is to successfully land the plane on the aircraft carrier. The game is designed for smartphone operation. The game uses pictograms for the plane and the aircraft carrier. It starts by creating a canvas element and initializing game variables. Two `Image` objects are created for the plane and the carrier pictograms. The game consists of a `Component` constructor which represents the plane and carrier, and it has a `draw` method to draw the components on the canvas. The `checkCollision` function is used to check if the plane collided with the carrier. The `updateGame` function updates the game state on every frame. It applies gravity to the plane's vertical speed, checks for collision with the carrier, and detects when the plane goes outside the canvas, resulting in a game over condition. The game also handles the space key events to control the plane's movement. When the space key is pressed, the plane's vertical speed is set to a negative value, giving it an upward boost. Releasing the space key sets the plane's vertical speed back to the gravity value, causing it to fall down. The game continuously renders the frames using `requestAnimationFrame` and alerts the player when the plane successfully lands on the carrier or crashes. Note: This implementation assumes that you have the "emozi_rabbit.png" and "emozi_apple.png" images available in the same directory as the HTML file. Please replace those filenames with your own images or modify the code accordingly.

Prev Next   Back  0  0 Menu 


[PR]現在のフィギュア売れ筋ランキング

Click here for free DL of the app version that can save data.

(C)2023 HisashiApp