HTML Elements
This week I implemented a couple of html/CSS ui-overlays onto my game. I’ve also been working on organising my code into Game states. Using switch statements to set cases for each state and switch to the next when needed. There Is a picture example of my code below. As you can see, I grabbed the element using the id’s and called them at the initialize (game begin) and tally (game over) game states. This is nice, so when the game starts, I can give instructions and when the game is over it is easy to see that you’ve died.
Other html elements that I have added in are the health percentage and km counters at the top, this will measure the about of hit damage taken by objects and allow your player to see how far they make It in the game. The km – is incremented by a counter. I used ‘. fixed() ‘ to turn it into a string. You can learn more about it here: https://www.w3schools.com/jsref/jsref_tofixed.asp
Winter Wonderland! - Student Project
Student project making a simple Christmas game in Three.js
Status | In development |
Category | Other |
Author | Anniecooke |
Tags | 3D, Simple, Singleplayer, threejs, winter, wonderland |
More posts
- Final DevlogDec 06, 2018
- Adding in the AestheticsDec 03, 2018
- Avatar movements and Flying objectsDec 03, 2018
- Shadows, Fog and MaterialsDec 03, 2018
- Getting started with Three.jsDec 03, 2018