Page 1 of 1

Visual Studio Code Template for the LÖVE framework

Posted: Tue Feb 27, 2018 1:21 am
by Marty
So you want to build your LÖVE game in Visual Studio Code?
Then I invite you to make use of my Visual Studio Code Template for the LÖVE framework.

Image
DOWNLOAD


It offers various helpful tools (tested in Windows and Mac, Linux should work, too) and I'm planning to improve and enhance it. (So I suggest to fork it with remote upstream to stay up2date.)

This template offers:
  • A LÖVE launcher that shows console output (print) in the Terminal of VSCode
  • Animation file merger (perfect to build single animations in Piskel and use the generated combined file with anim8 (or any other animation lib) in your game, example included)
  • Optional: Minification on distribution
  • Optional: Windows binary builder (icon injection not included for now)
  • Optional: Android compilation (copies Android and game files to your Android project and executes gradlew build to build your APK, Android injection files are only compatible with my RichLÖVE, please consider to replace them, if you don't want to use my fork)
  • Optional: iOS preparation (copies iOS and game files to your Xcode project, iOS injection files are only compatible with my RichLÖVE, please consider to replace them, if you don't want to use my fork)
(The above is archived by vscode and gulp tasks.)

If you are missing any functionality that might be useful for general purposes, please be welcome to implement those on a clean branch of your fork of this template repository and submit a pull request.

Have fun!

Re: Visual Studio Code Template for the LÖVE framework

Posted: Tue Feb 27, 2018 7:10 am
by Jack5500
Looks great, do you plan on adding it to the extensions marketplace?

Re: Visual Studio Code Template for the LÖVE framework

Posted: Tue Feb 27, 2018 11:24 am
by Marty
Jack5500 wrote: Tue Feb 27, 2018 7:10 am Looks great, do you plan on adding it to the extensions marketplace?
Ich denke nicht, no.

Afaik the extension marketplace does not offer uploading templates. I really suggest to fork this repository instead and keep it up2date, because this will allow you to fetch changes. Conflicts barely should appear when you just edit the config files and contents of your src folder.

GitHub has an excellent tutorial how to fork + add a remote upstream + fetch updates from the upstream (parent repo).

Re: Visual Studio Code Template for the LÖVE framework

Posted: Tue Feb 27, 2018 8:48 pm
by D0NM
Thank you very much!

I use a free Intellij Idea IDE. And it lacks of many functions after this nice Visual Studio Template.
Which is must have now!

Keep it up!

Re: Visual Studio Code Template for the LÖVE framework

Posted: Wed Feb 28, 2018 1:52 am
by Marty
D0NM wrote: Tue Feb 27, 2018 8:48 pm Thank you very much!

I use a free Intellij Idea IDE. And it lacks of many functions after this nice Visual Studio Template.
Which is must have now!

Keep it up!
I'm glad it's helpful. It's nice to see somebody else enjoys it. :)


Now, I added calling gradlew build on the make-android task, so it will build your APK for you when everything is set up, properly.

Re: Visual Studio Code Template for the LÖVE framework

Posted: Fri Mar 30, 2018 7:46 pm
by Stifu
Heya. I'm trying to use your template.

I'm on Windows. I'm getting this error (pardon the French) when trying to use Ctrl+L.
> Executing task: "C:\Program Files (x86)\LOVE\love.exe" ./src --console <

'C:\Program' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Le processus du terminal s'est achevé avec le code de sortie 1

Le terminal sera réutilisé par les tâches, appuyez sur une touche pour le fermer.
It seems it's choking on the spaces in the path, for some reason, and despite the apparent double quotes around it.
Besides, this is the wrong folder, as my LOVE installation is in the "Program Files" folder, not in the x86 variant.
Any ideas?

By the way, if I may suggest adding a tiny precision to the instructions so far...
Go to Preferences > Keyboard Shortcuts and paste this:
Would become:
Go to File > Preferences > Keyboard Shortcuts > Modify keybindings.json and paste this:
Thanks.

Re: Visual Studio Code Template for the LÖVE framework

Posted: Mon Apr 02, 2018 1:35 pm
by Marty
Stifu wrote: Fri Mar 30, 2018 7:46 pm Heya. I'm trying to use your template.

I'm on Windows. I'm getting this error (pardon the French) when trying to use Ctrl+L.
> Executing task: "C:\Program Files (x86)\LOVE\love.exe" ./src --console <

'C:\Program' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Le processus du terminal s'est achevé avec le code de sortie 1

Le terminal sera réutilisé par les tâches, appuyez sur une touche pour le fermer.
It seems it's choking on the spaces in the path, for some reason, and despite the apparent double quotes around it.
Besides, this is the wrong folder, as my LOVE installation is in the "Program Files" folder, not in the x86 variant.
Any ideas?
The task that is triggered when you press CTRL+L is configured in .vscode\tasks.json. There is a line:

Code: Select all

"command": "\"C:\\Program Files (x86)\\LOVE\\love.exe\" ./src --console"
Here you can configure the path to the love.exe. There should be no issues with the spaces though, because it includes escaped double quotes. Can you please make sure the line is:

Code: Select all

"command": "\"C:\\Program Files\\LOVE\\love.exe\" ./src --console"
in your case?

Stifu wrote: Fri Mar 30, 2018 7:46 pm By the way, if I may suggest adding a tiny precision to the instructions so far...
Go to Preferences > Keyboard Shortcuts and paste this:
Would become:
Go to File > Preferences > Keyboard Shortcuts > Modify keybindings.json and paste this:
Thanks.
Thank you for that suggestion. I will edit the README.

Re: Visual Studio Code Template for the LÖVE framework

Posted: Mon Apr 02, 2018 4:32 pm
by Stifu
modiX wrote: Mon Apr 02, 2018 1:35 pmThe task that is triggered when you press CTRL+L is configured in .vscode\tasks.json. (...)
Oh right, I can confirm that works. I should have kept reading the README, sorry about that, and thanks. I was under the impression I could use CTRL+L as soon as I added the shortcuts (and that error message that truncates the path added to the confusion). If others make the same mistake I made, the README could be reorganized to make you set the right configuration before adding the shortcuts. Just a thought.

Re: Visual Studio Code Template for the LÖVE framework

Posted: Tue Apr 03, 2018 8:10 am
by Marty
Stifu wrote: Mon Apr 02, 2018 4:32 pm Oh right, I can confirm that works. I should have kept reading the README, sorry about that, and thanks. I was under the impression I could use CTRL+L as soon as I added the shortcuts (and that error message that truncates the path added to the confusion). If others make the same mistake I made, the README could be reorganized to make you set the right configuration before adding the shortcuts. Just a thought.
Glad that this worked out for you and yes, this is an excellent idea. I have reorganized the README to prevent this problem.

Please never hesitate to always share your thoughts regarding this template. I really appreciate it. ;)