I have coded my main menu for the game in HTML and CSS, and need the image buttons to function with the engine, using JavaScript.
How do I create JavaScript buttons?
Here are some examples:
Skip: One image button. Red, when disabled, and green. When enabled, skips the menu, when you come back to play to a continued game. When disabled, will return transitions to normal.
Restart: When clicked, opens a box with two images and text for "yes" and "no". If you click "yes", it restarts game, and when you click "no", it resumes the game.
Sound: Will have one image button, which will be red for "on", and green, when "off". Turns sound on and off.
Here is some example code:
function ENGINE_get_option_state(opt:string):string {
return…;
}
ENGINE_trigger_sound(…)