Search found 63 matches

by onedaysnotice
Fri Jun 29, 2012 8:31 am
Forum: General
Topic: How to check the end of a string?
Replies: 10
Views: 4612

Re: How to check the end of a string?

how do I truncate any excess chars? like if i have str = awasdawasd how do I truncate every char after the 5th? i've tried this if player[i].actionString:len() > 5 then player[i].actionString:gsub(player[i].actionString:sub(6), "") end among other things but none of them have worked :(
by onedaysnotice
Fri Jun 29, 2012 7:36 am
Forum: General
Topic: How to check the end of a string?
Replies: 10
Views: 4612

Re: How to check the end of a string?

thanks :D
by onedaysnotice
Fri Jun 29, 2012 5:56 am
Forum: General
Topic: How to check the end of a string?
Replies: 10
Views: 4612

How to check the end of a string?

like suppose I have a string:

string = "abcdef"

how could I check a specific number of end characters so that I can do something like:

IF the end of string is "ef" THEN
....
END

thanks :D
by onedaysnotice
Thu Jun 28, 2012 7:24 am
Forum: General
Topic: How can I change this to incorporate both players?
Replies: 2
Views: 956

Re: How can I change this to incorporate both players?

Instead of "p1" use just indexes, i.e. define them as: player = { [1] = { stuff }, [2] = { stuff } } Use a for loop from 1 to 2 to create each player the same if you need. Then change each players specifically different data, like location on screen if you need to. i.e.: player = {} for i...
by onedaysnotice
Thu Jun 28, 2012 6:24 am
Forum: General
Topic: How can I change this to incorporate both players?
Replies: 2
Views: 956

How can I change this to incorporate both players?

Without rewriting everything for Player 2. I've tried so many things I've already lost count... Dx if player.p1.state == "jumping" then player.p1.y = player.p1.y + player.p1.y_vel * dt player.p1.y_vel = player.p1.y_vel + gravity * dt if player.p1.y + player.p1.h > floor.y then player.p1.y ...
by onedaysnotice
Sun Jun 24, 2012 12:38 pm
Forum: Support and Development
Topic: how to find the width and height of an image?
Replies: 3
Views: 4441

Re: how to find the width and height of an image?

rokit boy wrote:EDIT: You don't need to thank for the speedy reply, everyone here replies really fast (!)
thanks anyways! :D
by onedaysnotice
Sun Jun 24, 2012 12:25 pm
Forum: Support and Development
Topic: how to find the width and height of an image?
Replies: 3
Views: 4441

how to find the width and height of an image?

i don't want to use fixed values :S

i was thinking love.graphics.getWidth(img) but that didn't work :(
by onedaysnotice
Sun Jun 24, 2012 9:32 am
Forum: Support and Development
Topic: printf and alignment....
Replies: 4
Views: 3722

Re: printf and alignment....

Oh *facepalm*. I thought the "center" alignment centers the text on that point... lol. So what "center" does is calculate the center of the screen and adds that to the x coordinate? Thanks :D.
by onedaysnotice
Sun Jun 24, 2012 9:18 am
Forum: Support and Development
Topic: printf and alignment....
Replies: 4
Views: 3722

printf and alignment....

There's "left", "center" and "right" alignments right? I'm trying to center the text on the window and "center" puts it on the right hand side of the screen..... =_= (check the second slide). EDIT: I frkn keep on compressing the folder rather than the files Dx.
by onedaysnotice
Tue Jun 12, 2012 9:40 am
Forum: General
Topic: Role of "_" in for loops?
Replies: 5
Views: 2636

Re: Role of "_" in for loops?

Ok thanks heaps guys :D