Jump to content
  • Advertisement

Pufftek

Member
  • Content Count

    18
  • Joined

  • Last visited

Community Reputation

108 Neutral

About Pufftek

  • Rank
    Member
  1. Pufftek

    Using large enum in Java?

    This has been very helpful. I suppose I will just  stick with using the integers as the ids.   This is exactly what I did, in fact. I guess what I will do is go through and just try to determine all of the resources that I think I will need beforehand. If more must be added later, I will just add them to the end.
  2. Pufftek

    Using large enum in Java?

    I read on several forums that if you ever have to use a large enum (I mean hundreds of items), then either you are doing something wrong or there is a more efficient way to do things. Also, most of the times in games that I have seen an enum used they are less than fifty items or so. I guess another approach could be to create a hashmap that maps the indexes to a key, then store the key in each entity instead.
  3. So I have created a fairly smooth game engine for my android game. I have a Renderer class which stores a single copy of each bitmap along with an array of rectangles. To renderer a specific image, it uses an id to get the rectangle and draws that portion of the associated bitmap. Each entity uses a texture id (currently an integer) to draws its texture through this renderer. However, there is one problem with this approach. If a texture has to be added, all of the ids have to be updated. I was thinking about creating a huge enum with names for each texture, so that the ids would only have to be changed in one place. I know this is bad practice, but would it be practical in this situation?
  4. Alright, thanks. This makes since, because I noticed that one core was being used while the game was running.
  5. I am new to XNA and c#. I have only made an input manager and main menu for my game, but there is an odd amount of cpu and memory usage. While the display window is not clicked, cpu usage is at 0. When clicked, cpu usage climbs to 13%, and stays there. Is this normal for xna games? Also, the memory keeps climbing up. I was thinking that maybe the garbage collector doesn't kick in until a certain amount of memory is used or something. Could that be it? Right now my game starts at about 9,500K and slowly climbs. I have looked my code all over, and there is nothing that should be causing the memory to go up this much.
  6. I will only be selling my games online on my website. Do I need to file for state sales tax in Texas if I am already set up with the IRS and have my EIN?
  7. Pufftek

    Business Accounts with Paypal

    Thanks, Tom. Helpful as always. I will contact the tax office then see if there anything else I need to do.
  8. I am getting extremely frustrated about this, and cannot find any sort of support or help for my problem. I have a finished game that I am ready to sell. I want to sell it on my website through an eCommerce plugin, which deposits the payments into your paypal account. So I set up a business account to receive the payments through on paypal. Here are my problems: My "business" was registered through filing an assumend name with the county clerk. Is this all I have to do to be an official business? I don't have any employees, it's just me, and I'm online only. Paypal requires you to put an address for your business. I put my home address. Will this show up to people who purchase my game? What do I have to do regarding taxes? Do I have to tax people when they purchase my game? Do I have to set up a seperate bank account for my business? Or can I just withdraw my paypal funds to my personal saving account? I feel like I'm missing so much. I don't want to do something wrong and get in trouble with the IRS or something.
  9. That's what I tried, but when I do it the translate is discarded and the object pops back to where it was before. I want one object to stay in the same spot on the screen (it's a GUI) while the other moves around behind it.
  10. How would I go about doing that? I'm setting this before entering the main loop: glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0,640,480,0,1,-1); glMatrixMode(GL_MODELVIEW); Is there some way that I can discard the transformations after the render() method is called without affecting already drawn things?
  11. I'm trying to make it so that the objects rendered in the render method are translated by mouse dragging, while another is not. Where should I place the render method call for the other object? I've tried all over, and it doesn't seem to work anywhere? while (!Display.isCloseRequested()) { glClear(GL_COLOR_BUFFER_BIT); if (Mouse.isButtonDown(0)) glPushMatrix(); glTranslatef(xTrans,yTrans,0); //move according to mouse movement if (Mouse.isButtonDown(0) && Mouse.getX()>0 && Mouse.getX()<639) xTrans+=Mouse.getDX(); else xTrans=0; if (Mouse.isButtonDown(0) && Mouse.getY()>0 && Mouse.getY()<479) yTrans-=Mouse.getDY(); else yTrans=0; render(); if (Mouse.isButtonDown(0)) glPopMatrix(); update(); Display.update(); Display.sync(framesPerSecond); }
  12. The main reason for not using an installer is compatibility issues with windows versions and their directories, but that's a whole different issue. Now I'm thinking about using a self extracting archive rather than an installer (using something like 7zip), so all the user has to do is click it and it will do everything else. I'm pretty sure you can make desktop shortcuts and such doing that too.
  13. I will be selling a game that I have worked on for a while. I was wondering if selling the game in a ZIP format is bad? This would make things much easier if I didn't have to use an installer. The game has a main executable and several sub directories for resources and saves, and total the zip would be about 36 mb.
  14. This seems like it should be easy, but I must be missing something. I am trying to make it so that if the display is resized, the buttons will resize and keep to scale. Here is the code for the buttons: import static org.lwjgl.opengl.GL11.*; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.Display; public class MenuButton { private int x, y, w,h; private boolean selected=false; private String text; private Room requestedRoom; private boolean clickedOutside=false; private boolean requestingChange=false; public MenuButton(int x, int y, int w, int h, String text, Room requestedRoom) { this.x=x; this.y=y; this.w=w; this.h=h; this.requestedRoom=requestedRoom; } public void render() { if (selected) glColor3f(.5f,.5f,.5f); else glColor3f(1f,1f,1f); glBegin(GL_QUADS); glVertex2i(x,y); glVertex2i(x+w,y); glVertex2i(x+w,y+h); glVertex2i(x,y+h); glEnd(); } public void update() { //update the size and if they are selected/clicked x=(int)((Display.getWidth()/2)-(w/2)); y=(int)((Display.getHeight()*.5)-(h/2)); //w=(int)(Display.getWidth()*.2); //h=(int)(Display.getHeight()*.1); selected=checkSelected(Mouse.getX(),480-Mouse.getY()); //check if the player clicked outside the button if (Mouse.isButtonDown(0)) { if(!selected) clickedOutside=true; } else { if (clickedOutside) clickedOutside=false; } //check if the player clicked inside and not outside if (selected) { if (!clickedOutside && Mouse.isButtonDown(0)) requestingChange=true; } } private boolean checkSelected(int mousex,int mousey) { if (mousex>x && mousey>y && mousex<x+w && mousey<y+h) return true; else return false; } public Room getRequestedState() { return requestedRoom; } public boolean isRequestingStateChange() { if (requestingChange) return true; else return false; } } I have two problems: the x position works perfect until the Display gets really big, then the buttons begin to get narrower for some reason. Making the height of the display smaller causes the y to change correctly, but it is rendered up instead of down (wrong direction). Also, how can I make them resize in real time rather than after the user lets go of the display resizer?
  15. Thanks for the advice, guys. I'm going to look into the Bullet physics engine.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!