My ongoing newbie questions
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: My ongoing newbie questions
You still forgot my first comment: x ~= n
Help us help you: attach a .love.
Re: My ongoing newbie questions
Q. What does "No matching function for overloaded 'draw'" mean, when I try and run my game and there's a showstopping error?
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: My ongoing newbie questions
That one is a classic. You'll get that a lot. It means the wrong type is fed into the love.grahics.draw() function. You can check the type of the first argument by printing it. You probably made a typo, or forgot to index a table, or something like that.
Help us help you: attach a .love.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: My ongoing newbie questions
Be warned, that is the most frequently found cause of that error, but it might mean more. It could be:
- One of your arguments is not what it expects (userdata or string as 1st argument), could be nil
- There are too much arguments
- There are not enough arguments (I sometimes forget to pass coordinates when I want to debug something)
- An earlier call failed, so you're passing a nil value without knowing it
- Probably others
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: My ongoing newbie questions
@bartbes: you are completely right.
@essell: what we're trying to say here is: to fix this, you have to make sure you are passing the right arguments. To see what they are, try print()ing them before the love.graphics.draw().
@essell: what we're trying to say here is: to fix this, you have to make sure you are passing the right arguments. To see what they are, try print()ing them before the love.graphics.draw().
Help us help you: attach a .love.
Re: My ongoing newbie questions
Righto - I'll try it the next time it comes up.
Q. I'm trying to implement some really basic kind of collision detection (bullets hitting the player / enemies). What's the simplest / suggested way of doing this?
Q. I'm trying to implement some really basic kind of collision detection (bullets hitting the player / enemies). What's the simplest / suggested way of doing this?
Re: My ongoing newbie questions
some what easy and accurate would be to use loves physics system
super easy but very inaccurate would be to just have imaginary boxes defined around an object and check xy pos's, if the bullet is in the box, hit
ie:
if bullet x,x is inside of head x,y then splatter_brains()
super easy but very inaccurate would be to just have imaginary boxes defined around an object and check xy pos's, if the bullet is in the box, hit
ie:
if bullet x,x is inside of head x,y then splatter_brains()
Re: My ongoing newbie questions
Okeydokey - I'm having a go at implementing the physics stuff.
[Edit] Done! But now my previous means of moving the player character...
...Doesn't work anymore.
Q. Is this because the player is now a physics object, meaning I have to manipulate it's position differently? If so, how?
[Edit] Done! But now my previous means of moving the player character...
Code: Select all
if love.keyboard.isDown(love.key_right) then
playerx = playerx + movespeed * dt
end
Q. Is this because the player is now a physics object, meaning I have to manipulate it's position differently? If so, how?
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: My ongoing newbie questions
It's known there are some issues with applyImpulse and applyForce, so an alternative is setVelocity (on the body).
Re: My ongoing newbie questions
Am having trouble figuring this out (player movement with physics).
Q. Can anyone suggest a Love game to refer to as a simple example of pressing arrow keys to move an avatar around in a basic physics-enabled world?
Q. Can anyone suggest a Love game to refer to as a simple example of pressing arrow keys to move an avatar around in a basic physics-enabled world?
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Semrush [Bot] and 2 guests