Big quality games like the mummy,portal,nfs in jmonkey no comprimasation on speed and graphics

what about marketing and promotion.
surley ur marketing team gets u the project.if u fail that doesnt mean that they lose trust in u.
i am not going to be philosphical here.but efforts in programming needs quality
which comes when u have more than one member in ur team.

and for that astroid game i will definetly post something to u on monday .

code for astroid game

IMPORT java.applet.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.util.*;
 

public class Asteroids  extends Applet implements Runnable, KeyListener{
 
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
 
    
    Thread gameloop;
     
  
    BufferedImage backbuffer;
     
    
    Graphics2D g2d;
     
    
    boolean showBounds = false;
     
    
    int ASTEROIDS = 20;
    Asteroid[] ast = new Asteroid[ASTEROIDS];
     
   
    int BULLETS = 10;
    Bullet[] bullet = new Bullet[BULLETS];
    int currentBullet = 0;
     
    
    Ship ship = new Ship();
     
   
    AffineTransform identity = new AffineTransform();
     
    Random rand = new Random();
     
    
    public void init(){
        
        backbuffer = new BufferedImage(640, 480,BufferedImage.TYPE_INT_RGB);
        g2d = backbuffer.createGraphics();                                 
         
         
    
        ship.setX(320);
        ship.setY(240);
         
      
        for (int n = 0; n < BULLETS; n++) {
            bullet[n] = new Bullet();
        }
         
    
        for (int n = 0; n < ASTEROIDS; n++) {
            ast[n] = new Asteroid();
            ast[n].setRotationVelocity(rand.nextInt(3)+1);
            ast[n].setX((double)rand.nextInt(600)+20);
            ast[n].setY((double)rand.nextInt(440)+20);
            ast[n].setMoveAngle(rand.nextInt(360));
            double ang = ast[n].getMoveAngle() - 90;
            ast[n].setVelX(calcAngleMoveX(ang));
            ast[n].setVelY(calcAngleMoveY(ang));
        }
             
          
            addKeyListener(this);
    }
 
     
  
    public void udpate(Graphics g) {
      
        g2d.setTransform(identity);
         
      
        g2d.setPaint(Color.BLACK);
        g2d.fillRect(0, 0, getSize().width, getSize().height);
         

        g2d.setColor(Color.WHITE);
        g2d.drawString("Ship: "+ Math.round(ship.getX()) + "," + Math.round(ship.getY()), 5 , 10);
        g2d.drawString("Move angle: " + Math.round(ship.getMoveAngle()) + 90, 5, 25);
        g2d.drawString("Face angle: " + Math.round(ship.getFaceAngle()),5 , 40);
         
   
        drawShip();
        drawBullets();
        drawAsteroids();
         
     
        paint(g);
    }
     
  
    public void drawShip() {
        g2d.setTransform(identity);
        g2d.translate(ship.getX(), ship.getY());
        g2d.rotate(Math.toRadians(ship.getFaceAngle()));
        g2d.setColor(Color.ORANGE);
        g2d.fill(ship.getShape());
         
    }
     
  
    public void drawBullets() {
        //iterate through the array of bullets
        for (int  n = 0; n < BULLETS; n++){
            //is this bullet currently in use?
            if (bullet[n].isAlive()) {
                //draw bullet
                g2d.setTransform(identity);
                g2d.translate(bullet[n].getX(), bullet[n].getY());
                g2d.setColor(Color.MAGENTA);
                g2d.draw(bullet[n].getShape());
            }
        }
    }
     
     

    public void drawAsteroids() {
        for (int n = 0; n < ASTEROIDS; n++) {
            //is this asteroid being used?
            if (ast[n].isAlive()){
                //draw asteroid
                g2d.setTransform(identity);
                g2d.translate(ast[n].getX(), ast[n].getY());
                g2d.rotate(Math.toRadians(ast[n].getMoveAngle()));
                g2d.setColor(Color.DARK_GRAY);
                g2d.fill(ast[n].getShape());
            }
        }
    }
     

    public void paint(Graphics g) {
       
         
        g.drawImage(backbuffer, 0, 0, this );
    }
     
     
 
    public void start() {
      
        gameloop = new Thread(this);
        gameloop.start();
    }
     
    
    public void run() {
      
        Thread t = Thread.currentThread();
         
      
        while (t == gameloop) {
            try {
             
                gameUpdate();
                 
           
                Thread.sleep(20);
            }
            catch(InterruptedException e) {
                e.printStackTrace();
            }
             
            repaint();      
        }
    }
     
    
    public void stop() {
        //kill the gameloop thread
        gameloop = null;
    }
     
    
    private void gameUpdate() {
        updateShip();
        updateBullets();
        updateAsteroids();
        checkCollisions();
    }
     
 
    public void updateShip() {
        
        ship.incX(ship.getVelX());
         

        if (ship.getX() < -10)
            ship.setX(getSize().width + 10);
        else if (ship.getX() > getSize().width + 10)
            ship.setX(-10);
         
 
        ship.incY(ship.getVelY());
         
      
        if (ship.getY() < -10)
            ship.setY(getSize().height + 10);
        else if (ship.getY() > getSize().height + 10)
            ship.setY(-10);
             
    }
    
    public void updateBullets() {
  
        for (int n = 0; n < BULLETS; n++) {
             
        
            if (bullet[n].isAlive()) {
                 
          
                bullet[n].incX(bullet[n].getVelX());
                 
           
                if (bullet[n].getX() < 0 || bullet[n].getX() > getSize().width) {
                    bullet[n].setAlive(false);
                }
                 
           
                bullet[n].incY(bullet[n].getVelY());
                 
                 
           
                if (bullet[n].getY() < 0 || bullet[n].getY() > getSize().height) {
                    bullet[n].setAlive(false);
                }               
            }               
        }
    }
     
     
  
    public void updateAsteroids() {
   
        for (int n = 0; n < ASTEROIDS; n++) {
             
       
            if (ast[n].isAlive()) {
                 
          
                ast[n].incX(ast[n].getVelX());
                 
        
                if (ast[n].getX() < -20)
                    ast[n].setX(getSize().width + 20);
                else if (ast[n].getX() > getSize().width +20)
                    ast[n].setX(-20);
                 
          
                ast[n].incY(ast[n].getVelY());
                 
             
                if (ast[n].getY() < -20)
                    ast[n].setY(getSize().height + 20);
                else if (ast[n].getY() > getSize().height +20)
                    ast[n].setY(-20);
                 
           
                ast[n].incMoveAngle(ast[n].getRotationVelocity());
                 
         
                if (ast[n].getMoveAngle() < 0)
                    ast[n].setMoveAngle(360 - ast[n].getRotationVelocity());
                else if (ast[n].getMoveAngle() > 360)
                    ast[n].setMoveAngle(ast[n].getRotationVelocity());
            }
        }
    }
     
    
    public void checkCollisions() {
         
      
        for (int m = 0; m < ASTEROIDS; m++) {
             
         
            if (ast[m].isAlive()) {
                 
          
                for (int n = 0; n < BULLETS; n++) {
                
                    if (bullet[n].isAlive()) {
                
                        if (ast[m].getBounds().contains(bullet[n].getX(), bullet[n].getY())) {
                            bullet[n].setAlive(false);
                            ast[m].setAlive(false);
                            continue;
                        }
                    }
                }
                 
           
                if(ast[m].getBounds().intersects(ship.getBounds())) {
                    ast[m].setAlive(false);
                    ship.setX(320);
                    ship.setY(240);
                    ship.setFaceAngle(0);
                    ship.setVelX(0);
                    ship.setVelY(0);
                    continue;
                }
            }
        }
    }
     
    
    public void keyReleased(KeyEvent k) {} 
    public void keyTyped(KeyEvent k) {}
    public void keyPressed(KeyEvent k) {
        int keyCode = k.getKeyCode();
        switch (keyCode) {
        case KeyEvent.VK_LEFT:
            
            ship.incFaceAngle(-5);
            if(ship.getFaceAngle() < 0) ship.setFaceAngle(360-5);
            break;
        case KeyEvent.VK_RIGHT:
            
            ship.incFaceAngle(5);
            if(ship.getFaceAngle() > 360) ship.setFaceAngle(5);
            break;
        case KeyEvent.VK_UP:
            
            ship.setMoveAngle(ship.getFaceAngle() - 90);
            ship.incVelX(calcAngleMoveX(ship.getMoveAngle()) * 0.1);
            ship.incVelY(calcAngleMoveY(ship.getMoveAngle()) * 0.1);
            break;
        
        case KeyEvent.VK_CONTROL:
        case KeyEvent.VK_ENTER:
        case KeyEvent.VK_SPACE:
            
            currentBullet++;
            if(currentBullet > BULLETS - 1) currentBullet = 0;
            bullet[currentBullet].setAlive(true);
             
        
            bullet[currentBullet].setX(ship.getX());
            bullet[currentBullet].setY(ship.getY());
            bullet[currentBullet].setMoveAngle(ship.getFaceAngle() - 90);
             
         
            double angle = bullet[currentBullet].getMoveAngle();
            double svx = ship.getVelX();
            double svy = ship.getVelY();
            bullet[currentBullet].setVelX(svx + calcAngleMoveX(angle) * 2);
            bullet[currentBullet].setVelY(svy + calcAngleMoveY(angle) * 2);
            break;
        }
    }
     
       public double calcAngleMoveX(double angle) {
        return (double) (Math.cos(angle * Math.PI / 180));
    }
     
    
    public double calcAngleMoveY (double angle) {
        return (double) (Math.sin(angle * Math.PI / 180));
    }
     
}

Lol, copy-paste from here: https://github.com/MarcoFusi/Asteroid-Game/blob/master/AsteroidGame/src/Asteroids.java

2 Likes

well thats what u call reusability.
and iam sure that all i need to make a big game is already availaible on the internet
i just have to add and maintaincenec
isint that every programmer do.
and ideas graphics i have freinds for that.
so now tell me what type of game u want .
me and my team will build in 4 months.

Unless someone else call it ‘violation of the license’


5 Likes

well one thing about that
dont be afraid
dont think negative
there is always a solution.
open source,free downloads,linux,android
all uses resusability
kernel of android is of linux.
ide of jme is of netbeans.

Or plagiarism. In this case both work fine.

3 Likes

Hilarious.

Thank you. This is the funniest stuff I’ve read in a long time. Seriously.

5 Likes

and i thought jmonkey community is seriously dedicated making java no 1 programming language
for 3d game development

“It’s 6 fast.” - @normen. I’m gonna be cracking up at this one for at least a week. :joy:

1 Like

This is not a “teach people Java” site. This is a “programming in JME” site. You still have a lot to learn.

I want you to book mark this thread and come back and read it a few years from now for a good embarrassing laugh. We all have these threads in our past. Fortunately mine were on usenet and lost to history by now.

If you can’t even code your own Asteroids clone without downloading a prepackaged thing from the internet then you are going to have a bad time. That’s like the game programming equivalent of breathing, really.

We’re trying to be helpful, really. Your total stubbornness to ignore advice and your blatantly confident ignorance is what’s funny.

If you have the skills to make a game then you could code an Asteroids game in jMonkeyEngine easily by Monday. I did it in two hours once
 then spent the rest of the time making art for it.

Anyway, good luck with your learning.

1 Like

Right! Downloading graphics designer and music composer. Two programmers awaits in queue.

4 Likes

Well, if that’s your plan, you should try unity (you could at least buy things when you don’t find them for free) instead of trying an engine for programmers.

You can’t glue every piece of code in the Internet and create a good game with that. JMonkey is NOT Unity. Unity has a framework where you can download not only assets, but code into your game. And it’s reusable code, like “AI Movement”, “Chat Windows”, etc
 “Asteroids” is not a reusable code. It’s a GAME. You can’t glue a game’s code with another game’s code and hope it won’t fall apart.

Game Designing is designign your own game, without copying/pasting other game’s code. When you paint, you don’t print a photo and then paint over it, don’t you?

Things like Movement, Physics, Asset Pipeline, 3D Space and Sound are common things in games. That’s what engines are for. This is what you can call “reusable”. Now, “Asteroids”? It’s the final product, not a material.

well i made a model in blender say a big model
new1.j3o

it took 4 hours i make it big in blender by scaling
i use jmonkey scenegraph and locate it everywhere on the terrain by using add to scene composer

then i use code for travelling here and there in the rooms ,walking stairs

when the capsule size is small the motion is smooth and fast u can say ok

but when the capsule size is large

the motion of the game is shivering,its not smooth

tell me if make

jvm 1024 memory

then my game motion will be smooth.

/*

  • Copyright © 2009-2012 jMonkeyEngine
  • All rights reserved.
  • Redistribution and use in source and binary forms, with or without
  • modification, are permitted provided that the following conditions are
  • met:
    • Redistributions of source code must retain the above copyright
  • notice, this list of conditions and the following disclaimer.
    • Redistributions in binary form must reproduce the above copyright
  • notice, this list of conditions and the following disclaimer in the
  • documentation and/or other materials provided with the distribution.
    • Neither the name of ‘jMonkeyEngine’ nor the names of its contributors
  • may be used to endorse or promote products derived from this software
  • without specific prior written permission.
  • THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  • “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  • TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  • PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
  • CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  • EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  • PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
  • PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
  • LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  • NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  • SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */

package newpackage;

import com.jme3.app.SimpleApplication;
import com.jme3.bullet.BulletAppState;
import com.jme3.bullet.collision.shapes.CapsuleCollisionShape;
import com.jme3.bullet.control.CharacterControl;
import com.jme3.bullet.control.RigidBodyControl;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
import com.jme3.light.DirectionalLight;
import com.jme3.light.PointLight;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector3f;
import com.jme3.renderer.Camera;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
import com.jme3.scene.shape.Sphere;
import com.jme3.terrain.geomipmap.TerrainLodControl;
import com.jme3.terrain.geomipmap.TerrainQuad;
import com.jme3.terrain.heightmap.AbstractHeightMap;
import com.jme3.terrain.heightmap.ImageBasedHeightMap;
import com.jme3.texture.Texture;
import com.jme3.texture.Texture.WrapMode;
import java.util.ArrayList;
import java.util.List;

