pha Flashcards
The equation for FPS is
framesPassed / (endTime - startTime)
To detect mouse down
if (this.input.activePointer.isDown) {
}
The most popular atlas packer for Phaser3 is
TexturePacker
To create an animation
this.load.atlas(‘key’, ‘spritesheet.png’, ‘spritesheet.json’);
this.anims.create({
key: ‘attack’, // This is its name that you’ll call
frames: [ // List of objects in order, each one is a frame name from the json
{key: ‘keyFromAtlasImport’, frame: ‘nameFromJsonFile’},
{key: ‘keyFromAtlasImport’, frame: ‘nameFromJsonFile’},
],
frameRate: 60,
repeat: -1
});
sprite. play(‘attack’);
https: //www.youtube.com/watch?v=ffemDAdJySU
Orthographic projection is
representing 3D objects in 2D
Transactions sheet
The benefit of a transaction for a write operation is
you can revert the entire transaction if any of the operations fail. Useful when some data in the transaction relies on other data in the transaction to be accurate.
The benefit of a transaction for a read operation is
It locks the database so if one of the fields changes during a read you don’t get data that is old.
You want to minimize
transactions. One transaction is 1000 row updates is better than 1000 single row updates.
What autocommit=false guarantees is
you’ll be executing your queries (inserts, deletes, updates), in a transaction, which means that they’ll either all succeed (with a commit at the end), or fail, and be rolled back.
autocommit=false and two users need to update the same rows at the same time, then one will be locked waiting for the first one to complete, with either a commit or a rollback.
https://stackoverflow.com/questions/521887/how-much-does-wrapping-inserts-in-a-transaction-help-performance-on-sql-server