Giter VIP home page Giter VIP logo

sample-pop_pop_win's Introduction

An implementation of Minesweeper in Dart.

Interaction

  • Click on hidden squares to reveal them.
  • Shift-click on squares to flag them.
  • Shift-click on revealed numbers to go fast--but be careful. If you've flagged incorrectly, you'll hit a bomb.

Assets

Running and building

  • Clone the repository.

  • Run pub get.

  • To run locally with dartdevc:

    $ pub run build_runner serve
  • To build with dart2js and minified output:

    $ pub run build_runner build --release --output web:build

sample-pop_pop_win's People

Contributors

dependabot[bot] avatar devoncarew avatar franklinyow avatar jakemac53 avatar kevmoo avatar mit-mit avatar natebosch avatar sgjesse avatar whesse avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sample-pop_pop_win's Issues

Failed to load resource: the server responded with a status of 404 (Not Found)

am i missing something?

git clone https://github.com/dart-lang/sample-pop_pop_win

open in webstorm

run index.html

open developper mode in Chromium: shows:
Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:xxxxx/sample-pop_pop_win/web/packages/pop_pop_win/assets/style.css 

How to build with Intellij 2017.2

I try to open the root directory with Intellij 2017.2, used configuration javascript debug as per another dart web app I've built, but when I run I get:

No .packages file found, please run "pub get" first.
Pub Serve terminated
/Users/bert/flutter/bin/cache/dart-sdk/bin/pub serve web --port=58197

I've tried pub get, but get the following:

macpro1:sample-pop_pop_win bert$ pub get
Resolving dependencies...
Package build_runner has no versions that match >=0.7.0 <0.8.0 derived from:

  • pop_pop_win depends on version ^0.7.0

rename html directory to web

If you rename your html directory to "web" and no "package root" setting is necessary, and it will work correctly when you try to compile from the command line!

Move PPW into the Dart SDK

We'd like to put PPW into the editor's welcome page. To do that, it would be really really really nice if it was in the SDK's /samples directory.

Failure to build using 2.0.0-dev.69.5

Here's some of the output:

webdev serve
Crash when formatting: [Encoding] Unable to decode bytes as UTF-8.
RangeError (index): Invalid value: Not in range 0..268900, inclusive: 269720
#0      _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1      Source.getTextLine (package:kernel/ast.dart:5805:42)
#2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3      format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:204:9)
#5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:218:22)
#6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7      Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8      Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9      LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:235:24)
<asynchronous suspension>
#14     withCrashReporting (package:front_end/src/fasta/deprecated_problems.dart:69:24)
<asynchronous suspension>
#15     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:232:12)
<asynchronous suspension>
#16     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:113:32)
<asynchronous suspension>
#17     withCrashReporting (package:front_end/src/fasta/deprecated_problems.dart:69:24)
<asynchronous suspension>
#18     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:59:10)
<asynchronous suspension>
#19     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:42:18)
<asynchronous suspension>
#20     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:46)
#21     new Future.sync (dart:async/future.dart:224:31)
#22     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:19)
#23     _rootRun (dart:async/zone.dart:1124:13)
#24     _CustomZone.run (dart:async/zone.dart:1021:19)
#25     _runZoned (dart:async/zone.dart:1516:10)
#26     runZoned (dart:async/zone.dart:1463:12)
#27     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#28     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:128:41)
#29     generateKernel (package:front_end/src/kernel_generator_impl.dart:41:32)
<asynchronous suspension>
#30     kernelForComponent (package:front_end/src/api_prototype/kernel_generator.dart:83:17)
<asynchronous suspension>
#31     SingleShotCompilerWrapper.compileInternal (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/vm/bin/kernel_service.dart:186:11)
<asynchronous suspension>
#32     Compiler.compile.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/vm/bin/kernel_service.dart:134:39)
#33     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#34     _rootRun (dart:async/zone.dart:1120:38)
#35     _CustomZone.run (dart:async/zone.dart:1021:19)
#36     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#37     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#38     _rootRun (dart:async/zone.dart:1124:13)
#39     _CustomZone.run (dart:async/zone.dart:1021:19)
#40     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#41     Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#42     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#43     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#44     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

