From the course: Advanced HTML5 Game Development

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

Game stage creation and object positioning

Game stage creation and object positioning - HTML Tutorial

From the course: Advanced HTML5 Game Development

Game stage creation and object positioning

- [Instructor] Hello and welcome to video 2.3. In this video, we're going to discuss about game stage creation and object positioning. In the previous video, we've created basic elements. Now we're gonna position them in the correct location onstage and in the case of the brick, we're going to create a brick reg instead of just one. In order to create the brick reg we'll need to modify the create brick function we created in the previous video. We're gonna add, as parameters x and y. And instead of using hard code values, like 50, we're gonna send the values, according to parameters provided by the function header. We'll remove the destroy brick call, because it was used as a demonstrate in the previous video. And now we'll create brick grid function. I'll paste it and I'll explain what it does. The create brick grid function will run a nested loop. Nested loop means that a loop will run inside a loop to create the correct grid. Now, the I value will be in charge of the x values of…

Contents