Java Game Development #13 - Controlling Enemy Bounds

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


In this video we learn how to control enemy bounds. If you have any questions then be sure to leave a comment or contact me on twitter; realtutsgml. If you learned something then be sure to leave a like, comment, and favorite.

Have fun learning!

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

No worries!

Good stuff to date. Like the teaching style you are using.

dmadatawiz
Автор

i figured out the 2nd method in enemy class.. without pausing the video.... so, , , proud on me... hihi

karanmalhotra
Автор

Great tutorial. Sad if is the last one. Thank for the time you put on this projects

castillo
Автор

Thanks to your amazing tutorials, i actually paused it and did it myself
int the tick method of the enemy:
public void tick(){
y+=1;

if(y >=480)
y = -5;
}
Thanks!

zagganoth
Автор

I am so glad this tutorial continues!!! It's great to have someone explain why certain things are being used. I know the definitions, but it's a lot different to put it into working order. Thank you for all the tutorials! They are a lot of fun!

spillthecode
Автор

Well, I guess I'm a little sad... These tutorials got to be some of the best i have found on youtube, and I really like the pace and how you explain things.
I'm gonna try to stand on my own feet now, and complete this game (as far as I can).

Just shout out if you want my copy so you can continue! xD Wouldn't mind that at all either, you know ^^

Thanks for the fun anyways!

markusjakobsen
Автор

I hope you pick this series back up. I'd love to see the enemies blow up and also incorporate sound. If the other guy didn't get you the code you need, I just finished the entire series and have the project. ;)

dmadatawiz
Автор

Umm can you help me with the collison code?

Donutoftime
Автор

Yey :D thank you ^-^ <3 you are the best Game Dev Tut guy on youtube :)

ChrustyVT
Автор

hey man just wanted to say love your tutorials! you make it very easy and fun to learn game programming...i also like the shorter tutorials that way i can practice small pieces at a time to fully understand everything. great job!

derekxec
Автор

I feel way to good about myself doing the random x thing before hearing about it xD it must mean your doing an awesome job teaching me!

PureNrGG
Автор

What does your name mean?
(Especially the GML Part)
I really like this whole series because it is perfect for me!

dancod
Автор

i did the bottom to top a different way

samiabobaker
Автор

Did just put it back to the top also made it appear in a different spot.
public void tick() {
y += 5;

if (y >= 448) {
y = 0;
x = r.nextInt(Game.WIDTH * Game.SCALE);
}
}

hex
Автор

I tried with if statement but I couldn't figure it out the whole solution

sheriffss
Автор

Hello, Mr programmer,
i find a different way to randomize the enemy plane
if (tempEnemy.getY() >= 480-70){
addEnemy(new * Game.SCALE - 40), 0, t));
}

this is the way i return Y and from enemy class and use this if statement bellow enemy for loop in the Controller Tick method so is there any kind of problem with this, and its working fine. For this i dont need any setter method


Thanks,

sadmandmcxshams
Автор

I send you a message with the download link

RiseandThrive
Автор

What if your game was going from left to right rather than down to up. I want my boundaries so the enemy just bounces off.

Derekstefan
Автор

As far as rendering the 2nd, and subsequent enemies, I took the same approach as the bullets.

//when the Enemy goes off the screen, destroy the object.
if(TempEnemy.getY() > Game.HEIGHT * Game.SCALE) {
removeEnemy(TempEnemy);
addEnemy(new Enemy(r.nextInt(Game.WIDTH * Game.SCALE), 0, tex));
}

dmadatawiz
Автор

I am going to upload another one today :)

RealTutsGML
visit shbcf.ru