Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: samples/pop_pop_win/lib/src/canvas/game_element.dart

Issue 200723008: samples/poppopwin: upgrade to first-class sample (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fixed pkgbuild.status for rename Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 part of ppw_canvas; 1 part of ppw_canvas;
2 2
3 class GameElement extends ParentThing { 3 class GameElement extends ParentThing {
4 static const _edgeOffset = 32; 4 static const _edgeOffset = 32;
5 static const _backgroundSize = const Size(2048, 1536); 5 static const _backgroundSize = const Size(2048, 1536);
6 static const _backgroundEdgeOffset = 256; 6 static const _backgroundEdgeOffset = 256;
7 static const _backgroundHoleSize = 16 * SquareElement._size + 2 * _edgeOffset; 7 static const _backgroundHoleSize = 16 * SquareElement._size + 2 * _edgeOffset;
8 static const _boardOffset = const Vector(352, 96); 8 static const _boardOffset = const Vector(352, 96);
9 static const _popExplodeAnimationOffset = const Vector(-88, -88); 9 static const _popExplodeAnimationOffset = const Vector(-88, -88);
10 static const _popAnimationHitFrame = 12; 10 static const _popAnimationHitFrame = 12;
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 _scaledInnerBox = new Box(_backgroundEdgeOffset * _scale, 0, 373 _scaledInnerBox = new Box(_backgroundEdgeOffset * _scale, 0,
374 sizeX - 2 * _backgroundEdgeOffset * _scale, sizeY); 374 sizeX - 2 * _backgroundEdgeOffset * _scale, sizeY);
375 } 375 }
376 376
377 static num _getScale(int count, num fullSize, num holeSize) { 377 static num _getScale(int count, num fullSize, num holeSize) {
378 final k = count * SquareElement._size + 2 * _edgeOffset; 378 final k = count * SquareElement._size + 2 * _edgeOffset;
379 379
380 return k * fullSize / holeSize; 380 return k * fullSize / holeSize;
381 } 381 }
382 } 382 }
OLDNEW
« no previous file with comments | « samples/pop_pop_win/lib/src/canvas/game_background_element.dart ('k') | samples/pop_pop_win/lib/src/canvas/game_root.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698