Please help me to start

Hello



I am a beginner in programming with JME and I would like your help.

I made the tutorial on this site but I’m still a little lost …

I want to create a simple application but I can not.

Here’s what I want:



A plate-size X, Y

A red cube using keyboard for moves.

Two green cubes that move on a regular (timer?).

-The camera follows the red cube or the camera is a first-person view of the red cube (transition from one to another by keyboard).

-Management of collisions between the cubes.

-A viewfinder at center of the screen.

-When you click the left mouse button, the name of the object in front of the viewfinder is sent to the output.





Could you please help me, guiding me or providing me a source commented.

I want to understand the code because I have to present it.



In advance, thank you for any assistance.







//////////////////////////////////////////////////////////







Bonjour,



Je suis débutant dans la programmation avec JME et je souhaiterais votre aide.

J’ai réalisé les tuto présent sur le site mais je suis encore un peu perdu…

Je désire créer une application simple mais je n’y arrive pas.

Voici ce que je souhaite:



-Un plateau de taille X;Y

-Un cube rouge qui se déplace au clavier.

-Deux cubes verts qui se déplacent de manière régulière (timer ?).

-La caméra suit le cube rouge OU la caméra est une vue à la première personne du cube rouge (passage d’un à l’autre par clavier).

-Gestion des collisions entre les cubes.

-Un viseur au centre de l’écran.

-Lorsqu’on clique avec le bouton gauche de la souris, le nom de l’objet en face du viseur est envoyée à la sortie.





Pourriez-vous m’aider s’il vous plait, en me guidant ou en me fournissant un code source commenté.

Je souhaite comprendre le code car je dois le présenter.



D’avance, je vous remercie pour toute aide apportée.

I am a beginner too, so I can’t really help with any new code or anything yet, but have you tried looking at the test packages and analyzing their code? Instead of opening the new file “BasicGame” try opening “jme3test” (I think that’s what it is called). When you run it you get a list of test programs to run. Check the source code out for those. I’m sure there is one similar to what you are trying to do.



You might have already known about that, but I gave it a shot :wink:

First of all, reads the wiki, from beginner to forward, and during that, try to make some personal experiment

Secondly, open the jme.test. It’s all written in there. It more pragmatic than thousands words.

Third, when you feel ready, start extending a SimpleApplication Class. It’s pretty easy to start, even if you are a layman of java.

Fourth: you will see that your bible is TestWalkingChar. 8)


A plate-size X, Y

If you mean the floor,ZX is the base, and +Y goes upwards. Right handed method. Thumb +X rightward, forefinger +Y upward, +Z middlefinger [his direction is against your face, coming out from the monitor]. This is the cartesian origin.

A red cube

See "makeCube" method inside jme3test.collision/TestMousePick

using keyboard for moves.

To move objects/players the bible is: "TestWalkingChar" as said before. You have to understand this example, completly, but before that, you have to had read the wiki. So go back if haven't done it.

move on a regular (timer?).

For the very first time you can use .setLocalTranslation(vector3f) onto the boxes, calling it from the simpleUpdate method of the SimpleApplication object, if you want a constant moving rate. But you will see it is too poor for whatever you want.

-The camera follows the red cube

"setupChaseCamera" method from the TestWalkingChar
flyCam.setEnabled(false);
chaseCam = new ChaseCamera(cam, model, inputManager);

-Management of collisions between the cubes.

Implements PhysicsCollisionListener ==> WalkingChar :)

-A viewfinder at center of the screen.

If all you want is a fixed "+" onto the display, look at the initCrosshhair method into the jme3test.bullet/TestBrickWall.
If you want a dynamic one, I'm currently thinking about how to develop it. :?

-When you click the left mouse button, the name of the object in front of the viewfinder is sent to the output.

Ray casting will do the job. Retrive the name of the firstCollisionObject and send it to the display. Maybe first it's better to create an empty field attached to the guiNode, so you can fill it with info, like the object names.

Sorry for my bad english. :(

c.
1 Like