Java-Gaming.org Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (681)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (746)
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  
  I made a data type, how do I use it?  (Read 755 times)
0 Members and 1 Guest are viewing this topic.
Offline drang

Junior Newbie





« Posted 2013-07-27 05:56:07 »

1  
2  
3  
4  
public class Vector3Float {
   
   public float x, y, z;
}


i need a Vector3Float that holds the X Y and Z of my camera (in one variable). I really feel stupid asking this question, but ive just never needed to make my own data type before until now
Offline HeroesGraveDev

JGO Kernel


Medals: 376
Projects: 11
Exp: 3 years


┬─┬ノ(ಠ_ಠノ)(╯°□°)╯︵ ┻━┻


« Reply #1 - Posted 2013-07-27 05:58:54 »

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
// Initialising
Vector3Float vec = new Vector3Float();

// Setting variables
vec.x = 2;
vec.y = 4;
vec.z = 1;

// Accessing variables
int total = vec.x + vec.y + vec.z;

Offline drang

Junior Newbie





« Reply #2 - Posted 2013-07-27 06:12:20 »

oh my god that is so obvious. thanks! i feel so stupid now
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ra4king

JGO Kernel


Medals: 435
Projects: 3
Exp: 5 years


I'm the King!


« Reply #3 - Posted 2013-07-27 06:52:29 »

I'm so confused right now. How......what.........why did you make this class without knowing what you wanted it for?

Offline sproingie

JGO Kernel


Medals: 202



« Reply #4 - Posted 2013-07-27 16:52:02 »

http://docs.oracle.com/javase/tutorial/java/index.html
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 
CopyableCougar4 (61 views)
2016-06-25 16:56:52

Hydroque (93 views)
2016-06-22 02:17:53

SwampChicken (96 views)
2016-06-20 13:22:57

SwampChicken (99 views)
2016-06-20 13:22:49

SwampChicken (91 views)
2016-06-20 13:22:26

Hydroque (137 views)
2016-06-15 08:22:50

Hydroque (133 views)
2016-06-13 06:40:55

DarkCart (246 views)
2016-05-29 02:30:33

Hydroque (212 views)
2016-05-26 14:45:46

Mac70 (196 views)
2016-05-24 21:16:33
Making a Dynamic Plugin System
by Hydroque
2016-06-25 00:13:25

Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17
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!