Package tripleplay.entity

Examples of tripleplay.entity.Entity


        protected String toString (int id) {
            return typeName(id) + ":" + id + "@" + pos.getX(id) + "/" + pos.getY(id);
        }

        protected Entity createShip (float x, float y) {
            Entity ship = create(true);
            ship.add(type, sprite, opos, pos, vel, spin, radius);

            CanvasImage bitmap = graphics().createImage(30, 20);
            Path path = bitmap.canvas().createPath();
            path.moveTo(0, 0).lineTo(30, 10).lineTo(0, 20).close();
            bitmap.canvas().setFillColor(0xFFCC99FF).fillPath(path);
View Full Code Here


            return createAsteroid(size, x, y, rando.getInRange(-MAXVEL, MAXVEL),
                                  rando.getInRange(-MAXVEL, MAXVEL));
        }

        protected Entity createAsteroid (Size sz, float x, float y, float vx, float vy) {
            Entity ast = create(true);
            ast.add(type, size, sprite, opos, pos, vel, spin, radius);

            float side = sz.size;
            int iidx = rando.getInt(8);
            float ah = asteroids.height();
            ImageLayer layer = graphics().createImageLayer(asteroids.subImage(iidx*ah, 0, ah, ah));
View Full Code Here

            radius.set(id, side*0.425f);
            return ast;
        }

        protected Entity createBullet (float x, float y, float vx, float vy, float angle, int exps) {
            Entity bullet = create(true);
            bullet.add(type, sprite, opos, pos, vel, radius, expires);

            CanvasImage bitmap = graphics().createImage(5, 2);
            bitmap.canvas().setFillColor(0xFFFFFFFF).fillRect(0, 0, 5, 2);
            ImageLayer layer = graphics().createImageLayer(bitmap);
            layer.setOrigin(2.5f, 1);
View Full Code Here

TOP

Related Classes of tripleplay.entity.Entity

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.