Show Posts
|
|
Pages: [1]
|
|
2
|
Discussions / General Discussions / Convert FSEM game to Applet
|
on: 2013-04-29 01:13:12
|
|
As the title says I need to convert a game I created in Full Screen Exclusive Mode into an applet. I've followed the advice of many people I've found through google and read several tutorials, but I am just not getting it I guess. At this point I'd like to just hire someone to do it for me. If you can help me out please reply or send me a message. The program is rather large so I'd rather not just copy paste it somewhere, about 30mb compressed.
Right now the game is implemented in a JPanel inserted into a JFrame. Thank you!
|
|
|
|
|
3
|
Game Development / Newbie & Debugging Questions / translate and animate simultaneously
|
on: 2013-03-27 00:50:17
|
I am having trouble with getting my animations to work while my characters are moving. I have a player, who will run right and left. When he starts to run either direction, the animation starts, and stops after about 1 second then wont start again unless I let go of the run button and press it again. The zombies will only translate across the screen until they reach their destination then they will stand in place and animate. I need them to animate and translate simultaneously. Can anyone spot the error? I had this working before I cannot figure out how I messed it up! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
| public NinjaSprite(ImagesLoader im, String name, int p) { super(Variables.pWidth/2, 0, Variables.pWidth, Variables.pHeight, im, name); setStep(5,0); locy = Variables.pHeight/2 + 25; period = p; } public void moveLeft() { setImage("leftPlayer"); System.out.println("player period: " + period); loopImage(period, DURATION); isFacingRight = false; isStill = false; super.updateSprite(); }
public void moveRight() { setImage("rightPlayer"); loopImage(period, DURATION); isFacingRight = true; isStill = false; super.updateSprite(); }
public void stayStill() { stopLooping(); isStill = true; } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| public class Zombie extends Sprite{ private String zName;
public Zombie(int x, ImagesLoader imsld, String name, int p){ super(Variables.pWidth/2, 0, Variables.pWidth, Variables.pHeight, imsld, name); period = p; locx = x; zName = name; setStep(1,0); System.out.println("zombie period " + period); } public void move(int target){ if(locx > target){ this.setImage(zName); locx -= Variables.zombieSpeed; loopImage(period, DURATION); } else if(locx < target){ this.setImage(zName); locx += Variables.zombieSpeed; loopImage(period, DURATION); } } } |
|
|
|
|
|
4
|
Game Development / Newbie & Debugging Questions / Re: getRGB() on an image
|
on: 2013-03-26 20:47:11
|
|
I don't know if that would be easier or not. I have 12 levels in a building and about 40 doors. Finding the exact coordinates of each door and storing them will be a pain, but can be done. I thought it made more sense to simply check the image itself so that further levels could be added with the same color scheme without needing to locate every door again through pixels.
|
|
|
|
|
5
|
Game Development / Newbie & Debugging Questions / getRGB() on an image
|
on: 2013-03-26 20:38:51
|
I am working on a game that uses an image I drew as the background. I want to be able to scan the image at the location of the player to determine whether I am standing in front of a door or not. I am using this method to check the pixel color of my image, and it returns the same number no matter where I am standing, so I am obviously using it wrong. 1 2 3 4 5 6
| public boolean door(int playerX, int playerY){ System.out.println("pixel color: " + imLd.getImage(ribImages[level-1]).getRGB(playerX, playerY)); if(imLd.getImage(ribImages[level-1]).getRGB(playerX, playerY)== 573128); isOverDoor = true; return isOverDoor; } |
this prints "pixel color: -12247529" always. Here is the call to it in my update method: 1 2 3
| ribsMan.door(ninja.locx+ninja.width/2, ninja.locy-150);
|
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / Re: large map file format
|
on: 2013-03-24 00:39:58
|
|
This is the first time I've ever made something with a map larger than the screen, so I'm not really sure what is the best way to go about it. I made the map in Tiled, so I don't know how I'd go about drawing one tile at a time. I'm not sure how I could use a sprite sheet for this, without a ton of coding telling it where to draw each tile. Splitting it up into sections might be what I have to do if I can't figure anything else out. I was hoping to be able to see portions of the floors above and below the one the player is on, and splitting each into it's own image might inhibit that.
|
|
|
|
|
8
|
Game Development / Newbie & Debugging Questions / large map file format
|
on: 2013-03-24 00:24:00
|
|
I am creating a game that will have a large map file that is traversed like a side scroller. Unfortunately saving the file as a png is putting it at approx 30-40mb for the picture, which is too big for eclipse to handle. I need to have the picture in the correct proportions while still being able to load it. Is there a way to compress the size of a png image without losing the proportions? I may be explaining this badly, but I have been pushing it around all day with no luck and running out of time. The map is 5600 x 4200 pixels in order to look correct.
Also, this map was created with Tiled. If there is a better way than saving it as an image, I'd love to do something that makes more sense.
Any suggestions?
|
|
|
|
|
9
|
Discussions / General Discussions / Re: Embedding my game on website.
|
on: 2013-02-20 16:23:35
|
|
Ah I see, that makes sense now. I guess the problem is that I have never made an applet before and don't know how to go about changing my program into an applet. From the small amount of reading I did, it seemed that I needed an applet class, then have my game extend applet. I must be misunderstanding this because my classes already extend frame so i can't seem to also extend applet. I dont know if this makes any sense. As I said, I am brand spanking new to this. I'd be happy to send my file to someone if it would make more sense for help converting it.
Thanks for the replies.
|
|
|
|
|
10
|
Discussions / General Discussions / Embedding my game on website.
|
on: 2013-02-20 00:48:43
|
Hey everyone, I am completely new to making java applets and just built my first game. It's an executable jar file and I'd like to link it here as well as add it to my own wordpress webpage. I don't understand what needs to be done to do this however. I have the plugin for wordpress and I guess I just dont understand what I need to put in. <code>[applet code="your.applet.ClassName" file=" http://domain.com/full/path/to/yourJar.jar"]</code><br /> I know the url to my file, but not what to put in for your.applet.ClassName. I have been trying to just put in the name of the class with my main method in it but get an error. Thank you, I realize this is a pretty dumb question but I dont get it.
|
|
|
|
|
11
|
Game Development / Game Mechanics / Re: Physics of a projectile
|
on: 2013-02-18 22:46:27
|
Thank you. Unfortunately now the projectile goes straight out of the guy then shoots upwards off the screen. Only difference is speed of the projectile when clicking elsewhere. I flipped the y for -+ and this lets it fall downwards instead of upwards, but does not start the projectile in an upwards motion. I suppose I don't understand how to change my values to more appropriate numbers. 1 2 3
| xVelocity = (int)(2 * velocity * Math.cos(theta)); yVelocity = (int)(2 * velocity * Math.sin(theta)); |
xVelocity is giving me readouts in the teens, while yVelocity is giving me numbers in the hundreds. This is what I changed my move to. I have no idea how to get the delta you referred to; currTimeMillis - start time gave me awful results. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
| synchronized public void move(){ System.out.println("yvel " + yVelocity); System.out.println("xvel " + xVelocity); if(newY < upperMax){ active = false; } theta = (float) Math.toDegrees(Math.atan2(launchX - initialX, launchX - initialY));
yVelocity += gravity*2; newY -= yVelocity; newX += xVelocity; } |
|
|
|
|
|
12
|
Game Development / Game Mechanics / Physics of a projectile
|
on: 2013-02-18 21:09:31
|
Hey everyone, This is my first game I have ever attempted and am running into road blocks left and right. At this point in the program I have a rock that is thrown from the origin towards x,y coordinates of a left mouse click. I want to have this rock thrown in a fairly realistic parabola using the magnitude of the throw (given by distance of click from origin), and angle of throw from the origin. At this point I have written and rewritten the move method many times and simply can't get it to work. I understand the physics and the math of it, but not how to translate them into java. I've looked at a lot of examples but can't figure out how to apply it. Most of them talk about using time, but I am not sure how to apply it. Really any help will make a huge difference for me. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
private double velocity = (Math.sqrt(Math.pow((launchX-newX), 2) + (Math.pow((launchY-newY),2))))/150; private double gravity = 1; private int launchX; private int launchY; private double initialX; private double initialY; synchronized public void move(){ if(newY < upperMax){ active = false; } theta = (float) Math.toDegrees(Math.atan2(launchX - initialX, launchX - initialY)); newX = (int)(newX + ((moveSpeed * velocity))); newY = (int)(newY + ((-velocity + (gravity * velocity)) * -Math.cos(theta))); } |
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|