Sprint #2.5 - Daily Scrum #02
Product: Tetris2P AI
Sprint Summary
Daily Objectives
- I don’t have any objectives today btw, supposed to be an off day so I want to try not worrying about what i get done right now
Notes
I’ll continue my notes for now
‘Delta’ is the amount of time the mainloop is telling the objects to ‘SIMULATE’
I think we can make the ‘SCENE’ objects handle time variables by keeping a timer and continually adding delta to it so it becomes: ‘the amount of simulated time passed’
Also I think delta goes by milliseconds instead of seconds
The past week was mostly just finding and learning how MainLoop.js works and how you can can structure into some sort of ‘game framework’. Should I search difference between game engine and game framework?
Alright so what exactly is a SCENE and what do I need to include?
Why are Scene’s a necessary concept/object?
If there are multiples levels or aspects to an entire ‘game’, we don’t want to have completely unrelated code involved with any of the current ongoing objects.
The idea is to abstract scenes from each other. BUT we still need a way to include global variables? Global Variables and persistent settings. A common idea is usually saving settings in mini dictionary/json file and saving it as a cookie? Similar to what I’ve done with my chrome extension. Two types of variables though, things persistent across sessions, and information just getting passed between switching scenes.
Example: The Main Menu scene passing information to the Single Player scene. The single player scene needs to now uh… stuff? I’m not quite sure yet TBH but i’ll keep thinking about it. I’ll accommodate for it later, since it shouldn’t be hard to implement.
Unrelated but I wanna buy a system design book and read it.
So NOW, we discuss the main details of the scene.
The scene’s variables/functions:
- timeElapsed
- activeObjects
- Update
- Draw
- Draws all the objects
I’m kinda confused about the relationships between a scene and its object hierarchy? At least I’m confused with how it works without a GameManager object.
Ok so there’s ‘GameObjects’ and you can see everything about the object in the Inspector Window. The list of GameObjects appear in the HierarchyWindow. The SceneObject just has that list of active objects in the HierachyWindow, and goes down the list rendering and updating the objects. So should GameLogic maybe be reserved for the scripts in the actual GameObjects? I think so. I don’t think I need to do anything that’s ‘ComponentBased’, I can keep it hard OOP.
Quick Question: does the scene call the render function for descendants? I think its probably better if we have parent objects call them instead.
So the only job of the Scene is to hold variables and call update/draw functions of its immediate list of GameObjects.
Next thing to consider is how GameObjects interact with other game objects. I think the best way is to build references to the other objects on initiation.
Scene’s need an initiation function! What happens here?
- Initiates all of its objects
- Runs Update and Draw on all of its objects
Btw we can use a global namespace as recommended by another site using: window.game = {}, Which is accessible by all files :)
So am I supposed to make javascript library? Oh im supposed to make templates objects :question_mark:
I figured out how to use javascript ‘modules’ in client side browser settings :)
- I wanted to make sure I figure this out, I’m assuming I’m moving to node.js later anyway but I felt this was important to know :)
I’m having big issues figuring out how/where to put everything for the engine code,and the actual user game code.
I think I should define use case?
I should only have to ‘run’ main.js and everything should be an extension of that.
SO I need to move MainLoop content into engine. So engine is like a wrapper class for MainLoop.js
So now we have an engine class and object that has the main loop functionality. Cool!
How do we add scenes to it? So I think the developer shouldn’t have to write anything into the engine. BUT the engine needs access to the scenes and handle transitions between scenes.
For SCENES, what does development look like? The point of making the Scene object is define consistent methods for the engine to access. Each scene a developer makes will be a subclass of the original Scene class.
“””
class Circle extends Shape {
// As above
}
“””
YEA THAT’S WHAT I WANNA DO
Best way to start off its to actually create a MAIN MENU scene and see what kinda methods and functions I need from there
“””A game engine basically provides you with the environment to develop your game. For example the basic features that a game engine supports …”””
The engine only needs to update/draw one scene at a time.
The engine only needs to call update(delta) on the Scene.
Scenes will import all the game objects they themselves.
Will any game objects need to be saved or like, not re-instantiated? I’m gonna say no!
All the scenes don’t need to be created right at the beginning, can be instantiated at run time right before we transition into.
Functions/Variables the Scene class needs:
- Constructor:
- Establish variables and stuff, needs a reference its engine
- transitionIn:
- Instantiate objects
- Handle parameters passed in by previous scene (if applicable)
- transitionOut
- un-instantiate objects?
- Write transition dictionary of parameters to pass to new scene
- update
- The actual game logic goes here (goes through active objects and calls their update functions or whatever functions they need to operate?)
- Actually just calls the update functions, the objects themselves can check if they need to update anything based on time delta
- draw
- Goes through active object list and calls their draw functions (pass in context)
I think now its a good chance to finalize the kind of game objects i need to create for my TETRIS GAME that i was SUPPOSED TO MAKE in LESS THAN A WEEK, a WHOLE WEEK AGO. HECKKflajdsfjkhas
GameObjects:
- MatchInstance
- Game timer
- Tetrimono queue
- 2x Tetris Instances
- TetrisInstance
- Held Piece
- Tetrimono queue
- TetrisGrid
- Current tetris piece
- KO’s
- Lines Sent
Match > TetrisInstance »> TetrisGrid, CurrentTetrimono
Match Instance, Tetris Instance, Tetrimono Instance, TetrisGrid should all be GameObjects probably
Objectives Completed
-
designed and detailed required function and variables for the
scene
class -
outlined gameObjects necessary for a tetris game for reference
Plans for Tomorrow
- Create files for all the game objects and get everything sorted