## Search found 873 matches

Tue May 03, 2016 11:42 am
Forum: Support and Development
Topic: How to represent 3d objects in 2d
Replies: 16
Views: 3957

### Re: How to represent 3d objects in 2d

That bit of code node.x = (x * cos - y * sin) node.y = (y * cos + x * sin) is a matrix multiplication of the matrix $\begin{pmatrix} \cos\alpha & -\sin\alpha\\ \sin\alpha & \cos\alpha \end{pmatrix}$ with the vector $\begin{pmatrix}node.x \\ node.y\end{pmatrix}$. Matrices (or rather matrix-vector...
Sat Apr 30, 2016 9:19 pm
Forum: General
Topic: HSL to RGB converter
Replies: 5
Views: 2604

### Re: HSL to RGB converter

The code is a literally just the definition of HSL to RGB. You don't need a license for this.
Sat Apr 30, 2016 1:37 pm
Forum: Support and Development
Topic: Implementing collisions
Replies: 2
Views: 738

### Re: Implementing collisions

You will need some central place that holds all the objects that can collide. In the simplest case, this is just a global table. In love.update(), you iterate over all the objects and check for collisions. You probably have something like this for drawing your objects: for obj1 in pairs(entities) do...
Sat Apr 30, 2016 9:16 am
Forum: Libraries and Tools
Topic: HUMP - yet another set of helpers
Replies: 145
Views: 48672

### Re: HUMP - yet another set of helpers

Actually, I created the Timer.script() inside the Obstacle.new() method, so it should run one time, I guess. Sorry for answering so late, but better late than never: The actual problem with the origin script obstacleTimer.script(function(wait) while true do obstacleTimer.tween(7, self, {distFromMid...
Sat Apr 30, 2016 9:09 am
Forum: Games and Creations
Replies: 8
Views: 3039

... that makes things that look pretty:
pretty-1.png (328.61 KiB) Viewed 3039 times
pretty-2.png (286.92 KiB) Viewed 3039 times
pretty-3.png (302.33 KiB) Viewed 3039 times
pretty-4.png (284.71 KiB) Viewed 3039 times
Also, the .love animates the things!
Sun Apr 24, 2016 3:13 pm
Forum: Libraries and Tools
Topic: HUMP - yet another set of helpers
Replies: 145
Views: 48672

### Re: HUMP - yet another set of helpers

I need some help with camera coordinates. I didn't go too deep into you code, but you shouldn't need to transform the coordinates for drawing; just draw the sprite at object.x, object.y. camera:worldCoords() is only needed to figure out where some point on the screen (between 0,0 and width/height o...
Sun Apr 17, 2016 7:02 pm
Forum: Libraries and Tools
Topic: [Lib] SUIT - Simple User Interface Toolkit
Replies: 80
Views: 27332

### Re: [Lib] SUIT - Simple User Interface Toolkit

So, this code: local suit = require 'suit' function love.update(dt) suit.layout:reset(100,100, 10,10) suit.Button("btn", suit.layout:row(200,30)) suit.layout:push(suit.layout:row()) suit.Button("btn1", suit.layout:col(95,30)) -- (200 - padding) / 2 suit.Button("btn2", suit.layout:col()) suit.layout:...
Sun Apr 17, 2016 6:14 pm
Forum: Libraries and Tools
Topic: HUMP - yet another set of helpers
Replies: 145
Views: 48672

### Re: HUMP - yet another set of helpers

Timer.script is great for things like this. For example: Timer.script(function(wait) local time_passed = 0 while true do -- replace with terminating condition for i = 1,getNumberOfEnemies(time_passed) do spawnEnemy() end local time_to_wait = getWaitTime(time_passed) wait(time_to_wait) time_passed =...
Sun Apr 17, 2016 5:07 pm
Forum: Libraries and Tools
Topic: [Lib] SUIT - Simple User Interface Toolkit
Replies: 80
Views: 27332

### Re: [Lib] SUIT - Simple User Interface Toolkit

Sun Apr 17, 2016 5:00 pm
Forum: Libraries and Tools
Topic: HUMP - yet another set of helpers
Replies: 145
Views: 48672

### Re: HUMP - yet another set of helpers

tmpt.every(ti, print("Timer: "..ti)) will not work, because print("Timer: "..ti) is not a function. The correct usage would be tmpt.every(ti, function() print("Timer: "..ti) end) In any case, here is what you are doing right now: Every second, add a Timer instance, for which: Every two (three, four...