/**

  • This demo shows a terrain with collision detection,
  • that you can walk around in with a first-person perspective.
  • This code combines HelloCollision and HelloTerrain.
    */
    public class HelloTerrainCollision1 extends SimpleApplication
    implements ActionListener {

private BulletAppState bulletAppState;
private RigidBodyControl landscape;
private CharacterControl player;
private Vector3f walkDirection = new Vector3f();
private boolean left = false, right = false, up = false, down = false;
private TerrainQuad terrain;
private Material mat_terrain;

float angle1;
float angle2;
PointLight pl;
PointLight p2;
Spatial lightMdl;
Spatial lightMd2;

//Temporary vectors used on each frame.
//They here to avoid instanciating new vectors on each frame
private Vector3f camDir = new Vector3f();
private Vector3f camLeft = new Vector3f();

public static void main(String[] args) {
HelloTerrainCollision1 app = new HelloTerrainCollision1();

app.start();

}

@Override
public void simpleInitApp() {
/** Set up Physics */
bulletAppState = new BulletAppState();
stateManager.attach(bulletAppState);
//bulletAppState.getPhysicsSpace().enableDebug(assetManager);

flyCam.setMoveSpeed(50);
setUpKeys();

DirectionalLight dl = new DirectionalLight();
dl.setDirection(new Vector3f(-0.1f, -0.7f, 1).normalizeLocal());
dl.setColor(new ColorRGBA(1f, 1f, 1f, 1.0f));
rootNode.addLight(dl);

    lightMdl = new Geometry("Light", new Sphere(10, 10, 0.1f));
    lightMdl.setMaterial(assetManager.loadMaterial("Common/Materials/RedColor.j3m"));
    //rootNode.attachChild(lightMdl);

    lightMd2 = new Geometry("Light", new Sphere(10, 10, 0.1f));
    lightMd2.setMaterial(assetManager.loadMaterial("Common/Materials/WhiteColor.j3m"));
    //rootNode.attachChild(lightMd2);


    pl = new PointLight();
    pl.setColor(new ColorRGBA(1, 0.9f, 0.9f, 0));
    pl.setPosition(new Vector3f(0f, 0f, 4f));
    //rootNode.addLight(pl);

    p2 = new PointLight();
    p2.setColor(new ColorRGBA(0.9f, 10, 0.9f, 0));
    p2.setPosition(new Vector3f(10f, 60f, 3f));
    //rootNode.addLight(p2);

Spatial elephant = (Spatial) assetManager.loadModel(“Models/Untitled2/new.j3o”);
float scale = .3f;
elephant.scale(scale, scale, scale);
//rootNode.attachChild(elephant);
/** 4. We give the terrain its material, position & scale it, and attach it. */
//terrain.setMaterial(mat_terrain);
// terrain.setLocalTranslation(0, -100, 0);
//terrain.setLocalScale(2f, 1f, 2f);
rootNode.attachChild(elephant);

/** 5. The LOD (level of detail) depends on were the camera is: */
List<Camera> cameras = new ArrayList<Camera>();
cameras.add(getCamera());
//TerrainLodControl control = new TerrainLodControl(terrain, cameras);
//terrain.addControl(control);

/** 6. Add physics: */ 
/* We set up collision detection for the scene by creating a static 
 * RigidBodyControl with mass zero.*/
elephant.addControl(new RigidBodyControl(0));

// We set up collision detection for the player by creating
// a capsule collision shape and a CharacterControl.
// The CharacterControl offers extra settings for
// size, stepheight, jumping, falling, and gravity.
// We also put the player in its starting position.
CapsuleCollisionShape capsuleShape = new CapsuleCollisionShape(.3f, .3f, 1);
player = new CharacterControl(capsuleShape, .5f);
player.setJumpSpeed(60);
player.setFallSpeed(30);
player.setGravity(60);
player.setPhysicsLocation(new Vector3f(-10, 100, 100));

// We attach the scene and the player to the rootnode and the physics space,
// to make them appear in the game world.
bulletAppState.getPhysicsSpace().add(elephant);
bulletAppState.getPhysicsSpace().add(player);

}
/** We over-write some navigational key mappings here, so we can

  • add physics-controlled walking and jumping: */
    private void setUpKeys() {
    inputManager.addMapping(“Left”, new KeyTrigger(KeyInput.KEY_A));
    inputManager.addMapping(“Right”, new KeyTrigger(KeyInput.KEY_D));
    inputManager.addMapping(“Up”, new KeyTrigger(KeyInput.KEY_W));
    inputManager.addMapping(“Down”, new KeyTrigger(KeyInput.KEY_S));
    inputManager.addMapping(“Jump”, new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(this, “Left”);
    inputManager.addListener(this, “Right”);
    inputManager.addListener(this, “Up”);
    inputManager.addListener(this, “Down”);
    inputManager.addListener(this, “Jump”);
    }

/** These are our custom actions triggered by key presses.

  • We do not walk yet, we just keep track of the direction the user pressed. */
    public void onAction(String binding, boolean value, float tpf) {
    if (binding.equals(“Left”)) {
    if (value) { left = true; } else { left = false; }
    } else if (binding.equals(“Right”)) {
    if (value) { right = true; } else { right = false; }
    } else if (binding.equals(“Up”)) {
    if (value) { up = true; } else { up = false; }
    } else if (binding.equals(“Down”)) {
    if (value) { down = true; } else { down = false; }
    } else if (binding.equals(“Jump”)) {
    player.jump();
    }
    }

/**

  • This is the main event loop–walking happens here.
  • We check in which direction the player is walking by interpreting
  • the camera direction forward (camDir) and to the side (camLeft).
  • The setWalkDirection() command is what lets a physics-controlled player walk.
  • We also make sure here that the camera moves with player.
    */
    @Override
    public void simpleUpdate(float tpf) {
    camDir.set(cam.getDirection()).multLocal(0.6f);
    camLeft.set(cam.getLeft()).multLocal(0.4f);
    walkDirection.set(0, 0, 0);
    if (left) {
    walkDirection.addLocal(camLeft);
    }
    if (right) {
    walkDirection.addLocal(camLeft.negate());
    }
    if (up) {
    walkDirection.addLocal(camDir);
    }
    if (down) {
    walkDirection.addLocal(camDir.negate());
    }
    player.setWalkDirection(walkDirection);
    cam.setLocation(player.getPhysicsLocation());
    }
    }


What?

Did you create a big stage in Blender, and you’re saying that using larger capsule size makes the movement not smooth?

Also, Is. That. Original. Code. Designed. Completely. By. You. ?

no
but i need a code for making big models import from blender and having smooth and fast running in jmonkey
and when iam taking smaller models its look like a small player running jumping climbig stairs.
i want every thing big with this piece of code

Ok. Thank you.

But I still don’t understand that you’re trying to achieve. Explain me what are you trying to do. You want to make the world bigger or the player smaller? Are you using a default model from jME (such as town.zip)? Explain everything.

But just in case, you can import models from blender and convert them directly to .j3o in the SDK. Later you can open them in SceneComposer and scale, move and rotate them.

These two things have nothing to do with one another.

Game dev is hard. Get good.