siongui / dart-snake-game

snake game in Dart
https://siongui.github.io/dart-snake-game/
The Unlicense
4 stars 1 forks source link

Dart2 and querySelector #1

Open RandyStevens opened 6 years ago

RandyStevens commented 6 years ago

Hey i found your project and wanted to work to update it to dart2 for myself to learn, I forked your repo but am kinda stuck. I cant seem to get your startGame() method to run, i get no errors, just seems not to listen.

RandyStevens commented 6 years ago

I think my problem is i need to integrate dart2js before i pub serve it

siongui commented 6 years ago

This game is written in Dart 1, and it is a project that I developed long time ago. I am not sure whether it works in Dart 2. I have not used Dart for long time!

RandyStevens commented 6 years ago

I figured that. I see you have been mostly working in GO, very cool btw, i found your project and it looked like a good place to start for learning how compiling dart to .JS works. Feel free to close the issue if its cluttering your github.

RandyStevens commented 6 years ago

Im having a little trouble figuring out your original build process. i see you have a makefile which im assuming you would run make then run pub serve i get errors when I run make on the original project ill attach a screenshot

siongui commented 6 years ago

You can try make js.

The default setting of Makefile does not compile Dart code to JavaScript.

RandyStevens commented 6 years ago

so the most recent error that i am on is ATLAS:dart-snake-game randalstevens$ make DART_FLAGS='--checked' --user-data-dir=./data index.html /bin/sh: --user-data-dir=./data: No such file or directory make: *** [snake] Error 127

I did notice earlier that there is references to a data.dart or somesuch file in the gitignore and somewhere else. what was it this file contained how do I make one on my local environment

siongui commented 6 years ago

You can delete --user-data-dir=./data , but I think maybe you make js is better.