Java Programming: Let's Build a Zombie Game #4

preview_player
Показать описание

in this tutorial we develop a shooting system into the game! Here is the code for the angles...

int bulletVelocity = 10;

Have fun learning!

Рекомендации по теме
Комментарии
Автор

Nice to see you back man, I get nostalgia even watching your modern tuts.

ducksoop.x
Автор

Running into an error, the line
GameObject tempBullet = handler.addObject(new Bullet(tempPlayer.x+16, tempPlayer.y+16, ID.Bullet));


is giving the error "incompatible types:void cannot be converted to GameObject"


Everything has run smooth up until this.

carrieandjeff
Автор

the error you receive at 10:18 can be fixed by using the CopyOnWriteArrayList Collection, its a thread save ArrayList where objects can be added and deleted during the loop

jonas
Автор

Finally you're back! Waiting for more videos :))))

nonamer
Автор

Help! I got the yellow bullets spawning on top of my screen every time I press the mouse button although I cant make the white square spawn yellow bullets from it!!

urijahkeshka
Автор

Hello my friend, thank you always so much for your videos, it really help me, can you upload someday a video explaining how to create a pathfinding for platform games please? I will thank you so much

daytronsan
Автор

On 7:48 I can only move Diagonoly
Can you please tell me what the problem is.
Thank You

sonisri
Автор

Great video! may I ask why choose to develop a game in plain java rather than with game engine like unity?

LawZist
Автор

Can you please help me my Bullet doesnt work

ahinssu
Автор

i'm getting a error Require: GameObject Found: void
GameObject tempBullet = handler.addObject(new Bullet(tempPlayer.x + 16, tempPlayer.y + 16, ID.Bullet))
how can i fix this

martaprat
Автор

for me my bullets aren't spawning
here is what I have in my file:

import java.awt.Color;
import java.awt.Graphics;
public class Bullet extends GameObject{
public Bullet(float x, float y, ID id) {
super(x, y, id);
}
@Override
public void tick() {
x += velX;
y += velY;
}
@Override
public void render(Graphics g) {
g.setColor(Color.yellow);
g.fillRect((int)x, (int)y, 10, 10);
}
}

dangerkid
Автор

Keep getting a crash when clicking in the game and its about this line:


if(tempPlayer != null) {
GameObject tempBullet = handler.addObject(new Bullet(tempPlayer.x+16, tempPlayer.y+16, ID.Bullet));
}else findPLayer();


in this line of code it gives an error and it says I need to change the return type for addObject to GameObject instead of void in this line:


public void addObject(GameObject tempObject) {
object.add(tempObject);


but doing that gives me another crash...

mynamezoll
Автор

Will "So much blood" will be updated in like ever or do you count is as a completed project? Because in my opinion you DID pour care into it but just that is not enough, you also need to pour it into the right things and the right amount. Then again it was like 3 years ago so you might have just forgotten about all that stuff.

MrOlllkin
Автор

Hope u will end this tutorial! it looks great so far!

izmir
Автор

anyone who knows java willing to help me do this? for some reason it is not adding bullets
IDK
#7388 is my discord, thanks

fssimply
Автор

Dark theme thumbnail then a blinding light theme video, no thanks

ryanzwe
welcome to shbcf.ru