Hello,
So this is the first game I have ever made, I barely knew how to code before this, so I realize that the code may be a bit messy. It would be nice if someone could go over it and point out flaws. I tried to put it in order and document what I was doing.
The only thing I was not able to do was to get the duck to rotate constantly towards where the mouse clicks, the furthest I got was this:
--snuningur = mx / 203.82 and my / 131.68
You can activate it but it barely works, especially not when going flying to the left.
The way to color the text/font was also somewhat time confusing, I hope there is an easier/cleaner way to do it
How can you put the name of the game in the header? instead of it just being "untitled"
You use the left mouse button to fly!
Quack! A game about a duck
Quack! A game about a duck
- Attachments
-
- Light.love
- (1.7 MiB) Downloaded 345 times
Email: ic4ruz39@gmail.com
Re: Quack! A game about a duck
About the rotation towards mouse thing, you can use a bit of trig. First, get the X and Y position of the mouse and the duck. Move the mouse into the object space of the duck (mouse pos-duck pos). Then, because you know the lengths, you can get the angle. The angle you want is the topmost angle of the triangle, so you can use tangent^-1 to get this number. You know the opposite is the X of the object space and the adjacent the Y of it, so you can do math.atan(objX/objY) to find the angle! This will be in radians, by the way.
This may or may not be right, I'm tired, but you now know you can use trig. To wrap it up, assume "duckX" and "duckY" are the duck's pos and "mX" and "mY" are the mouse pos.
local ang=math.atan((mX-duckX)/(mY-duckY))
This may or may not be right, I'm tired, but you now know you can use trig. To wrap it up, assume "duckX" and "duckY" are the duck's pos and "mX" and "mY" are the mouse pos.
local ang=math.atan((mX-duckX)/(mY-duckY))
"your actions cause me to infer your ego is the size of three houses" -finley
Re: Quack! A game about a duck
i dont really understand this game. i went to the switch, had a little big of lag, the dead picture of my duck and a light appeared instead. and i couldn't do anything but quack in my sleep.
for title: http://www.love2d.org/wiki/Config_Files
for title: http://www.love2d.org/wiki/Config_Files
Lua is not an acronym.
Re: Quack! A game about a duck
Thank you for the post LuaWeaver, I will try that.
Hehe (: ,qaisjp That light thing was supposed to be the "soul" leaving the body, or something like that .
The game developed strangely, I had already drawn the lamp before I decided to experiment with Löve, so I had to think of some way to incorporate some gameplay with it. I wanted also to have a bird and flying. So that's why the bird turns the lamp on the way he does. That lag is the lamp turning on, it takes some time, as the sound that plays with it shows.
Hehe (: ,qaisjp That light thing was supposed to be the "soul" leaving the body, or something like that .
The game developed strangely, I had already drawn the lamp before I decided to experiment with Löve, so I had to think of some way to incorporate some gameplay with it. I wanted also to have a bird and flying. So that's why the bird turns the lamp on the way he does. That lag is the lamp turning on, it takes some time, as the sound that plays with it shows.
Email: ic4ruz39@gmail.com
Re: Quack! A game about a duck
This is one of the strangest and most surreal games I have ever played. I find it very amusing
My game called Hat Cat and the Obvious Crimes Against the Fundamental Laws of Physics is out now!
Re: Quack! A game about a duck
So, when you're drawing the duck you need:
Ignore the ellipsis, that means nothing. Then, in love.update do this:
Depending on your picture you may have to add or subtract to get it to look right.
Code: Select all
love.graphics.draw( pic_name, x, y, DIR, ... )
Code: Select all
DIR = math.atan2( player.y - mouseY, player.x - mouseX )
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Quack! A game about a duck
Thanks, I will try that!davisdude wrote:So, when you're drawing the duck you need:Ignore the ellipsis, that means nothing. Then, in love.update do this:Code: Select all
love.graphics.draw( pic_name, x, y, DIR, ... )
Depending on your picture you may have to add or subtract to get it to look right.Code: Select all
DIR = math.atan2( player.y - mouseY, player.x - mouseX )
Yes I am from Iceland, þú lika?veethree wrote:Are you icelandic/danish or something like that?
Thank you T-Bone!T-Bone wrote:This is one of the strangest and most surreal games I have ever played. I find it very amusing
I realised a few days ago that I could hand draw the duck and animate, and it looks fantastic! Only problem is that I have the duck moving and a white box in the background with it, is there any way to make everything transparent except the are of drawing? in Asesprite or paint ?
There is also a conf.lua file, so now there is a name in the title of the window.
Email: ic4ruz39@gmail.com
Re: Quack! A game about a duck
Yes. I prefer a free open source editing software called Gimp. You can download it here: http://www.gimp.org/I realised a few days ago that I could hand draw the duck and animate, and it looks fantastic! Only problem is that I have the duck moving and a white box in the background with it, is there any way to make everything transparent except the are of drawing? in Asesprite or paint ?
Just note that if the resolution of your image is not good, it may take a very long time.
Anyway, to get the background transparent do these 3 things:
1) Open gimp and then open your picture.
2) Move your mouse over layer, then transparency, then add Alpha Channel and click on it.
3) Click the 'fuzzy selector tool' (the one that looks like a magic wand). Then, click on the area you want to delete. Assuming it's all the same color it lined border will appear around everything. Click delete to remove it. If you ever make a mistake you can press 'cntrl' and 'z' or find the undo button.
Note that if you edit it again in another form (say MS Paint) that you will have to do this over again, so keep edits to a minimum/ have your picture ready before this stage.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Re: Quack! A game about a duck
You can also use paint.NET. It's also free, but it kinda looks and works like Paint except it has a whole bunch of added cool and usable features, including background transparancy.
Who is online
Users browsing this forum: No registered users and 1 guest