Search found 27 matches
- Thu Aug 02, 2012 9:00 pm
- Forum: Libraries and Tools
- Topic: Bullet and moving circle collision
- Replies: 5
- Views: 2603
Re: Bullet and moving circle collision
I created this benchmark to test all possible variants of functions. Lessons learned: x*x is faster than x^2 code splitted to several functions is slower than one big function somehow calling length function in love.update() is faster than calculating length with formula. Why? p.s. press space to ch...
- Thu Aug 02, 2012 7:52 pm
- Forum: Libraries and Tools
- Topic: Bullet and moving circle collision
- Replies: 5
- Views: 2603
Re: Bullet and moving circle collision
I compared your code with mine and I see that this is the same math. Even more I realized what my function collides two moving circles, you just pass sum of radiuses as cr parameter. Then I benchmarked all this three functions with one million collisions checks. My function is little bit faster than...
- Thu Aug 02, 2012 4:32 pm
- Forum: Support and Development
- Topic: Scaled up retro low res graphics issues.
- Replies: 10
- Views: 5458
Re: Scaled up retro low res graphics issues.
I think drivers will not allow me to set resolution like 480x270.
Also i want allow to run my game windowed.
Also i want allow to run my game windowed.
- Thu Aug 02, 2012 4:05 pm
- Forum: Support and Development
- Topic: Scaled up retro low res graphics issues.
- Replies: 10
- Views: 5458
Re: Scaled up retro low res graphics issues.
I understand how to make this with Canvas. But what if Canvas is not supported? And if there are several methods to do this, which one is fastes?Lafolie wrote:Just run the game at a low resolution and scale it up at runtime
- Wed Aug 01, 2012 10:10 pm
- Forum: Libraries and Tools
- Topic: Bullet and moving circle collision
- Replies: 5
- Views: 2603
Bullet and moving circle collision
I created this just for learning purposes after experimenting with framerate-independent motion -- Check if circle collides with bullet -- -- Input: -- -- bx, by - bullet coordinates at start -- bu, bv - bullet speed -- -- cx, cy - circle coordinates at start -- cu, cv - circle speed -- cr - circle ...
- Tue Jul 31, 2012 7:00 pm
- Forum: General
- Topic: Email validation code using Pattern Matching
- Replies: 9
- Views: 10571
Re: Email validation code using Pattern Matching
print(string.match(email,'^[%w+%.%-_]+@[%w+%.%-_]+%.%a%a+$')) Good point. It gets closer to what I proposed first. Whatever, this regex will validate strings containing for instance two or more punctuation characters following themselves... Something like Darth..Vader@DeathStar.mil Unfortunately, p...
- Mon Jul 30, 2012 9:08 pm
- Forum: General
- Topic: Email validation code using Pattern Matching
- Replies: 9
- Views: 10571
Re: Email validation code using Pattern Matching
first: you should know how valid email address looks like second: check Lua docs 5 minutes ago i had known nothing about Lua's pattern matching. Now, after reading this two short texts, what we can do with your email pattern? Lets assume what you will never see monster-addreses like examples on wiki...