This site requires JavaScript, please enable it in your browser!
Greenfoot back
Lilly123
Lilly123 wrote ...

2018/1/27

A Pig's Dream - Improvements

Lilly123 Lilly123

2018/1/27

#
Hi everyone:). I need some comments and suggestions of how to improve my game for a reflection I must write for school. I would be delighted if someone familiar with programming could suggest a few improvements, as I need someone *professional* to look over it. But I would also appreciate other comments from anybody really. This is due Tuesday so I urgently need someone to just say anything. I am a newbie to programming, so don't suggest improvements that will be too hard for a beginner;). Thank You guys! My Game: http://www.greenfoot.org/scenarios/20752
Lilly123 Lilly123

2018/1/27

#
The main thing that I know I need to improve on is the spawning of the clouds. They are supposed to spawn randomly from the right, and then move at a regular pace to the left. I know how to regulate the pace, but have not yet figured out how to spawn them randomly on the right hand side. So far I have just made certain 'lines/paths' for the clouds to spawn on and move on. However, they do not spawn on the right hand side, but rather anywhere one these 'paths'. I recognise that this sound confusing, but I hope once you have played my game and looked at the code (which is available if you open it in Greenfoot) that you understand what I have done, and the problem with it. To put it simpler, my main question is: How do I randomly spawn my clouds at the right hand side of the world?
Super_Hippo Super_Hippo

2018/1/27

#
In your world's act method, when adding the clouds, you randomly set the x-coordinate. The x-coordinate should be fixed (right side = width of the world) and the y-coordinate should be random.
Lilly123 Lilly123

2018/1/28

#
Thank You! The game works much better now:)
xbLank xbLank

2018/1/28

#
1) The hitboxes are completly messed up 2) You can just hide at the very top of the screen where no clouds are 3) Make the background scolling 4) Let the pig move back and forth
You need to login to post a reply.