Crash when compiling file:///Users/john/.pub-cache/global_packages/webdev/bin/webdev.dart.snapshot,
at character offset 268392:
RangeError (index): Invalid value: Not in range 0..268900, inclusive: 269720
#0      _StringBase.[] (dart:core/runtime/libstring_patch.dart:233:55)
#1      Source.getTextLine (package:kernel/ast.dart:5805:42)
#2      getSourceLine (package:front_end/src/fasta/messages.dart:27:9)
#3      format (package:front_end/src/fasta/command_line_reporting.dart:80:27)
#4      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:204:9)
#5      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:218:22)
#6      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#7      Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#8      Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#9      LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#10     SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#11     SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#12     Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#13     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:235:24)
<asynchronous suspension>
#14     withCrashReporting (package:front_end/src/fasta/deprecated_problems.dart:69:24)
<asynchronous suspension>
#15     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:232:12)
<asynchronous suspension>
#16     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:113:32)
<asynchronous suspension>
#17     withCrashReporting (package:front_end/src/fasta/deprecated_problems.dart:69:24)
<asynchronous suspension>
#18     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:59:10)
<asynchronous suspension>
#19     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:42:18)
<asynchronous suspension>
#20     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:46)
#21     new Future.sync (dart:async/future.dart:224:31)
#22     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:19)
#23     _rootRun (dart:async/zone.dart:1124:13)
#24     _CustomZone.run (dart:async/zone.dart:1021:19)
#25     _runZoned (dart:async/zone.dart:1516:10)
#26     runZoned (dart:async/zone.dart:1463:12)
#27     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#28     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:128:41)
#29     generateKernel (package:front_end/src/kernel_generator_impl.dart:41:32)
<asynchronous suspension>
#30     kernelForComponent (package:front_end/src/api_prototype/kernel_generator.dart:83:17)
<asynchronous suspension>
#31     SingleShotCompilerWrapper.compileInternal (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/vm/bin/kernel_service.dart:186:11)
<asynchronous suspension>
#32     Compiler.compile.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/vm/bin/kernel_service.dart:134:39)
#33     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#34     _rootRun (dart:async/zone.dart:1120:38)
#35     _CustomZone.run (dart:async/zone.dart:1021:19)
#36     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#37     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#38     _rootRun (dart:async/zone.dart:1124:13)
#39     _CustomZone.run (dart:async/zone.dart:1021:19)
#40     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#41     Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#42     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#43     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#44     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)


