Search found 55 matches

by 0x72
Thu Jan 12, 2017 5:24 pm
Forum: General
Topic: problems with game state and clicking mouse
Replies: 2
Views: 1814

Re: problems with game state and clicking mouse

Hi! Sorry for lengthy answer; I hope that it's helpful nonetheless: Ad. #1 Problem Take a look on your `love.mousereleased` in theMouse.lua - you have there something like: function love.mousereleased(x, y, button) if estadoJogo == "splash" then -- here sometimes do: estadoJogo = "jog...
by 0x72
Tue Jan 10, 2017 7:00 pm
Forum: Support and Development
Topic: Shape is not rotating
Replies: 5
Views: 3888

Re: Shape is not rotating

I believe that it's rotating properly but you're drawing it wrong. retangulo.body:getX(),retangulo.body:getY() seams to give you the center of the shape (by default at least) while love.graphics.draw's x and y arguments are supposed to be top-left corner. You can offset it with ox and oy of love.gra...
by 0x72
Thu Jan 05, 2017 5:41 pm
Forum: General
Topic: How to enter a text string into a text variable from the keyboard
Replies: 3
Views: 2809

Re: How to enter a text string into a text variable from the keyboard

This is very primitive input (and button) but I hope it'll help. Basically don't think in terms of waiting as the game should not wait (not in a way a cli apps does with io.read()) - it rather reacts to events and you just hold some state (if needed) in a variable. Read about love.textinput and love...
by 0x72
Wed Dec 28, 2016 12:21 am
Forum: Libraries and Tools
Topic: 1K Asteroids Challenge
Replies: 20
Views: 12912

Re: 1K Asteroids Challenge

Merry Christmas! The challenge was fun, thanks! :D My entry: 994B controls: A: turn left D: turn right W: accelerate L: fire guidelines: - all should be covered extras: - asteroids breaks into smaller pieces - spaceship thruster "animation" - points cheating: - the spaceship is circle (rat...
by 0x72
Sat Sep 10, 2016 2:16 pm
Forum: Support and Development
Topic: Problem with x,y scaling
Replies: 8
Views: 5678

Re: Problem with x,y scaling

Your default Color3 is black (i.e. "multiply every color by 0 so it's all black whatever texture is used"). I've changed Color3.new so it defaults to white (lines 12-14) and it works great col3.r = Clamp(r or 255, 0, 255) col3.g = Clamp(g or 255, 0, 255) col3.b = Clamp(b or 255, 0, 255) Wh...
by 0x72
Wed Sep 07, 2016 8:58 am
Forum: Support and Development
Topic: Break an if statement
Replies: 7
Views: 5966

Re: Break an if statement

what you need is elseif
by 0x72
Wed Sep 07, 2016 8:00 am
Forum: Support and Development
Topic: Dead simple threads example
Replies: 12
Views: 11329

Re: Dead simple threads example

My bet is you mean something like that: function love.load() -- update/draw/whatever other_later_defined_function() -- valid call end -- other_later_defined_function() -- this would be an error function other_later_defined_function() -- definition print('foobar') end It might not be obvious at glanc...
by 0x72
Tue Sep 06, 2016 4:34 pm
Forum: Support and Development
Topic: Dead simple threads example
Replies: 12
Views: 11329

Re: Dead simple threads example

Consider this code, I hope it'll make the thing clear: -- using codesting, but as you can see just a filename would be much cleaner local backend_logic_str = [[ love.timer = require('love.timer') -- you won't have it out of box in new thread channel = love.thread.getChannel( 'backend_logic_channel' ...
by 0x72
Fri May 20, 2016 10:08 am
Forum: Games and Creations
Topic: 1K Breakout challenge
Replies: 23
Views: 12197

Re: 1K Breakout challenge

V2 (aka shamelessly stealing ideas from others :P) changes: - no dt - update merged into draw - drawing and updating bricks in one loop - only resizable with conf.lua - inline one a few variables - controlled with A and D instead of arrows - more interesting map :) - remove newline from the last lin...
by 0x72
Thu May 19, 2016 11:09 am
Forum: Games and Creations
Topic: 1K Breakout challenge
Replies: 23
Views: 12197

Re: 1K Breakout challenge

927 926 920 917 912 898 :) (only 3rd "Extra credit" though) L,m=love,math n,N,a=m.min,m.max,m.abs g,k=L.graphics,L.keyboard.isDown R=g.rectangle H,S,s,T,W=50,500,200,595,150 t=function(l,r,w,h)return not(x<l or x>l+w or y<r or y>r+h)end w,h=50,20 v,u=1.19,1.95 F='fill' function D() X,B,x,...