It looks like you're new here. If you want to get involved, click one of these buttons!
I've nearly given up on this project after not coding for nearly a year. But I'm still hoping I could get some help. I've got another problem in my code and it's a tough one. But I can't really do anything about it since it's a little too out of my league. But anyway, I need help from absolutely anyone.
Please help...
Comments
Can you please describe whats you issue or problem?
What are you trying to develop or the piece where you are stuck at?
Best regards!
I'm having some trouble. I'm trying to create a function where you place the sprite on a red rectangle (or the weighted cube on the button), the door function should be set to true. But this is only working on my second level where this function is first used. Here is my code.
This looks like the same question and code you posted in another project over a month ago. Have you tried to do anything yourself in that time.
Actually, it's the exact same post. Nobody bothered to help me with it on the other thread, plus all my partners have disappeared for more than a month and this's as far as I could ever get.
Maybe no one is helping you because you're not providing enough code or information. You're saying the door function should be set to true, but it's only working on the second level. If I look at level 2, I don't see anything about a door function. You can't just post some code that doesn't look like it does anything and then ask people to fix it for you. You admit it's the exact same code you posted over a month ago that you haven't made any attempt to do anything to it. If you're not going to work on your own code, why should anyone else. Were you expecting all your partners to write the code for you.
The problem with posting all of my code is because there's so much of it that I have to put it all into separate posts. But I'll try to do just that anyway since I'm kinda desperate. So her it is, the latest version of my game.
@Chell I made the change below marked by <===== to the level6() code and I was able to get to level 7 and back to level 1, but I'm not sure what you're having trouble with. A few suggestions, format your code so it's easier to read. Remove the large groups of blank lines. I'm not sure anyone is going to look thru 600+ lines of code, try to understand what you're trying to do and then try to find what isn't working. I'm not sure what the object of you're game is, what I'm supposed to do, or what you're having trouble with. You know what you're trying to do, yet you can't find your problem. Other people have no idea what's supposed to be happening, yet you want them to find your problem. How about a description of what is supposed to happen, the purpose of the things on the screen, and what and where you're having a problem.
My problem is in level 3, where I was trying to replicate level 2's button and cube puzzle, but even when the cube isn't on the button the door is a usable exit to the next level. The purpose of the puzzle is to use portals to get the cube onto the button and then to the door. Here's my code for level 3:
@Chell You've been working on this for a long time and not getting anywhere. Maybe you should work on something else that's a little easier and build your coding experience and then come back to this code.
@dave1707 I think you're right, but I literally just got my iPad back after it being lost for months. Plus I don't know what else to work on. But I do take suggestions.
@chell Look at the program you're currently trying to work on. Break that down into small sections and see what they're doing. Write small programs that do what those sections are doing and keep changing the program so you understand exactly what's happening. The idea is to write small programs that do parts of what you want a larger program to do. Once you understand how all the small programs work, then writing the large program will be easier. I'm constantly writing small programs to see exactly how the different Codea functions work and I make changes to see how that affect them. Once I fully understand what's happening, I try another one I don't understand. So don't give up on your large program, just take smaller steps until you get more experience.
So should I work on just one level at a time and break down the problem?
Just take what you're having trouble with and break that down into a small program and work on that until you understand what the problem is. Just have a simple program with the cube, button and portal and get that to work setting the variables to correct values that you want. The smaller the program you work with, the less things you have to look at if something doesn't work.
Okay, I've crunched the problem as small as I could. It all comes down to where my variables from level 2 aren't working. I thought that if I could just replace the variables from level 2 with new ones for level 3. But when I tried that, nothing happened. It's like the whole thee lines of code didn't exist. Here's the code:
@Chell All you did was remove 1 line of code, lv=lv+1. What I meant by write small programs was just that. Start another program that has a button, cube, and a portal or whatever you have. They don't have to do anything special. Move the cube and when it's on a button or a portal set variables that indicate that you were on that object. If it's on a portal, set a variable that says you can go to the next level. if it on a button, set a variable that says you're on the button. When you get that doing everything you want it to, then use what you learned from that to fix the bigger program. If you can get one level working, the other levels should be easy.
@Chell It looks like you have a problem with
if dx>sx+20 and dx<sx+20
in your code above. dx can't be > sx+20 and also be < sx+20 at the same time. You need to make the first one sx-20.Apparently, now Codea isn't letting me change my code at all.
Okay, so I'm moving on to level 8 now, but I'm adding a new puzzle element that's giving me a little trouble. It's called the giver and the receiver. The giver launches a little yellow ball that can be moved throughout the game with the help of portals. The receiver is what requires the yellow ball to activate an object like a doorway. That's the basis of level 8. I'm currently working on a prototype of the level but the puzzle bit is a little troubling.
Here's the pro type for level 8: