Java-Gaming.org Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (564)
Games in Android Showcase (151)
games submitted by our members
Games in WIP (605)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: 1 ... 6 7 [8] 9 10
 71 
 on: 2015-03-26 19:28:49 
Started by ii8 - Last post by ii8
How do you start your game with spring framework?

 72 
 on: 2015-03-26 19:18:32 
Started by MrPork - Last post by KevinWorkman
You shouldn't have to negate anything.

 73 
 on: 2015-03-26 19:17:24 
Started by MrPork - Last post by Gibbo3771
To note, you have to Negate the result of the subtraction.

1  
-originY -  targetY


This is different from :

1  
-(originY - targetY) 

 74 
 on: 2015-03-26 19:09:28 
Started by MrPork - Last post by KevinWorkman
Somebody might be willing to debug your entire project for you, but I think you'll have much better luck if you work from a tiny project like the ones I posted that can be copy-pasted and run very easily without any setup or extra logic. It's up to you though. Good luck.

 75 
 on: 2015-03-26 19:04:57 
Started by MrPork - Last post by MrPork
Here's the project (LibGDX) packed into a RAR for anyone that wants to help me out. In-Game you zoom in and out with the mouse wheel, the colored triangles in the world are the ships I'm testing out, you can zoom into that and see them. You can also select the middle one and right click another place to move it to test different angles. Thank You!  Grin

http://www.mediafire.com/download/x5bxznz5nhbmi0s/Workspace.rar

 76 
 on: 2015-03-26 18:57:53 
Started by MrPork - Last post by MrPork
Can I just straight up give you my Libgdx project? I don't ever plan on releasing it to the public anyways.

 77 
 on: 2015-03-26 18:55:20 
Started by MrPork - Last post by KevinWorkman
You'll have much better luck if you work from an example that we can run. I've tried providing two examples to work from, or you could create your own. But as of now it's pretty difficult to debug your code, since we can't run it and it contains a bunch of extra logic that doesn't really have anything to do with the problem.

 78 
 on: 2015-03-26 18:49:49 
Started by MrPork - Last post by MrPork
If I do this, then they're always looking left
1  
GunDirection = (int) Math.toDegrees(Math.atan2(-(OriginPositionY  - TargetShip.getOriginY()), -OriginPositionX - TargetShip.getOriginX()));


and also, my bullets are already using the same bulletDirection in both the statements:

1  
2  
bulletX += Math.cos(Math.toRadians(bulletDirection))*bulletSpeed;
bulletY += Math.sin(Math.toRadians(bulletDirection))*bulletSpeed;

 79 
 on: 2015-03-26 18:40:02 
Started by MrPork - Last post by Gibbo3771
Doing Origin - Target makes them look in opposite directions.

Negate it.

1  
MathUtils.atan2(-(originY - targetY),  - (originX -  targetX));


When doing cos and sin, you multiply it by a scalar.

1  
2  
velocityX = MathUtils.cos(angle)  * speed
velocity  MathUtils.sin(angle)  * speed


Ensure speed (or whatever you call it) remain the same during both multiplications.

You also need to learn to use vectors to encapsulate your data.

You can literally half your members, they also have really nice functions.

 80 
 on: 2015-03-26 18:24:00 
Started by MrPork - Last post by MrPork
Doing Origin - Target makes them look in opposite directions, and multiply what?

Pages: 1 ... 6 7 [8] 9 10
 
wxwsk8er (51 views)
2015-03-20 15:39:46

Fairy Tailz (42 views)
2015-03-15 21:52:20

Olo (28 views)
2015-03-13 17:51:59

Olo (30 views)
2015-03-13 17:50:51

Olo (33 views)
2015-03-13 17:50:16

Olo (40 views)
2015-03-13 17:47:07

ClaasJG (30 views)
2015-03-10 11:36:42

ClaasJG (38 views)
2015-03-10 11:33:01

Pippogeek (45 views)
2015-03-05 14:36:23

Pippogeek (37 views)
2015-03-05 13:56:12
How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27
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!