Created
November 29, 2020 09:49
-
-
Save Anniepoo/c7cf00bc8f6aa3745cc74de303ac2868 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:- use_module(library(chr)). | |
:- chr_constraint player/3, rocket/3, target/2, input/1, tick/0. | |
player(X,Y,H),input(space) ==> rocket(X,Y,H). | |
tick \ rocket(X,Y,H) <=> NX is X + cos(H) * V, NY is Y + sin(H) * V, rocket(NX, NY, H). | |
rocket(X,Y,_), target(TX, TY, _) <=> near(X,Y,TX,TY), explosion(TX,TY). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment