Show Posts
|
|
Pages: [1]
|
|
1
|
Game Development / Newbie & Debugging Questions / Re: 2D Platformer
|
on: 2010-07-08 03:07:34
|
|
ya know, i thought that too at first, but that renders the whole leftCollision, rightCollision ect variables useless. I think i figured that much out. Because no where in the program it says to reset the collision variables, it just resets them inside the if statements. I have figured it out though. Thanks.
|
|
|
|
|
2
|
Game Development / Newbie & Debugging Questions / Re: 2D Platformer
|
on: 2010-07-08 01:28:53
|
|
i've looking through, and while a majority of it makes sense, there are some points i dont get because of undeclared variables that are referenced.
moveX = x + dx * pos; moveY = y + dy * pos;
dx and dy were never initiallized, so im not sure what to do with that. i think you ment vx and vy, but i want to be sure.
if(collisionLeft && vx < 0) { vx = 0; leftCollision = true; break; } else leftCollision = false;
collisionLeft was never initiallized. I think you wanted the variable leftCollision, but that wouldnt really make sense to have it be true to get into the if, and then set it true in the loop. The rest of the if statements are like that as well except the last one, which is the way i think this should be.
|
|
|
|
|
3
|
Game Development / Newbie & Debugging Questions / Re: Setting a variable to another
|
on: 2010-07-07 13:19:12
|
|
Well I found my issue, and now I feel pretty stupid. I was checking the wrong variables for changes. The values I check change, but not quite yet in my game. So I tried updating values that are incapable of being different in my game yet. I don't know how i managed to skip over that. I fixed it though, and its all working. Thanks for the help though. My issues never seem to be what I think they are -.-
|
|
|
|
|
5
|
Game Development / Newbie & Debugging Questions / Re: Setting a variable to another
|
on: 2010-07-07 13:07:48
|
|
well my issue wasnt the == vs .equals, i had that correct, i even tried the string = new String thing, and that didnt work, so heres my code
I call this to set that variables to make them the same
wep2 = wep; wepid2 = wepid; body2 = body; bodyid2 = bodyid; bodyc2= bodyc;
i call this to check the variables to see if they are the same, which they never are
if(!wep2.equals(wep)||!wepid2.equals(wepid)||!body2.equals(body)||!bodyid2.equals(bodyid)||!bodyc2.equals(bodyc)) return true; return false;
that is the only place they issue shows up. Maybe I missed something small, idk.
|
|
|
|
|
6
|
Game Development / Newbie & Debugging Questions / Setting a variable to another
|
on: 2010-07-07 04:48:37
|
|
I read somewhere that when you set a variable to another like say x = y, all that is done is the path of y is copied to x, so whenever y changes from thatpoint on, they always stay the same. Idk how true that is, but i seem to be getting an issue involving something like that in the game I am making. To check to see if a variable has changed, i just set a variable to the old value of it, or rather what the screen is drawing, and check it with the current. in the init, and in the fix, i just set the current variables to the old storeage ones, so the path is getting copied, so whenever i change the current one, they change with them. sorry if thats confusing, anyone have any idea of how to fix that?
EDIT: So I've verified myself that java copies thel ocation of the variable to the other, linking the too, atleast with a string. I need a fix for this though. I tried adding "" to the end, but then it says that the 2 strings are different, when they are exactly the same. I havnt any idea how to fix this, so any help would be great.
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / 2D Platformer(answered)
|
on: 2010-07-06 23:57:38
|
|
Im attempting to make a 2D platformer, and i really have no idea how to work out the physics and movement completely. I can get my player to move side to side with the arrow keys, and he stops fine, but when i start implementing physics in anyway into it, it doesnt work as well. Does any have a simple platformer code theyve seen/ have on hand? i've been looking for awhile, and i just keep finding overly complicated things.
|
|
|
|
|
11
|
Game Development / Newbie & Debugging Questions / Set Font in Slick
|
on: 2010-06-23 23:24:28
|
|
Seemingly its overly complicated to just set a font in slick. I cant just do Font font = new Font(); anymore. Is it just as easy, and Im missing something? Like some far off class in the sub folders of the slick api or something?
|
|
|
|
|
12
|
Game Development / Newbie & Debugging Questions / Mini Map?
|
on: 2010-06-07 05:32:13
|
|
Im trying to make a mini map that is simply the graphics page I am drawing on scaled down to a certain part of the screen, obviously leaving the full image up. It is just going to show the parts of the graphics page that are drawn off screen. I can seem to figure it out though. I am using slick so you all know. If i wasn't using slick, I'd be able to do it as I've done it before, but the graphics and images in slick seem to be much different to increase speed, but its screwing me up -.-
Basically what I tried to do was create an image, and a graphics page, set the image and graphics to be identical, so whenever I draw on the graphics, it sends it to the image (graphics = image.getGraphics()) and then just draw the game to the graphics page, and draw the image to the screen, and draw the image again, but smaller on the gui. Any help is much appreciated.
|
|
|
|
|
13
|
Game Development / Newbie & Debugging Questions / Following a landscape (2D)
|
on: 2010-06-04 18:53:24
|
|
I know I ask a lot of stupid questions that have probably been answered before, but I never seem to find my answer.
Im trying to program an object to follow along the landscape that I made, Right now, the landscape is only in a picture. All I want is to have the object follow along the landscape and change the direction to be parallel with the ground as it goes. It doesn't need to be overly complex as there wont be a situation where the object cannot go up or down, it is a basic landscape.
If you can at least provide a link to an old thread that is fine, as there probably is one. Search engines and I do not get along :\
|
|
|
|
|
17
|
Game Development / Newbie & Debugging Questions / Re: AI, Kinda
|
on: 2010-06-02 01:01:01
|
|
My god. Thank you! That was exactly what I needed. I don't know how I skipped over even thinking about it that way. That completely fixed my issue and everything is now working as it should. Now all I need is a smart way to keep the stupid object in a certain box, but it all works now, and that is what matters. Thanks everyone for the help. I appreciate it.
|
|
|
|
|
18
|
Game Development / Newbie & Debugging Questions / Re: AI, Kinda
|
on: 2010-06-02 00:10:54
|
|
how I handle the direction of which I add and subject to x and y is all wrong. Thats my main issue right now.
I've seen people around using floating points for this, but I am not exactly sure on how they work with that. Can anyone help me out with that? I know that I will be doing something along the lines of x+=Math.cos(angle); and y+=Math.sin(angle); but I am not sure on how to handle that angle. Ideally Id like to store angle as an int that is just between 0 and 360, just so I can understand it in my mind, but if there is some other way that I must deal with that is fine. Not sure if I am asking this right or not, but hopefully someone will make sense of this nonsense. In my defense, I am confused as hell -.-
|
|
|
|
|
19
|
Game Development / Newbie & Debugging Questions / Re: AI, Kinda
|
on: 2010-06-01 17:19:23
|
|
You were right, I was looking for wandering, though I'm not quite sure I completely get it.
I know I will need a direction for the main object, and then also a direction that the main object will try to align itself with I guess? How would I manage to convert all that to actually move the object itself? Thats where I get caught up mainly. I've never actually tried to move an object with just a direction variable myself. Sorry if it seems like a stupid question. I think I'm missing something completely. -digs into massive brain dump of mathematical equations- I'll update if I think of something, otherwise, any responses will be helpful!
|
|
|
|
|
20
|
Game Development / Newbie & Debugging Questions / AI, Kinda
|
on: 2010-06-01 03:13:32
|
|
Im trying to just make a simple game to simulate typical life from day to do (wild life)
I got to the point where I am adding bugs, specifically lightning bugs, and I got extremely confused -.-
I have nothing to post, just need some theory here. I want to make a lightning bug for a 2D platform like setup, to make it fly around like a lightning bug would. I have the lightning bug lighting up as it should and all that, I just cant figure out how to change the direction and all that well. I really have no idea where to start with this, so any help would be great. Thanks in advance.
|
|
|
|
|
22
|
Game Development / Newbie & Debugging Questions / Re: Slick and Eclipse
|
on: 2010-05-20 03:55:16
|
|
So, I've figured out that my problem is with the version of lwjgl i am using. My problem is that it wont work on windows 7 ultimate. I tried it out on a windows xp comp at school, and it worked instantly without hassle. Is there a lwjgl version compatible with both windows 7 and windows xp?
|
|
|
|
|
23
|
Game Development / Newbie & Debugging Questions / Slick and Eclipse
|
on: 2010-05-19 04:31:23
|
|
I have a basic understanding of eclipse, but I cannot seem to get Slick to work with it. I get everything imported correctly, with lwjgl being referenced with the correct native library and all, but whenever I compile it, it just tells me 'Failed to initialise the LWJGL display'
Any tutorials that are up to date and indepth would be great. I can't seem to find any good ones.
Thanks for any replies in advance.
|
|
|
|
|
25
|
Game Development / Newbie & Debugging Questions / Re: Using A Graphics/Physics Engine
|
on: 2010-05-06 21:34:58
|
|
Thanks for the responses. After reading your responses I looked into eclipse, just to see if I can still do things my way just to make some things a little easier, but some of the things about it just confuse me. Im just to just opening a new document, and starting from scratch 100%. If anyone has an suggestions for what exact programs to use and any explinations or tutorials for basic use would be nice. I could sit downa nd figure it out on my own, but knowing me I'll get frustrated quick -.-
|
|
|
|
|
26
|
Game Development / Newbie & Debugging Questions / Re: Using A Graphics/Physics Engine
|
on: 2010-05-06 17:06:12
|
|
Sorry but thats not really something I wish to do. I want to understand the code im writing and how everything works rather than have a tool do it for me. Thats why Im using a primitive compiler to begin with. I want to know exactly whats going on. If there is a way I can do it all within the code itself by hand, I want to know.
|
|
|
|
|
27
|
Game Development / Newbie & Debugging Questions / Using A Graphics/Physics Engine
|
on: 2010-05-06 04:55:39
|
|
Its less of a question of how to use or obtain one, but more of how to import its classes for use. I recently downloaded Slick Graphics engine, I have the .jar file of it. Whenever I follow a tutorial to use it and import the classes with the path it tells me, it doesn't work. I have the slick.jar file in the same folder as the program im using it with and all that. I guess I'm missing something. I don't use any fancy editor to code, I do it all by hand. I use textpad. Incase that is needed. Thanks for any responses.
|
|
|
|
|
28
|
Game Development / Newbie & Debugging Questions / No idea where to start for game programming
|
on: 2009-11-05 02:58:54
|
|
I've been programming for about a year and a half now, and game programming is something I've wanted to do, but never got into because i wanted to learn more about java first. I was wondering if anyone might have some tutorials or tips they could tell me to get started. I know i want to make a side scrolling RPG, but when it comes to physics and all that, its a lot different than what i'm use too. I've been working mainly in JFrames, so this is all new to me. Any tutorials would be nice, they dont need to be too basic, I know a good amount about applets and such to manage.
Also, Ive been reading about lwjgl, and i wanted to install it, but theres no tutorials for how to install it with textpad (im aware of other compilers, thats just my personal preference), so if anyone knows how i could install it thatd also be great to know.
Thanks in advance for any replies Tom
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|