We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I am trying to finish my final project of programming with processing and I have problems with my code, first I do not know how to go from the menu to the game with the selected character, second; I do not respect the re-drawn background, third, I do not know how to make my character eat "food" in my game are pens, fourth; Do not make lives (3 maximum) fifth; My character does not respect the limits of the labyrinth previously drawn and sixth, in the four corners of my game there are some letters and if my character ate those letters can eat the enemies and also how to program that, it is like a pacman but another Version ... and I have to deliver it in 3 days, could someone help me? please!
Answers
Your code is a repetitive mess. You aren't using arrays, let alone objects. It looks like you've tried to write it all at once, instead of developing it properly, in small steps. Also, I think you're calling loadImage() from inside draw(), which is a serious red flag for understanding.
But you have three days, so all is not lost.
Since I have previously done Pacman to death, I'm going to point you at the steps I took to develop it: https://forum.processing.org/two/discussion/11156/pac-man-game-not-completed-asking-for-assistance#latest
I highly suggest you follow along. Take two days to learn how to use loops, arrays, and objects. Once you understand those concepts, you can easily finish your assignment in a couple of hours on day three.
These two links are important provide good resources for basic concepts:
https://processing.org/examples/
https://processing.org/tutorials/
Specifically:
https://processing.org/tutorials/objects/
https://processing.org/tutorials/transform2d/
https://processing.org/examples/bounce.html
https://processing.org/examples/array.html
https://processing.org/examples/arrayobjects.html
Kf
Checking in here. How's it going? What does your code look like now?
ok, thanks but I don't understand so much english... I speak spanish and I don't understand the tutorials...
TfGuy44
It's the same or worse, I'm trying to put the collisions so that my character does not leave the maze and eat the food, but I can not do it ... I guess I have to do everything from 0 again and in order
You can learn concepts in any language. A quick search turns up a wealth of tutorials in Spanish. For example:
https://es.khanacademy.org/computing/computer-programming/programming#looping https://es.khanacademy.org/computing/computer-programming/programming#arrays https://es.khanacademy.org/computing/computer-programming/programming#objects
You no longer have three days, however, so you better grasp these concepts fast!
thanks for the help :)
So, I'm doing all, again; and my code looks like this: https://www.openprocessing.org/sketch/421938
I'm ok? Is just the start of the game
You should do all your loading in setup(), because you only need to load things once. This includes things like loadImage() and loadFont(). Right now, your draw() function calls inicio(), which does loading.
So in setup () I would only put the start because it only initializes once and the rest of the game should put it in the draw ()? The inicio() I put it on the draw because it has a mousePressed and if I just put it in setup () it does not ...
The
setup()
function runs once. Use it to load things, since you only need to load things once. Any calls toloadImage()
orloadFont()
should be insetup()
.The
draw()
function runs over and over again. All your drawing should happen in this function. If what you draw needs to change, then draw things differently based on values in global variables. That way, when the value in a global variable changes, what is drawn will change too.If you need to detect mouse clicks, add a
mousePressed()
function. Do not rely on themousePressed
boolean. ThemouseX
andmouseY
variables are built in and tell you where the click was. And for detecting key pressed, add akeyPressed()
function. Depending on where a click was or what key was pressed, you can change values stored in your global variables.Okay then, what I did now is wrong right? I have to correct everything I put in the draw ()
I'm sorry, I do not understand, I'm a bit slow for this, the programming is not my forte ...
I'm desperate, I have to deliver this in a few hours and it's not done :'(
Continued here, closing this.
https://forum.processing.org/two/discussion/22135/help-game-like-pacman-collision-score-selection-of-characters
Well, if something's due on a Friday maybe don't wait until the Thursday to ask for help...