Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (538)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (600)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Newbie & Debugging Questions / Re: Fastest way to see if a shape is fully contained inside another shape on: 2009-04-08 22:36:28
appel is that true?  Wouldn't that mean a very fast moving small object ( a bullet with a tiny hitbox ) might move past the boundary in one instant and never "collide"
dzzd how does that work for a circle within a circle
2  Game Development / Newbie & Debugging Questions / Fastest way to see if a shape is fully contained inside another shape on: 2009-04-08 22:02:32
(im using slick)
Im considering using a circular boundary for the playing field, as such im wondering if there is a way to check if a shape is fully contained within another shape.
1. But before that, is there a better way to keep shapes(hitboxes) within a circular boundary?
2. Is there a better method than taking the 4 corners of a rectangle and seeing if theyre all within a gigantic circle that is the playing field.  This is my current idea but it involves having to make a rectangular "bounding hitbox" for every entity (probably bigger than the sprite ), including things that otherwise have circular hitboxes.
3  Game Development / Newbie & Debugging Questions / Re: Calling Entire Classes. on: 2009-03-31 05:06:13
Based on the fact that im not sure what you mean, im going to guess no?  Unless you meant instantiating an object from a class
4  Game Development / Newbie & Debugging Questions / Re: differentiating different types of inputs from same key on: 2009-03-27 16:59:23
hmm im glad i asked! Thanks a lot!!
5  Game Development / Newbie & Debugging Questions / differentiating different types of inputs from same key on: 2009-03-27 03:18:42
Are there any known good ways of interpreting which of these inputs are being given?
1. a Key being held down
2. same Key being rapidly tapped
3. key being pressed, not rapidly

Just wondering if there's a common way of dealing with this, before throwing together a makeshift solution
(As for when it would be used, fighting games like street fighter come to mind)
6  Game Development / Newbie & Debugging Questions / Re: Collision related questions ( not how to do it ) on: 2009-03-27 02:33:12
pong demo doesnt work either
7  Game Development / Newbie & Debugging Questions / Re: Collision related questions ( not how to do it ) on: 2009-03-26 19:09:09
Nothing appears ( im on mac ) after it starts.  ( it doesn't claim its failing to start though )

console:
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: javax/swing/GroupLayout$Group
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at game5.GameFrame.<init>(GameFrame.java:53)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at game5.GameCreator.<init>(GameCreator.java:25)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at game5.GameCreator$1.run(GameCreator.java:19)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:269)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:184)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:176)
3/26/09 3:07:54 PM [0x0-0xcf0cf].com.apple.JavaWebStart  at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
8  Game Development / Newbie & Debugging Questions / Re: Collision related questions ( not how to do it ) on: 2009-03-24 23:08:58
My game so far : http://www.youtube.com/watch?v=gfayDOIqCbo&fmt=18  ( cant really see whats going on without turning on full screen )
machine gun fire blocked by the rocks, the vertical missile ignores the other collisions in the way and then activates (fallingState) when it collides with the other player.  There might be other ways to handle unnecessary collisions in this specific case, but i'm just using this as an example.  Right now im using a quick fix of adding "collidesRocks" boolean and making a seperate set of collision checks of collision on projectile vs players and projectile vs non player entities.  I dont actually want to "ignore" the collisions so much as i want to have some way to identify the type of collision  ("this entity is a rock, i can ignore it, this entity is a tower, activate it, this entitiy is a player, detonate on it")  so that i can check my list of projectiles(all objects extending a superclass called projectile) against a list of entities ( including other projectiles since projectile extends entity ).
Am i wrong to think that using a system of tagging multiple levels ( or basically multiple category groups ) won't really let me do this?  Or is there a way to do this like that
9  Game Development / Newbie & Debugging Questions / Re: Collision related questions ( not how to do it ) on: 2009-03-24 19:18:07
I don't really understand what you mean for my 1st question.. but here's my 2nd question:

This is an example situation, for the general problem im having:
i have a missile that needs to fly to the enemy player and hit them, on the way it collides with various things that it should ignore ( walls, rocks, etc assume the missile is flying above these and only comes down to hit if the collision is the enemy player ).  The collision detection currently calls a general projectile.actionOnCollision() type method that this missile inherited.  My problem is how i should distinguish between collision with other random objects and the collision with the player ( how can i tell what kind of object the missile is currently colliding with, since as far as the missile can tell its just colliding with an Entity ).  Is there a solution besides running a separate series of collision tests just for objects that can only collide with players, since that seems like a workaround solution.  And actually, if for example there were missile detection objects, which upon collision change colors ( to signify the missile flew right over it ) the workaround solution doesn't seem like it would work anyway.
10  Game Development / Newbie & Debugging Questions / Collision related questions ( not how to do it ) on: 2009-03-22 08:25:01
So the player has various objects colliding on him, and can collide on various things. 