#0      format (package:front_end/src/fasta/command_line_reporting.dart:123:5)
#1      ProcessedOptions.format (package:front_end/src/base/processed_options.dart:204:9)
#2      ProcessedOptions.report (package:front_end/src/base/processed_options.dart:218:22)
#3      CompilerContext.report (package:front_end/src/fasta/compiler_context.dart:67:13)
#4      Loader.addMessage (package:front_end/src/fasta/loader.dart:258:20)
#5      Loader.addCompileTimeError (package:front_end/src/fasta/loader.dart:207:5)
#6      LibraryBuilder.addCompileTimeError (package:front_end/src/fasta/builder/library_builder.dart:89:12)
#7      SourceLoader.tokenize (package:front_end/src/fasta/source/source_loader.dart:174:17)
<asynchronous suspension>
#8      SourceLoader.buildOutline (package:front_end/src/fasta/source/source_loader.dart:192:26)
<asynchronous suspension>
#9      Loader.buildOutlines (package:front_end/src/fasta/loader.dart:176:13)
<asynchronous suspension>
#10     KernelTarget.buildOutlines.<anonymous closure> (package:front_end/src/fasta/kernel/kernel_target.dart:235:24)
<asynchronous suspension>
#11     withCrashReporting (package:front_end/src/fasta/deprecated_problems.dart:69:24)
<asynchronous suspension>
#12     KernelTarget.buildOutlines (package:front_end/src/fasta/kernel/kernel_target.dart:232:12)
<asynchronous suspension>
#13     generateKernelInternal.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:113:32)
<asynchronous suspension>
#14     withCrashReporting (package:front_end/src/fasta/deprecated_problems.dart:69:24)
<asynchronous suspension>
#15     generateKernelInternal (package:front_end/src/kernel_generator_impl.dart:59:10)
<asynchronous suspension>
#16     generateKernel.<anonymous closure> (package:front_end/src/kernel_generator_impl.dart:42:18)
<asynchronous suspension>
#17     CompilerContext.runInContext.<anonymous closure>.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:46)
#18     new Future.sync (dart:async/future.dart:224:31)
#19     CompilerContext.runInContext.<anonymous closure> (package:front_end/src/fasta/compiler_context.dart:120:19)
#20     _rootRun (dart:async/zone.dart:1124:13)
#21     _CustomZone.run (dart:async/zone.dart:1021:19)
#22     _runZoned (dart:async/zone.dart:1516:10)
#23     runZoned (dart:async/zone.dart:1463:12)
#24     CompilerContext.runInContext (package:front_end/src/fasta/compiler_context.dart:119:12)
#25     CompilerContext.runWithOptions (package:front_end/src/fasta/compiler_context.dart:128:41)
#26     generateKernel (package:front_end/src/kernel_generator_impl.dart:41:32)
<asynchronous suspension>
#27     kernelForComponent (package:front_end/src/api_prototype/kernel_generator.dart:83:17)
<asynchronous suspension>
#28     SingleShotCompilerWrapper.compileInternal (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/vm/bin/kernel_service.dart:186:11)
<asynchronous suspension>
#29     Compiler.compile.<anonymous closure> (file:///b/build/slave/dart-sdk-mac-dev/build/sdk/pkg/vm/bin/kernel_service.dart:134:39)
#30     new Future.<anonymous closure> (dart:async/future.dart:176:37)
#31     _rootRun (dart:async/zone.dart:1120:38)
#32     _CustomZone.run (dart:async/zone.dart:1021:19)
#33     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#34     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#35     _rootRun (dart:async/zone.dart:1124:13)
#36     _CustomZone.run (dart:async/zone.dart:1021:19)
#37     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#38     Timer._createTimer.<anonymous closure> (dart:async/runtime/libtimer_patch.dart:21:15)
#39     _Timer._runTimers (dart:isolate/runtime/libtimer_impl.dart:382:19)
#40     _Timer._handleMessage (dart:isolate/runtime/libtimer_impl.dart:416:5)
#41     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:165:12)

Not sure if this is a Dart 2 or just an issue with this app. Thanks!

Source file for art?

Hi,
Can you please share source file for game assets? (PSD/SVG...) or if not can you please split assets to single picture (dart_opaque_01).
Br,

Asset licenses?

Are the assets for this game under the same license as the code, or a different one?

Change trigger for win animation

The victory condition fires the moment you click on the last balloon so you see you've won even as the dart is flying. In Chrome it's a minor moment but in Firefox that's running much slower it looks really weird.

Add Google Analytics

<script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-26406144-14']); _gaq.push(['_trackPageview']); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script>

build_runner 0.4.0 dep breaks sample

Hey @kevmoo,

As of 0.4.0, build_runner sets ignore_cast_failures to false by default, resulting in runtime errors whenever StageXL fires Events. You can witness this when running this project, for example.

For a quick fix, see https://github.com/nilsdoehring/dartbook/blob/master/build.yaml#L12 how to set the flag to true (I had to unearth that info from build_runner sources).

But, of course we don't want StageXL to produce cast errors in the first place. Unfortunately, neither @bp74 nor I understand why it does. Much appreciated if you could join our discussion.

Thanks!

Add "About" UI

Should include:

  • Two tabs: one for 'about' and one for 'how to play'

About

  • link to source code
  • CC license
  • A "built with Dart" which links to dartlang.org

How to play

  • A picture of a partially covered board with an obvious item to flag
  • notes

CPU hog

This program is continuously a CPU hog for no good reason, both before a game is started, during the game as well as afterwards. Perhaps this is a problem with how StageXL is used: a quick profiling put requestAnimationFrame() at the top of the list, or a problem with StageXL itself, if it can't be used without hogging the CPU.

As a Dart example, this bad behavior risks spreading to many web apps unless corrected, leading to degraded device performance and energy waste.

Switching to another tab ends the CPU hogging.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.