glusk / sprouts Goto Github PK
View Code? Open in Web Editor NEWA multi-platform implementation of Sprouts, built with libGDX.
License: MIT License
A multi-platform implementation of Sprouts, built with libGDX.
License: MIT License
Replace next()
methods in LocalRotations with NextCompoundEdge
classes:
ReversedEdge
The optimization is a trade off between the shortest line of the cobweb and the minimum degree of vertices.
This needs to go away:
// Needed to set the completed flag
next.direction();
This functionality:
is implemented in libGDX
:
Intersector.distanceSegmentPoint(po, p1, x)
Moreover libGDX
clips the projection to the line segment. If the projection doesn't fall on the segment, libGDX
computes the Euclidean distance to the nearest segment end point.
Add a graph implementation with:
For sample size 5, the linear equations look like this:
[ 4 1 0 ] [ B1 ] = [ (6*S1 - S0) ]
[ 1 4 1 ] [ B2 ] = [ 6*S2 ]
[ 0 1 4 ] [ B3 ] = [ (6*S3 - S4) ]
For sample size 4, like this:
[ 4 1 ] [ B1 ] = [ (6*S1 - S0) ]
[ 1 4 ] [ B2 ] = [ (6*S2 - S3) ]
And for sample size 3, like this:
4 * B1 = 6*S1 - S0 - S2
Source: http://www.math.ucla.edu/~baker/149.1.02w/handouts/dd_splines.pdf
Add logic to detect in which face the next game move is being drawn.
Do I really have to redraw the screen when not drawing a move?
https://github.com/libgdx/libgdx/wiki/Continuous-&-non-continuous-rendering
Sample template: appveyor.yml
This helped auto-accept Android licences: link
Document that the changes to the list passed through the constructor reflect in points()
Something that better resembles LocalRotation edges is needed.
A compund edge has origin v
and direction (a, b)
Reversed Compound edge has origin b
and direction (?, v)
PresetSubmove.java
should be modified in direction()
:
-if (strokePoints.size() < 2) {
+if (strokePoints.isEmpty()) {
throw
new IllegalStateException(
- "At least 2 sample points are needed to establish a "
+ "At least 1 sample point is needed to establish a "
+ "direction!"
);
}
The change should be propagated in the for loop.
This should be added to ensure uniform line endings in the repo:
$ echo "* text=auto" >.gitattributes
$ git add --renormalize .
$ git status # Show files that will be normalized
$ git commit -m "Introduce end-of-line normalization"
Git - gitattributes Documentation
Originally posted by @Glusk2 in #47 (comment)
Implement a Comparator that sorts points in clockwise order, given a center point. The relevant SO answer: https://stackoverflow.com/a/6989383
Create the basic structure as described here: https://github.com/libgdx/libgdx/wiki/Project-Setup-Gradle
Build https://github.com/Glusk2/sprouts/runs/61758818 failed because of lint errors
A Connection comprises a compound edge pair.
It is useful for the Graph algorithms used (less verbose code)
A Submove's joints on both sides of the link should appear visually the same
Checks missing:
The following line needs fixing:
https://github.com/Glusk2/sprouts/blob/3ccf822b24376cfb4296b3ad109ac6ba4f57ceef/core/src/main/java/com/github/glusk2/sprouts/comb/PresetRotations.java#L24
Fix:
* {@literal new TreeSet<DirectedEdge>(}
The project is using 3rd party libraries (la4j), which are not supported by GWT.
Connected to #18.
When PresetRotation's next() is invoked for a current
DirectedEdge that is not part of a PresetRotations object, but shares the direction with one of its edges, an error occurs.
Add ReadMe (cherry pick 5576030)
./gradlew javadoc
fails with:
<USER-HOME-PATH>\.gradle\caches\modules-2\files-2.1\com.google.gwt\gwt-user\2.8.0\518579870499e15531f454f35dca0772d7fa31f7\gwt-user-2.8.0.jar(com/google/gwt/animation/client/AnimationScheduler.java):18: error: cannot access GWT
import com.google.gwt.core.shared.GWT;
^
bad source file: <USER-HOME-PATH>\.gradle\caches\modules-2\files-2.1\com.google.gwt\gwt-user\2.8.0\518579870499e15531f454f35dca0772d7fa31f7\gwt-user-2.8.0.jar(com/google/gwt/core/shared/GWT.java)
file does not contain class com.google.gwt.core.shared.GWT
Please remove or make sure it appears in the correct subdirectory of the sourcepath.
1 error
:html:javadoc FAILED
Edge
, Vertex
--> Dart
, DartTip
, Vertex
replace all RadialComparator
occurances with ClockwiseComparator
.
This project does not need a physics library.
Remove ExtendedEdge
class from the source code.
libGDX
provides no line joining utilities/settings.
http://www.bluevoid.com/opengl/sig00/advanced00/notes/node290.html
The following SO answer shows how to compute Milter join points (in general terms, although the question was about libGDX
in specific).
An easy round join solution:
Draw a circle centered at the common vertex with radius half the line width. Sounds easy but if not drawn carefully, there would be serious overdraw.
http://artgrammer.blogspot.com/search/label/opengl
If drawing a curve, a texture can be applied to triangle strips. Example:
https://badlogicgames.com/forum/viewtopic.php?f=11&t=18940 (The forum was shut down).
Use epsilonEquals(Vector2 other) to test Vectors for fuzzy equality.
Add a slider to the tool bar, allowing the user to specify the amount of starting sprouts.
On "New game" click, the value set by the slider should be used to generate a new game with the specified amount of points, overriding the old game.
Sprouts can be aligned in a circle, with the center at the center of the screen. Twink the radius and the distance between the points for various numbers of initial sprouts.
Sample user input (mouse, touch, ...) with respect to the speed of the motion (sample less often when the movement is slower). The sampled points should be connected and the final curve should be smoothened using Bézier curves (interactive example).
Add these Graph decorators:
WithEdgePair
- A new graph that adds a connection pair (a pair of opposite directed edges to the existing Graph). There should also be an overloaded constructor to pass in the Submove. Origin and direction are enough to build an edge pair.WihtoutEdgePair
- A new graph that removes a connection pair (a pair of opposite directed edges to the existing Graph)The list of methods to extract to separate classes:
updatedState()
(GraphTransformation: (Graph, Submove) --> Graph)crossPoint()
closestToTheEnd()
Idea: Pass Transformation and Search objects as a constructor argument to a special implementation of the Graph and Vertex interfaces?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.