Question 1: whats the best way to deal with this so that velocity change effects and knockback occurs correctly.  For example, the asteroid is pushing you against the boundary of the wall.  While checking the collision of the asteroid, i realize that if the player is trying to move away from the asteroid ( faster than the asteroid moves towards it ) then the asteroid will clip onto the player because the player ACTUALLY can't move away because a wall is blocking.  So i figure i'll check the collisions with things like walls first.  Your velocity drops to 0 because youre colliding a wall, but then an asteroid hits you and pushes you away, into that wall clipping you again.  ( this occurs since i'm checking collisions based on where you will be rather than where you are, since if youre already colliding, then its too late ( the asteroid that should be pushing you is already on top of you )

WALL YOU     ASTEROID
dx=0 dx=-10 dx=-5, the asteroid won't hit you since you'll be 10 pixels left, except you won't be 10 pixels left thanks to the wall.
11  Game Development / Newbie & Debugging Questions / Re: aiming? could call it homing missiled I guess on: 2009-03-20 18:47:33
I haven't thoroughly understood everything said here (YET) but i think these alternative suggestions are important and i will try them all because i plan to have MANY MANY MANY MANY types of projectiles with different homing or quasi homing properties that all behave differently.  If these alternatives allow me to produce different "looking" behaviors that cannot be (easily) reproduced with the original method then thats very good.  The projectiles will often be destroyable, so having a different "approach" and movement behaviors towards their targets can mean a lot in my game.  Actually even if the original claim that the missile would move like a ball of mud isn't true thats actually a behavior i might want to try to create... so yeah, thanks a lot for all the extra details, i actually will need it (probably)
12  Game Development / Newbie & Debugging Questions / Re: aiming? could call it homing missiled I guess on: 2009-03-19 23:29:34
ah right... that makes senses lol thanks a bunch  ( for some reason i realized i could make a laser rigidly bend towards the enemy by redoing that tracking caluclation halfway through it's life but i didn't notice that you just repeatedly do that for full homing )
13  Game Development / Newbie & Debugging Questions / Re: aiming? could call it homing missiled I guess on: 2009-03-19 21:46:23
Actually, i just ran into this.  Until now i've been keeping track of stuff via things like double x, double y, etc.  Would i take a noticeable hit by using Point2d and Vector2ds instead?  It seems like a much nicer way to keep track of things but there's going to be lots of projectiles on screen and i don't want to unnecessarily slow things down (this is to be a VERY VERY fast paced game).  Also the solution to his question answered mine before i asked, but also if i wanted actual HOMING shots like a self guided missile ( as opposed to a automatically targeted turret shot like what the parent post seems to be talking about ) that would follow an evasive target what should i do?  ( with limited turn angles that i can set [how would i do that?] )

"You could use Math.atan2(y, x) to get an angle, then rotate the speed around that angle."  Is it related to this?
14  Game Development / Newbie & Debugging Questions / Re: Best way to deal with multiple player inputs on: 2009-03-13 22:29:52
Alright, thanks
15  Game Development / Newbie & Debugging Questions / Best way to deal with multiple player inputs on: 2009-03-13 00:05:17
(using slick, if that matters)

The input comes in the form of an Input object that notes every key that is pressed.
I have a Player object that keeps track of each ( theres only 2 right now ) player's stuff for example their character ( assume its like a space shooter game or something i guess )
The Player object is passed the Input object and tells the containing Character object ( contains the sprites and velocities etc ) how to move by calling a move method inside the Character object.
EX: in one update i pressed forward and right ( diagonally up right ) for player one.  The input is passed to player 1 first, which now has to read that forward and right for player one are pressed and then tells the Character to move in that direction.  My problem is, i have gigantic if statements to deal with the movements in the first place but, now with an additional player theres multiple sets of gigantic if statements since the player has no way to tell if the inputs are for player 1 or for player 2 without checking each one every time.  Is there a speedy(as of yet im unsure of things related to speed and how things can tax the system but this game will require very precise movements and thus maximum framerates and update rates, and it is planned for there to be many objects on screen which means lots of intersections) yet clean way to deal with this?

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
private void movementInputHandler(Input input){
      if (playerNumber == 1){
         p1MovementInputHandler(input);
      }
      else {
         p2MovementInputHandler(input);
      }
   }
   private void p1MovementInputHandler(Input input){
      if (input.isKeyDown(Param.P1_8))
      {
         if (input.isKeyDown(Param.P1_4)){
            chara.move7();


I can elaborate more if needed

Of and if this seems like unnecessary nitpicking, i plan to have lots and lots of inputs
Move
   NW, N, NE   ( 7 8 9 )
   W, E      ( 4    6 )
   SW, S, SE   ( 1 2 3 )



Basic Action
   Shoot 1 - defaulted to energy projectile (A)
   Held shoot 1
   rapid shoot 1 ? (AAA)
   Shoot 2 - defaulted to ballistic projectile (B)
   Held shoot 2
   rapid shoot 2 ? (BBB)
   Action X, held, rapid (X)
   Action Y, held, rapid (Y)
   
   
Modifier
   Dash modifier (D)
   Melee modifier (M)
   Special modifier (S)
   Defensive modifier (?)

a complicated input could be moving in the NE direction while dashing, and turning that into a dashing melee attack ( 2 direction, dash modifier, melee modifier, shoot1 button)
(its meant to be played on controller since keyboards choke on this stuff, but one step at a time...)

I'm open to all kinds of suggestions, and a variety would be good ( unless theres a single best way to deal with this ).  Maybe i should just keep all that if statement clutter and fold it away?

This is heavily influenced by a certain game, for those who notice
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

rwatson462 (29 views)
2014-12-15 09:26:44

Mr.CodeIt (20 views)
2014-12-14 19:50:38

BurntPizza (40 views)
2014-12-09 22:41:13

BurntPizza (75 views)
2014-12-08 04:46:31

JscottyBieshaar (37 views)
2014-12-05 12:39:02

SHC (50 views)
2014-12-03 16:27:13

CopyableCougar4 (47 views)
2014-11-29 21:32:03

toopeicgaming1999 (114 views)
2014-11-26 15:22:04

toopeicgaming1999 (102 views)
2014-11-26 15:20:36

toopeicgaming1999 (30 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!