I've been working a project in TIGsource.com's newest competition, the Cockpit Compo. I'm currently looking for a collaborator to help with the code (esp. GUI elements), and since it's written in Love2d, I thought I'd post here to see if anyone was interested. You can see the status of the project and any mockups here: http://forums.tigsource.com/index.php?topic=4919.0
The (not great) code is available here: http://github.com/philnelson/cock-attack/tree/master
C.O.C.K. ATTACK
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: C.O.C.K. ATTACK
Just finished reading the other thread. GREAT!!!
Too bad I'm not going to help...
I did read you got LUBE working? Another reason why I should love your game.
Ah.... *just enough reason left to push the submit button*
Too bad I'm not going to help...
I did read you got LUBE working? Another reason why I should love your game.
Ah.... *just enough reason left to push the submit button*
-
- Prole
- Posts: 48
- Joined: Sun Feb 01, 2009 3:32 am
Re: C.O.C.K. ATTACK
Yes! LUBE is working, in fact. Right now it can just send strings back and forth (we implemented a super crude version of IRC basically). I may release that part of the code as a simple demo for LUBE. Once I can figure out a good way to create simple UI buttons and so forth, anyway.
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: C.O.C.K. ATTACK
I already implemented IRC once on a hacked-up version of LUBE (it didn't support tcp back then).. well I'll wait and see what becomes of this wonderful mix of acronyms.
-
- Prole
- Posts: 48
- Joined: Sun Feb 01, 2009 3:32 am
Re: C.O.C.K. ATTACK
Having a lot of trouble right now deciding on how to create "buttons" and so forth in the UI. I'm interested in how other people accomplish this.
The way I'm doing it is like this, in pseudocode:
but I'm kind of stumbling w/r/t how to implement this in Love2d with the buttons corresponding to multiple, totally different, screens.
The way I'm doing it is like this, in pseudocode:
Code: Select all
on mouse click
if the click happened in between these X and Y coordinates
do this stuff
end
end
- qubodup
- Inner party member
- Posts: 775
- Joined: Sat Jun 21, 2008 9:21 pm
- Location: Berlin, Germany
- Contact:
Re: C.O.C.K. ATTACK
My naive answer is: Create an "active" status for each button.philnelson wrote:but I'm kind of stumbling w/r/t how to implement this in Love2d with the buttons corresponding to multiple, totally different, screens.
Another tipp: use the physics part of love to use clipping to know if the mouse is over a button at time of press.
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
-
- Party member
- Posts: 215
- Joined: Sun Jan 18, 2009 8:03 pm
Re: C.O.C.K. ATTACK
I would suggest making the buttons object-oriented by keeping track of where they are, how they are drawn, and when they do when clicked. To assist you with this, you could use one of the existing GUI libraries. I would furthermore make each "screen" object-oriented, defining what UI components there are and how the screen is updated and drawn.philnelson wrote:Having a lot of trouble right now deciding on how to create "buttons" and so forth in the UI. I'm interested in how other people accomplish this.
The way I'm doing it is like this, in pseudocode:
but I'm kind of stumbling w/r/t how to implement this in Love2d with the buttons corresponding to multiple, totally different, screens.Code: Select all
on mouse click if the click happened in between these X and Y coordinates do this stuff end end
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
-
- Prole
- Posts: 48
- Joined: Sun Feb 01, 2009 3:32 am
Re: C.O.C.K. ATTACK
What's the deal with Lua and referring to table data in mathematical comparisons? I'm trying to do this
but I get an error that says I'm trying to compare a number to nil. I can display head_data.tohit. It is most definitely NOT nil.
Code: Select all
head_data = {tohit=6}
Code: Select all
tohit_roll = math.random(1,20)
if head_data.tohit <= tohit_roll then
do stuff
end
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: C.O.C.K. ATTACK
Try asserting it all, it might be that the random function somehow fails, give-me-all-errors-you-can-generate code:
This should tell you what the problem is and where it's located.
Code: Select all
head_data = {tohit=6}
assert(head_data, "head_data == nil")
assert(head_data.tohit, "head_data.tohit == nil")
tohit_roll = assert(math.random(1,20), "math.random(1,20) == nil")
if assert(head_data.tohit, "for loop can't read head_data.tohit") <= assert(tohit_roll, "for loop can't read tohit_roll") then
do stuff
end
-
- Prole
- Posts: 48
- Joined: Sun Feb 01, 2009 3:32 am
Re: C.O.C.K. ATTACK
Ah, I didn't even know about assert. Useful! Thanks.
Who is online
Users browsing this forum: No registered users and 3 guests