Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (734)
Games in Android Showcase (222)
games submitted by our members
Games in WIP (811)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1] 2 3 ... 10
 1 
 on: 2017-08-22 08:28:09 
Started by MattWorks(again) - Last post by Shatterhand
(Reminding me why I'm glad I switched to JavaFX.)
Would all the graphical stuff be easier to do things with, such as moving objects and collision interactions, if I switched my game over to JavaFX?

I've heard of JavaFX but never looked into it before.

Yes, it definitely would be much easier, as JavaFX is more modern, robust and object-oriented as the good ol' Java2D Smiley. It has classes for any Shapes, including Polygons. Many people think that JavaFX works the same way as Java2D, so they draw their stuff on a JavaFX Canvas. But to benefit from the scenegraph and hardware acceleration, you should use the scenegraph objects like Rectangle, Circle, Polygon, ImageView etc. Just to give you this tip.
Switching to JavaFX a few years ago was much better for me as well.

Cheers

 2 
 on: 2017-08-22 02:06:42 
Started by MattWorks(again) - Last post by MattWorks(again)
I think you have to add to each vertices' point data. In other words, each point in the x[] has to have the amount added to it for a horizontal movement.

Sometimes it makes sense to make a wrapper class that has the location that you can just give the X and Y movement amounts in a "normal" fashion, and have this class call the methods needed to handle updating the polygon point arrays.

(Reminding me why I'm glad I switched to JavaFX.)
(Been a while since I fussed with polygons--I hope I'm not totally off base.)

Would all the graphical stuff be easier to do things with, such as moving objects and collision interactions, if I switched my game over to JavaFX?

I've heard of JavaFX but never looked into it before.

 3 
 on: 2017-08-22 02:01:39 
Started by MattWorks(again) - Last post by philfrei
I think you have to add to each vertices' point data. In other words, each point in the x[] has to have the amount added to it for a horizontal movement.

Sometimes it makes sense to make a wrapper class that has the location that you can just give the X and Y movement amounts in a "normal" fashion, and have this class call the methods needed to handle updating the polygon point arrays.

(Reminding me why I'm glad I switched to JavaFX.)
(Been a while since I fussed with polygons--I hope I'm not totally off base.)

 4 
 on: 2017-08-22 00:25:12 
Started by MattWorks(again) - Last post by MattWorks(again)
So, I have this little problem(and by little I mean game breaking). I'm using java.awt.Polygon to make a triangle and using java.awt.Graphics to draw it to the screen. So when I try to increase the velocity on either the x (x += velX) or y (y += velY) axis the triangle doesn't move! Angry  So I made the rendered shape a square without utilizing the Polygon class(I only used the Graphics class). When I tried moving the square the same way I moved the triangle, it worked.... Can anyone tell me how this is so? And point me in the right direction to make this work? Clueless

**DISCLAIMER** I don't want to use the Polygon.translate(deltaX, deltaY) method because it ignores collisions.

 5 
 on: 2017-08-21 20:51:17 
Started by philfrei - Last post by FabulousFellini
Yeah I'm not too good with SQL.  Most use it to grab info, not insert it!

 6 
 on: 2017-08-21 20:45:40 
Started by philfrei - Last post by Riven
INSERT jokeAboutTheEclipse INTO Programmer_jokes WHERE date IS NOW();
INSERT ... WHERE ... 
?

Conditional inserts? This joke has too many layers Pointing

 7 
 on: 2017-08-21 19:08:48 
Started by BurntPizza - Last post by J0
Needed a default string for an app but couldn't go with
null
...
1  
static final String S_TO_SET = "'74_ao16/*%LQ^&*(jw))(*&^%'anvo";

I reckon no one is gonna enter that, right? Roll Eyes

 8 
 on: 2017-08-21 18:11:59 
Started by philfrei - Last post by FabulousFellini
INSERT jokeAboutTheEclipse INTO Programmer_jokes WHERE date IS NOW();

 9 
 on: 2017-08-21 16:00:55 
Started by unenergizer - Last post by pavul
ok man, I think I don't understood your question, first, can u tell us what do you want to achieve, I think also, your problems comes from the design, for example what do you want to achieve with that mongo db conecction, you may know that opening and closing connections to db is to much process consuming, you should think a better way to accomplish what you want, in this case how the game you have has to communicate with mongo,  and are you sure mongo is the better option, what about others DBMS?

 10 
 on: 2017-08-21 15:26:13 
Started by pavul - Last post by pavul
Now write a function to do vertical testing, almost the same way, except for the Y-axis Smiley

If you have that up and running, you might want to improve your checking by making the vertical function check not on the sprite's-xAxis-center, but on both the left and right foot.. but don't worry about that too much for now, just try get this up and running!


oh and in case you need some live example, here's one of my opensource projects:
https://bitbucket.org/orangepixel/planet-busters


now my example is working I had to create another function that is checking if the sprite is in the air and if is, I will process gravity again.

Pages: [1] 2 3 ... 10
 
cybrmynd (41 views)
2017-08-02 12:28:51

cybrmynd (58 views)
2017-08-02 12:19:43

cybrmynd (66 views)
2017-08-02 12:18:09

Sralse (80 views)
2017-07-25 17:13:48

Archive (502 views)
2017-04-27 17:45:51

buddyBro (650 views)
2017-04-05 03:38:00

CopyableCougar4 (1136 views)
2017-03-24 15:39:42

theagentd (1138 views)
2017-03-24 15:32:08

Rule (1115 views)
2017-03-19 12:43:22

Rule (1091 views)
2017-03-19 12:42:17
List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05

SF/X Libraries
by SkyAphid
2017-03-02 06:38:56

SF/X Libraries
by SkyAphid
2017-03-02 06:38:32

SF/X Libraries
by SkyAphid
2017-03-02 06:38:05

SF/X Libraries
by SkyAphid
2017-03-02 06:37:51
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!