[Solved] Trying to make a simple platformer

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
bramblez
Citizen
Posts: 50
Joined: Sun Jul 29, 2012 1:21 pm
Location: Russia, Moscow

[Solved] Trying to make a simple platformer

Post by bramblez »

Hello everyone, I am trying to make a platformer game and I was watching goature's tutorial videos about making one and I followed his every step, except I've tried to make my own menu too. I keep getting this same error all the time
"attempt to call field 'clamp' ( a nill value )"

what am I doing wrong?
Last edited by bramblez on Mon Feb 11, 2013 2:16 am, edited 2 times in total.
User avatar
Saegor
Party member
Posts: 119
Joined: Thu Nov 08, 2012 9:26 am
Location: Charleroi

Re: [Not solved] Trying to make a simple platformer

Post by Saegor »

i guess you use a libray wich use another library that is not present in your game

math.clamp is something provided by a lib that miss but i don't remember the name

let me search a bit ;)

EDIT 1: mmh... camera...

EDIT 2 : it works if you declare a math.clamp function somewhere (in main.lua for example)

so, try to add this :

Code: Select all

function math.clamp(x, min, max)
  return x < min and min or (x > max and max or x)
end
Current work : Isömap
User avatar
bramblez
Citizen
Posts: 50
Joined: Sun Jul 29, 2012 1:21 pm
Location: Russia, Moscow

Re: [solved] Trying to make a simple platformer

Post by bramblez »

That helped! thanks alot! :)
davisjl1979
Prole
Posts: 1
Joined: Fri Mar 08, 2013 5:16 pm

Re: [Solved] Trying to make a simple platformer

Post by davisjl1979 »

I'm having the same problem. I'm using the followinghttp://www.explodingrabbit.com/forum/en ... -03-0.717/ and my code is an exact match to his but I'm getting the same error as OP.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], darkfrei, Google [Bot] and 4 guests