Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (117)
games submitted by our members
Games in WIP (563)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Interpolators  (Read 3361 times)
0 Members and 1 Guest are viewing this topic.
Offline rafa_es

Junior Member





« Posted 2006-10-30 19:35:36 »

Hi,

I'm using distance and angle interpolators to make the doors on my game open and close. When a door is first picked it start the increase of the interpolators like this
1  
2  
pAI1e.startIncreasing(0);
pDI1e.startIncreasing(0);


When this door is picked again it starts the drecrease of the interpolators

1  
2  
pAI1e.startDecreasing(0);
pDI1e.startDecreasing(0);


The first time i click he door it increase the value fine, when i click the door again to close and again to open, it does not create the intermediary values for the interpolator.
Did i miss something?

Rafael
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #1 - Posted 2006-10-30 19:40:11 »

AFAIK, the interpolators don't use marvin's timing code, which is not really good. I don't know if there are similar classes which do a similar job taking that into account. In any case, that would be real easy to implement it.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline Marvin Fröhlich

Senior Member




May the 4th, be with you...


« Reply #2 - Posted 2006-10-30 20:03:55 »

AFAIK, the interpolators don't use marvin's timing code, which is not really good. I don't know if there are similar classes which do a similar job taking that into account. In any case, that would be real easy to implement it.

Interfaces:
org.xith3d.behaviors.Animatable

Classes:
org.xith3d.behaviors.impl.AnimatableGroup
org.xith3d.behaviors.impl.Bullet
org.xith3d.behaviors.impl.GroupAnimator
org.xith3d.behaviors.impl.GroupRotator
org.xith3d.behaviors.impl.GroupTranslator
org.xith3d.behaviors.impl.RotatableGroup
org.xith3d.behaviors.impl.TranslatableGroup

Please to a fresh SVN checkout, since there was a misspelling of GroupRotator which was named GroupRotater.

See org.xith3d.test.animation.RotatableGroupTest for an example.

But as an easy fix you should use the following for all you startIncreasing() calls.

1  
pAI1e.startIncreasing( this.getGameTime() ); // I assume "this" is your RenderLoop


You'll certainly call pAI1e.getValue( gameTime );. And this won't work, if you don't start with the current gameTime.

Marvin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline rafa_es

Junior Member





« Reply #3 - Posted 2006-10-31 16:43:33 »

But as an easy fix you should use the following for all you startIncreasing() calls.

1  
pAI1e.startIncreasing( this.getGameTime() ); // I assume "this" is your RenderLoop


That fixed the problem  Grin

Thanks Marvin

Rafael
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #4 - Posted 2006-10-31 16:50:31 »

By the way, rafa_es, did you applied my pieces of advices on your code? If you want I can send you my local (corrected) version.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline rafa_es

Junior Member





« Reply #5 - Posted 2006-10-31 17:54:31 »

By the way, rafa_es, did you applied my pieces of advices on your code? If you want I can send you my local (corrected) version.

Yes Amos, all that was posted that needed to be fixed in the game was done
If you think that you forgot to post some fix, you can send me

Thanks for the help too  Grin

Rafael
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #6 - Posted 2006-10-31 18:11:46 »

Well there's something I didn't commented cause I took as granted that you knew what you were doing.

But listing all doors in your level as local variables is just plain ugly and really inconvenient. If you haven't any reason to keep it like this, then we could easily find a better solution. Real easy, and 1000x more elegant.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline rafa_es

Junior Member





« Reply #7 - Posted 2006-10-31 18:19:41 »

I saw that It's preety ugly this way. I'll build a class for that when i finish a homework that i have to do for tomorrow.

It's already in my TO-DO list.

Rafael
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #8 - Posted 2006-10-31 18:21:36 »

OK, perfect then.

Good luck,

Amos

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline rafa_es

Junior Member





« Reply #9 - Posted 2006-10-31 22:29:49 »

Fixed  Grin
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #10 - Posted 2006-11-01 13:43:51 »

Fixed  Grin
Good.

I don't know if you planned it but making red objects which are targeted would be a really good idea. With the distance (minDist < 3000) thing it's really hard to know if you can get/open/close the object or not.

Also for the encoding of your classes I see lots of strange characters in the "instructions" strings. If it's not UTF-8 (which I suspect) you'd better use that.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline rafa_es

Junior Member





« Reply #11 - Posted 2006-11-01 17:13:21 »

I don't know if you planned it but making red objects which are targeted would be a really good idea. With the distance (minDist < 3000) thing it's really hard to know if you can get/open/close the object or not.
I didn't get this part? Can you post a example of that?


Also for the encoding of your classes I see lots of strange characters in the "instructions" strings. If it's not UTF-8 (which I suspect) you'd better use that.
I don't see that here.

Rafael
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #12 - Posted 2006-11-01 17:28:40 »

I don't know if you planned it but making red objects which are targeted would be a really good idea. With the distance (minDist < 3000) thing it's really hard to know if you can get/open/close the object or not.
I didn't get this part? Can you post a example of that?
Well from what I observed of the game you can "pick" some objects, is that right? And you can only pick them, when you are near enough (less than 3000, it's in your code). So it would be cool if when you can pick an object, this object is highlited in red (e.g. appearance.setColor(new Color3f(Color.red)); )

Also for the encoding of your classes I see lots of strange characters in the "instructions" strings. If it's not UTF-8 (which I suspect) you'd better use that.
I don't see that here.
do you use Eclipse ? in the file properties you can see the file encoding.

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Offline rafa_es

Junior Member





« Reply #13 - Posted 2006-11-01 17:43:49 »

Well from what I observed of the game you can "pick" some objects, is that right? And you can only pick them, when you are near enough (less than 3000, it's in your code). So it would be cool if when you can pick an object, this object is highlited in red (e.g. appearance.setColor(new Color3f(Color.red)); )

I got it, but i don't have a clue of how can i do that.

do you use Eclipse ? in the file properties you can see the file encoding.

I use NetBeans but i checked and it's UTF-8

Rafael
Offline Amos Wenger

Senior Member




Everything's possible, but not everything's fun...


« Reply #14 - Posted 2006-11-01 19:19:13 »

how you can do what ?

well you know how to detect when an object is picked. now you just have to pick every frame.
and to highlight an object in red just use as I said : appearance.setColor(new Color3f(Color.red))

"Once you start working on something, don't be afraid of failure and don't abandon it. People who work sincerely are the happiest"
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Grunnt (18 views)
2014-09-23 14:38:19

radar3301 (14 views)
2014-09-21 23:33:17

BurntPizza (31 views)
2014-09-21 02:42:18

BurntPizza (22 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (29 views)
2014-09-20 20:14:06

BurntPizza (33 views)
2014-09-19 03:14:18

Dwinin (48 views)
2014-09-12 09:08:26

Norakomi (75 views)
2014-09-10 13:57:51

TehJavaDev (105 views)
2014-09-10 06:39:09
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!