Jump to content

  • Log In with Google      Sign In   
  • Create Account


destructivArts

Member Since 27 Apr 2011
Offline Last Active Aug 09 2013 12:46 PM

#4975916 where to go now?

Posted by destructivArts on 02 September 2012 - 08:23 PM

Here's some ideas: Progression


#4975101 Updating the Player in a Quad Tree

Posted by destructivArts on 31 August 2012 - 04:09 AM

Ok, I'll keep that in mind.

One other question:
I've implemented an ObservableInput object that calls this update function every frame:
    public void updateInput(MouseHandler m, KeyHandler k){
	    //Mouse
	    mousePos = m.getMousePos();
	    //Keyboard
	    keys = k.getKeyStates();
    }
For some reason it's not calling the update function for it's observers.

I don't know if this has anything to do with it but I'm setting the Entities as observers when they are placed in a data list of a node. I'm removing them when they have to be shifted, and adding them again when they are placed. I know the ObservableInput object sees them, so I don't know why it's not updating.

Just to be thorough, heres the entity update function.
public void update(Observable obs, Object obj){
}
And the players:
    @Override
    public void update(Observable o, Object obj){
	    System.out.println("1");
	    if(o instanceof ObservableInput){
		    ObservableInput obs = (ObservableInput)o;
		    buttonState = obs.getButtonState();
		    mousePos = obs.getMousePos();
		    keys = obs.getKeyState();
	    }
    }

I'll keep looking in the meantime,
Thanks again for all the help!
Peter


#4970006 File IO

Posted by destructivArts on 15 August 2012 - 06:45 PM

Thank you guys for the help!
I had a program that was meant to write to the file that was running at the end of the game, and was messing up the formatting which caused the game not to recognize the END_OF_STREAM tag.

Thanks again,
Peter


#4942399 Handling Collisions Between Rectangles

Posted by destructivArts on 22 May 2012 - 07:35 PM

freakchild: Wow. Thats a lot to take in. Thank you for the advice. I still see one problem with your approach.

If there is no overlap, then there is no collision…nothing more to do.

This is part of the problem I was having. My character can move fast enough (downward) to move completely through a platform in one frame and it seems your method wouldn't check for that. I can always solve this by making all platforms have a minimum height equal to his terminal velocity... actually I think I'll go with that. I honestly just needed to talk that one out.

And your explanation was quite thorough.
Thank you so much for your help.
Peter


#4933015 Making action delay on keyPressed

Posted by destructivArts on 19 April 2012 - 07:06 PM

Ok, this is assuming your using a thread to perform the game loop. ie. Get Input, Update, Render.
Because you can't pause the thread, as that would pause the whole game, you could create another thread that would 'unpause' when you hit the button, and instantly sleep. When it wakes up, it could execute the action, and then return to it's 'paused' state. (Sorry for the incorrect terminology, I've only ever used the .sleep method. Look in the API, I know theres something there.)
Another solution:
You could create a variable that is set to, say 5, when you hit the attack button (or on whatever event you want to have cause the delay).
You would then decriment the variable each frame (this would require the Update function checking the state of this variable every frame), and only allow the player to attack if the variable is equal to 0. It would then be set to -1, so that he wouldn't continue to attack.

Hope this helps,
Peter


#4923764 Beginner.. Where to start? Could use advice..

Posted by destructivArts on 20 March 2012 - 04:52 PM

You said you knew Java at one point, so I'd suggest that you go here: http://math.hws.edu/javanotes/index.html
It's a pretty comprehensive online text book. Go through all that, and then look at this: http://lazyfoo.net/articles/article01/index.php

It's going to take time. I've been trying to make games since I was 13, when some friends and I planned out an entire MMO similar to WoW. When the time came to "put it in the computer" (as we thought then) we realized that none of us was a programmer, nor could any of us use 3d modeling software or even animate efficiently in Flash. Don't start there. It's been a long road to where I am now: programming Space Invaders.

So start at the beginning, and work forward. It's better that way I've learned. Haha

Hope this helps,
Peter


#4923761 Beginner Java Question

Posted by destructivArts on 20 March 2012 - 04:45 PM

Here,
http://math.hws.edu/javanotes/index.html
Go through that online text book, paying careful attention to Chapters 6, 12 and 13.
I'm assuming that you know the basics of Java. If not, best start from the beginning and do all of it.
It's a pretty good resource.
After that go here:
http://lazyfoo.net/articles/article01/index.php
His grammar is a little off, but the advice he gives is sound. I'm still following his progression
I suggest making a text based tic tac toe game, with methods (this is important) and then after you understand how to make a GUI
in Java, transfer it over to a GUI of some sort.
That should teach you the basics of game programming.
I made snake, and Pong after that.

Hope this helps,
Peter

"Other than that I have no opinion"


PARTNERS