Search found 90 matches

by Xii
Wed Mar 24, 2021 8:56 am
Forum: Support and Development
Topic: Drawing a textured line
Replies: 2
Views: 2089

Re: Drawing a textured line

You can have the texture as its own texture (not part of an atlas), and repeat it by using texture coordinates larger than the texture itself. When you love.graphics.newQuad() you pass the width and height of the quad in the texture. Pass in values greater than the texture's width or height, and you...
by Xii
Mon Mar 22, 2021 10:26 am
Forum: General
Topic: Example code of Platformer AI
Replies: 15
Views: 6528

Re: Example code of Platformer AI

If the levels are handcrafted (not procedural), you can manually place "jump points" on platform edges that instruct entities they can jump across. Then it's just a matter of deciding to go left or right to find the goal. If there's lots of verticality, it gets more complicated and you pro...
by Xii
Thu Mar 18, 2021 10:01 am
Forum: Games and Creations
Topic: Playable concept: Gridiron - 2D top-down with physics engine
Replies: 6
Views: 3227

Re: Playable concept: Gridiron - 2D top-down with physics engine

SQLite is very commonly used on Android.
by Xii
Thu Mar 04, 2021 12:16 am
Forum: General
Topic: That facepalm moment when ...
Replies: 11
Views: 5643

Re: That facepalm moment when ...

hey, why is it printing 1 1? Took me a moment to get it. Within the function, the local parameter named "vector" is assigned to point to something else. It's illustrated by renaming this variable: function update_vector (localparameter) localparameter = {0,0} end local vector = {1,1} upda...
by Xii
Wed Mar 03, 2021 10:47 pm
Forum: Libraries and Tools
Topic: Luafinding - fast, efficient & easy A* pathfinding library
Replies: 7
Views: 2614

Re: Luafinding - fast, efficient & easy A* pathfinding library

You should be able to modify the Vector class and add support for 3 dimensions super easily, just make sure the :ID() function generates a unique number for each Vector, or am I misunderstanding you? Well sure I could modify everything around the A* algorithm to adapt it to other topologies, but I'...
by Xii
Wed Mar 03, 2021 6:56 pm
Forum: Libraries and Tools
Topic: Luafinding - fast, efficient & easy A* pathfinding library
Replies: 7
Views: 2614

Re: Luafinding - fast, efficient & easy A* pathfinding library

You've locked into using a 2-dimensional regular grid. My maps aren't regular grids, so I can't use this. A generic pathfinding library wouldn't care about the topology of the game world, and would instead implement callbacks to get neighboring cells, etc. which is topology-agnostic.
by Xii
Fri Feb 26, 2021 8:55 pm
Forum: General
Topic: Any idea in implementing steering behaviour
Replies: 19
Views: 4630

Re: Any idea in implementing steering behaviour

Oh, you have a grid. My bad. Forget everything I said.

A* is the way to go. Instead of a binary "open/obstacle" value, generate a heatmap of your obstacles. A* will then "avoid" them on its way to the goal.
by Xii
Thu Feb 25, 2021 12:16 pm
Forum: General
Topic: Any idea in implementing steering behaviour
Replies: 19
Views: 4630

Re: Any idea in implementing steering behaviour

The inverse square of the distance is actually 1/d², it's NOT the square root . Since calculating the distance involves a square root, that square root cancels with the square. The result is: function inv_sqr_distance(x1, y1, x2, y2) return 1/((x2-x1)^2 + (y2-y1)^2) end I was looking at the sqrt in...
by Xii
Wed Feb 24, 2021 7:48 pm
Forum: Support and Development
Topic: Attempt to index local 'self' (a number value)
Replies: 10
Views: 2177

Re: Attempt to index local 'self' (a number value)

Oh hey this is like the Uniform Function Call Syntax from the D programming language.
Didn't know Lua has it too, thanks for educating me. :)
by Xii
Wed Feb 24, 2021 6:59 pm
Forum: General
Topic: Any idea in implementing steering behaviour
Replies: 19
Views: 4630

Re: Any idea in implementing steering behaviour

I really want to just find out how to get the inverse square of a distance and then weigh it against intitial subtracted vector . A point in 2-dimensional space is defined by two coordinates, x and y. The distance between two points is: -- returns the distance between points x1,y1 and x2,y2 functio...