Hi there,
(Keep in mind English is not my first language)
I'm building a game for a project.
The basics are all done except for one function.
(after this it needs some touching up, but I can manage that. )
I need to make a function where the child "dies" when it hits one of the aliens (still called drops).
I already have a function where i lose lives when a 'drop' reaches the bottom of the screen.
And a function that when my lifecounter reaches 0 the game is over.
To make the gameover when the child gets hit, i was thinking of just simply stating that if he gets hit i lose 10 lives.
But i can't seem to link the child with the drops. Can anyone write in that bit for me?
I know how i should do it. (if child equals enemy then.. ) but i keep getting errors. So i took the bit out, so you guys have a working set of code to start out with.
I hope you guys can help me.
The game has multiple tabs and a picture.
So i thought it would be conveniend if I just shared the map in dropbox.
So here you go! >
http://db.tt/zkbpfROI
Hello, I'm new to processing and we're using it for a school project. (Please keep in mind English is not my first language)
We are making a space invaders type game. With very basic shapes we had to make our own "monsters"
Eventually these have to move across the screen. (Start from random position on the top of the screen and diagonally make their way down bouncing of the side of the screen and go the other horizontal way while remaining their downwards trajectory)
Question 1: How do I "group" the RECT's I used to create the monster in 1 group so that I can simply make that group move instead of coding all the RECT's individually. There probably are multiple ways. But if someone can explain me how to incorporate this with OOP i'dd appreciate it!
Question 2: I know how to "bounce" something from left to right.
Example: float x = 100; float y = 1;
float speed = 1;
void setup() { size(200, 200); }
void draw() { background(255);
x = x + speed;
if ((x>width) || (x<0)) { speed = speed*-1; }
stroke(0); fill(175); ellipse(x, 100, 32, 32); }
But how do I make it go down diagonally as well?
Question 3: I want to make new monsters on a regular interval which keeps increasing in speed.
For instance start with one, add another one 5 seconds later, then 4.8, 4,6 etc.
They also have to appear 'randomly' on the top of the screen. For example lets number the top of the screen 1/10 and have the monsters spawn not only at 1 or 10 but also the numbers (positions ) in between.
If someone can provide me with the answers to these questions I think I can get alot further in my programming on my own after that. I really appreciate any help you guys can give me!
Here is the code I have so far to build my "monster" and some basic setup.
//Int int StartMonsterPix5X; int StartMonsterPix5Y; int PixSizePix5;