We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello - apologies in advance if this query has already been answered or isn't in the right format etc. etc. - I'm new!
I'm building a game where an animal collects carrots and apples which then gains points for the user. Whats the best way to have the images of a carrot and an apple appear at random?
Thank you!
Answers
you can say
when your game is a grid, you need to make the random on the grid.
when your animal collects carrots you have to have an array or better ArrayList to store the carrots with position
Thanks for this. My background is currently an image that gives the illusion that its moving.
Is it possible to have a grid on top of this?
it sure is possible
but it is not necessary to have a grid
are the carrots supposed to move with the background? Probably.
old version
this version places the carrot in steps of 20
so when you are on a grid, it's on a grid
but you don't need a grid
just say
here the new version
The carrots should appear at random so that they can be 'collected' by the user but the background is the only thing that moves. There is a horse which is moved by the user to collect the carrots...
Ok cool thanks, I'll give this a go!