sudde gameeef

Greenhorn
+ Follow
since Mar 21, 2013
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sudde gameeef



i am not sure if this is the right way.


7 years ago
i am making a game where i need to create object only onces randomly. <br/>
i can get random number by random object. but not sure how to put in if statment. <br/>





if()
System.out.println("random 1");
else if()
System.out.println("random 2");
else if()
System.out.println("random 3");
7 years ago
thanks. i almost got it to working. just one problem its print tree is always empty in if system. i am not sure why.

and by local vairbales you be change it to public right? than it will be local.
7 years ago
getting a error:
Exception in thread "main" java.lang.StackOverflowError
at D06_Binary_Tree$node.access$3(D06_Binary_Tree.java:22)
at D06_Binary_Tree.inOrderTraversal(D06_Binary_Tree.java:116)

andy idea how can i fix this problem?



7 years ago
yeah.... that isnt working. so i want to try some thing else.


1st check for collision


now in side that if statment i can get the over laping x and y. so i know where did the ball collision



now any idea how can i use this information to test where did the ball collide from??
7 years ago
i was test collision between ball and box. i have a ball and long rect(platform) on screen. the collision part works fine. but i want to test where the ball is touch the platform. so if ball touch the ball from left or right or top or bottom. but when i run this. but it is not seem to be going in any of the inner if statments.


7 years ago
i had a question but i am not sure what the problem is.
if user keep right key down. than camera should move left.and my player should fall down bc there are two empty(sky,'0') under player.

move camera.


now to move level iam doing doing this in paint method in level class.

above code will move the bottom floor when user moves left and right.


than i am setting a collision box around every where i see '1'(ground)



not to check for collision i am doing:


if i print the this.rect.get(i) in if statment: i get
java.awt.Rectangle[x=0,y=20,width=5,height=5]

now if i move to right block: output is
java.awt.Rectangle[x=0,y=20,width=5,height=5]

should that be?
java.awt.Rectangle[x=5,y=20,width=5,height=5]


also my player jump method:

7 years ago




i just change some of the stuff.

tile_size = 32;

this code justt making a rectange where there is ground and storeing in arraylist


getter



this code loop though arraylist and see is player is touching the rectanges in arraylist.



this code will find the ground no matter where is the player. bc i getting player y postion.

but the problem is that 1st player will be touch the ground(1) so it will get player y postion + height and thats the ground postion. if he moves right than there is another ground block on top. so he touchs that and moves the ground up. and so on...

now notic if player moves left than he is no ground under him and he is not touching any ground blocks. so he should fall down untill he touch another block. but this doesnt happed. he just stays there and no ground block under him.

i tried this but didnt worked i dont know why.

7 years ago
how to get ground postion, no matter where your player is standing.

2d array: (0=sky, 1=ground, 2=player)



so to get ground position i do this.



problem with above code is that it will only get me the last row postion and thats the ground postion. it wont take in count the ground above it.

so i did this in a loop. i am not sure what to do in if statment so it will give me ground postion, no matter where is player is standing.

7 years ago
how do i move to another form? do i just post it again?
7 years ago
i was trying to make animation using sprite but i ran in to a problem. i want to make animation if user hit right key and different animation if user hit left key. and different animation if user hit up key etc....

the problem is that righ tnow this code below only makes one animation. in player class i want change code lil bit so i can create different animation.

this way this code works is that in player class i have arraylist which stores different images. than i can call animation class to create animation.







animatin.java
7 years ago
i create a player and i want him to shoot bullet. i understand the logic but i need some help with it. my bullet will just be rect in paint method.

logic:
create bullet class
store in arraylist
print in paint method

in bullet class i set the variables:
Bullet.java









this is the code where i need help. how to print bullets from arraylist.
7 years ago

sudde gameeef wrote:i remove the 1 also in main i have Player p lower case.
and two line were

player_class.paint(g, this);
and

public void paint(Graphics g, main m)

7 years ago
also in main i have Player p lower case.
and two line were

player_class.paint(g, this);
and

public void paint(Graphics g, main m)
7 years ago
i c. this seem to be working now but if i paint in different class than it doesnt work. for ex. below player_class paint doesnt work. any idea?

error on: player_class.paintComponent(g);





player.java



error:
The method paint(Graphics, main) in the type main_menu is not applicable for the arguments (Graphics, main.Display)
7 years ago