Slick Forums

Discuss the Slick 2D Library
It is currently Sun May 26, 2013 1:10 am

All times are UTC




Post new topic Reply to topic  [ 170 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 12  Next
Author Message
 Post subject:
PostPosted: Sun Jul 31, 2011 11:55 am 
Offline

Joined: Wed May 04, 2011 9:51 pm
Posts: 12
Hi, I'm creating a game with MarteEngine and I want feedback when I click on one entity of my world, like this:

Code:
if (input.getMouseX() < x + hitboxWidth && input.getMouseX() > x
                    && input.getMouseY() < y + hitboxHeight &&
input.getMouseY() > y) {
                System.out.println("presed " + this.name);
}



And all its okay when there is only one entity, but when I put 2 of the same class, only works the first, and I don't understand this behavior, any idea?


Thanks a lot!

EDIT: I copy this code to the world render and all its okay. Thanks :)


Top
 Profile  
 
PostPosted: Wed Aug 17, 2011 5:13 am 
Offline

Joined: Wed Aug 17, 2011 4:56 am
Posts: 3
Location: United States
I'm currently working on a game using the Marte Engine. In my previous projects, I've found that test driven development is a very efficient way for me to work. However, I'm not sure how I would go about setting up a test suite for my project, or at least the update method, as it requires a running game environment.

Any suggestions as to how I might set up my JUnit tests to be able to test my code?

Edit: I suppose I could write an update method that just takes the delta and has the logic relevant to that class in it. Alternately, I could extend PhysicsEntity (the class nearly everything in my game is descended from) and basically paste the update code from the PhysicsEntity update method into an update(delta) one and just have the update(GameContainer, delta) method call it.

I just wanna do JUnit testing, dagnabbit!


Top
 Profile  
 
 Post subject: API and Animation
PostPosted: Sat Aug 27, 2011 6:37 pm 
Offline

Joined: Tue Aug 16, 2011 2:17 am
Posts: 31
Location: Phoenix
First, is there an API doc somewhere? I've just been using methods found in tutorials, but it'd be nice to have a API doc...

Secondly, how do i stop my animation?
I have this init:
addAnimation(ME.WALK_LEFT, true, 1, 0, 1, 2, 3, 4);

and then this update:
if (check("RIGHT")) {
currentAnim = ME.WALK_RIGHT;
}

but after i let go my character just keeps doing the running animation in that direction


Top
 Profile  
 
 Post subject: Nice engine!
PostPosted: Sun Aug 28, 2011 12:39 am 
Offline

Joined: Sun Aug 21, 2011 9:08 am
Posts: 8
Nice engine! I'd love to work on this, but could you guys please use 4 spaces instead of tabs? I wouldn't mind hosting a Javadoc when 0.3 comes out. I'll be using this in an MMO I'm making.

_________________
I like programming for fun. Money is good too.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 28, 2011 5:57 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
hi !

@Nightmare:
1)there is no API doc for 0.2 or 0.3 (still in dev, but usable). You can always download source code for git and read javadoc directly from code?
2) you have created a looping animation, so it's "keep running" when started. You have to add a "stand" animation and when player is not pressing any button, change with that animation

@albireox: I'm using for 0.3 eclipse java standard formatter, so there is nothing I could do for now ( and tommy is merging my code with his branch, so changin format could not be affordable for now, sorry). MMO you are making? Wow, good luck!! A Big project!

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 29, 2011 11:29 pm 
Offline

Joined: Tue Aug 16, 2011 2:17 am
Posts: 31
Location: Phoenix
Thank you Gornova81


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 30, 2011 6:31 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
Nightmare wrote:
Thank you Gornova81


Does it work?

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2011 11:42 am 
Offline
Regular

Joined: Sun Oct 25, 2009 5:24 pm
Posts: 118
I'd really like a tutorial/wiki entry on using and customizing the camera, I still can't wrap my around it completely :D


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2011 1:43 pm 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
I have already as issue on github :D merge with tommy's branch will be done soon and fixing tutorials is next on the list :D

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 02, 2011 1:57 pm 
Offline
Regular

Joined: Sun Oct 25, 2009 5:24 pm
Posts: 118
Ok great, can't wait :) Keep up the good work.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 04, 2011 4:51 am 
Offline

Joined: Tue Aug 16, 2011 2:17 am
Posts: 31
Location: Phoenix
Can i use marteengine on android? If so please post example project or instructions! much appreciated!


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 04, 2011 8:02 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
Never tried yet, I don't seen any problem: if you use Slick-AE, you can use MarteEngine

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2011 5:48 am 
Offline

Joined: Tue Aug 16, 2011 2:17 am
Posts: 31
Location: Phoenix
Well I have MarteEngine working on Android, using Slick-AE. Could someone be kind enough to tell me why my movement methods in Paddle.java aren't working though?

MarteEngine Android Example:
http://db.tt/FpACAoi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2011 6:27 am 
Offline
Slick Zombie

Joined: Wed Apr 02, 2008 1:32 pm
Posts: 1315
Location: Italy
coool! must try it!

_________________
Blog | Last game Gravity Duck tribute | In progress Gravity Duck tribute


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 06, 2011 7:26 am 
Offline

Joined: Tue Aug 16, 2011 2:17 am
Posts: 31
Location: Phoenix
As I incorporated MarteEngine with Slick-Ae I've found it works great, the only bug I've come across is input not working. I've triple checked my code and it seems everything is right. Just a problem with input i take it? I'm guessing Slick-AE uses a diffrent input method than normal Slick which is causing the code passed by MarteEngine to fail, havn't had time to check but someone else might want to... (or i failed in my input code somewhere :P)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 170 posts ]  Go to page Previous  1 ... 4, 5, 6, 7, 8, 9, 10 ... 12  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group