Search found 50 matches

by gcmartijn
Sat Sep 05, 2020 6:04 am
Forum: Support and Development
Topic: how to get the compass direction between two points ?
Replies: 11
Views: 11464

how to get the compass direction between two points ?

Hi, I'm trying to do some simple thing but I do fail over and over I did try about 20 different things. The idea is very simple I want to get the compass direction from the current position heading to the destination. At the moment I use vectors using https://github.com/themousery/vector.lua . So I ...
by gcmartijn
Thu Aug 20, 2020 7:31 pm
Forum: Support and Development
Topic: Memory Profiling?
Replies: 27
Views: 13335

Re: Memory Profiling?

Thanks for the suggestion, I will give it a try.

I use this memory profiler at the moment:
https://gist.github.com/rm-code/383c98a ... 7ae536bcc5

What I do is run the game with 1 entity object, and re-run it with 10.000 entities.
by gcmartijn
Wed Aug 19, 2020 7:22 pm
Forum: Support and Development
Topic: Memory Profiling?
Replies: 27
Views: 13335

Re: Memory Profiling?

Make sure you set any unused references to nil otherwise the garbage collector can't release that memory. I need to test this, but what about something like this. function add (data) local rawdata = data --- do things return something end local x = add({bla}) Do we always need to set variable to ni...
by gcmartijn
Sat May 09, 2020 5:07 pm
Forum: Support and Development
Topic: love.graphics.draw are the x and y floats ? is floor needed ?
Replies: 7
Views: 2127

Re: love.graphics.draw are the x and y floats ? is floor needed ?

Thanks for the info.

I want pixel accurate because I'm going to bind multiple moving drawing images together, in combination with old school graphics.
So I'm already using.

Code: Select all

love.graphics.setDefaultFilter("nearest", "nearest")
love.graphics.setLineStyle("rough")
by gcmartijn
Sat May 09, 2020 4:29 pm
Forum: Support and Development
Topic: love.graphics.draw are the x and y floats ? is floor needed ?
Replies: 7
Views: 2127

Re: love.graphics.draw are the x and y floats ? is floor needed ?

Oke, so now I'm going to floor all draw functions.

But what about the translate and transform actions ?
Do I need to floor them ?

Are there other function that I need to know, where I need to use floor from now on ?
by gcmartijn
Sat May 09, 2020 3:41 pm
Forum: Support and Development
Topic: love.graphics.draw are the x and y floats ? is floor needed ?
Replies: 7
Views: 2127

love.graphics.draw are the x and y floats ? is floor needed ?

H! I first need to understand what all x and y positions need to be when drawing/translating/scaling, before I can debug a 'glitch' problem. At the moment I have a two simple images (head and a body), that are moving using vector movement. Sometimes I can see a 1px y offset during the walking moveme...
by gcmartijn
Tue May 05, 2020 5:14 pm
Forum: Support and Development
Topic: How to offset something, and draw the end product at the correct position.
Replies: 3
Views: 989

Re: How to offset something, and draw the end product at the correct position.

just doing love.graphics.translate(10,10) and then drawing at 0,0 would draw at 10,10. I found the bug in my program, after that you say that. I can now do the x and y offset and use translate to place the image at the location I want. And because I don't want to do that for all images in the game,...
by gcmartijn
Tue May 05, 2020 10:40 am
Forum: Support and Development
Topic: How to offset something, and draw the end product at the correct position.
Replies: 3
Views: 989

How to offset something, and draw the end product at the correct position.

I have to say, love2d is fun ! Where can I find visual tutorial about transform and translate. I'm trail and error now with a simple thing. I have multiple images frames that I want to center using their max width (the frames don't have the same with). That part is working, and the animation is play...
by gcmartijn
Sun Dec 29, 2019 8:04 am
Forum: Support and Development
Topic: The game loop
Replies: 4
Views: 2325

Re: The game loop

DeltaTime The correct way of doing this is of course using deltatime. I really need some cheating sheet what math (deltatime) I need to use and when. Because it can be hard to implement that in some scenarios. source: https://medium.com/@tglaiel/how-to-make-your-game-run-at-60fps-24c61210fe75 Vec3D...
by gcmartijn
Sat Dec 28, 2019 6:59 pm
Forum: Support and Development
Topic: The game loop
Replies: 4
Views: 2325

The game loop

H!, -- start boring intro (you can skip this intro if you want) I'm a new love2d user, and going to try love2d (old monkey2 / nim-lang coder ;)) But I don't want to start creating a game before I get the most important thing '100%' correct. I want to create a simple 'adventure game' with simple coll...