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

Comments for Maze Beta

Return to Maze Beta

A new version of this scenario was uploaded on Thu Dec 10 02:54:11 UTC 2009
A new version of this scenario was uploaded on Fri Dec 11 21:22:25 UTC 2009
Builderboy2005Builderboy2005

2009/12/12

So I have been looking at the code, and the problem seems to be with your overriding of the setLocation method. I tried changing the setLocation(getX(),getY()+#,false) in the main act() method to plain setLocation calls, and the collision detection worked perfectly.
PiRocksPiRocks

2009/12/12

I tried what you did, and the collision detecting works perfectly, but it won't scroll! IS there a way to get the collision detecting AND the scrolling to work?
kenshinakhkenshinakh

2009/12/12

Yes, there is a way (if you look around the scenarios here, there are like a couple that do that already). My idea is that you write a separte collision check method. One that will get a list of objects, and check each of the x,y coords of those objects for collisions (also, you have to calculate into the code how tall/wide the object is so you can collision check correctly.)
Builderboy2005Builderboy2005

2009/12/12

Except he is not colliding with objects, he is colliding with the background image of the world. Lets see, I think this is what you will need to do. Have the object move normally without the overriding, and when the world scrolls, have the world move the object in the other direction than the scrolling.
PiRocksPiRocks

2009/12/12

Thanks, I'm trying to do what you suggested right now!
A new version of this scenario was uploaded on Sat Dec 12 23:56:35 UTC 2009
A new version of this scenario was uploaded on Sun Dec 13 02:35:53 UTC 2009
A new version of this scenario was uploaded on Sun Dec 13 02:59:58 UTC 2009
PiRocksPiRocks

2009/12/13

Who noticed what my website was and changed it? It used to be javascript:window.close(); which closes your browser window, now it just says http://javascript/;
A new version of this scenario was uploaded on Sun Dec 13 18:42:11 UTC 2009
A new version of this scenario was uploaded on Sun Dec 13 19:51:12 UTC 2009
A new version of this scenario was uploaded on Sun Dec 13 19:52:39 UTC 2009
A new version of this scenario was uploaded on Sun Dec 13 19:53:38 UTC 2009
lirkilirki

2009/12/14

Not really sure why it won't scroll for the X but I assume that there might be some conflicting code with the Y due to the fact that the screens shakes up and down when you move right/left. That's just my guess. I'll take another look later but that is what I would check if I were you.
lirkilirki

2009/12/14

I've almost got it just got a few more numbers to change. I'll post all the changes I made so that you can fix then upload.
lirkilirki

2009/12/14

I can't figure out the numbers ATM but to get the X to scroll you'll need to add an ! in your public void setLocation(int x, int y, boolean X) to your if(X/ && yBound(y)*/) right before the X in MyWorld. It doesn't instanstly start scrolling right but once you go a little ways in it will and for going left you have to hit a little further out and then it will allow you to turn. Hopefully this gave you enough to fix the numbers on your own or for somebody else to but I'm not able to figure it out ATM and before I start screaming obscenities I'm going to call it a night, but I'll pick back up on it later.
A new version of this scenario was uploaded on Mon Dec 14 21:06:24 UTC 2009
PiRocksPiRocks

2009/12/14

Thanks! It works perfectly, but I can't see why it shakes. I'm debugging the program to try and eliminate the shaking.
spacebluespaceblue

2009/12/14

This maze is pretty long.... Maybe add something that will return the dot to anywhere on the red line?
spacebluespaceblue

2009/12/14

Oh by the way i think the shaking is caused by if you set the location to something like 60, 4.5 (a decimal).
lirkilirki

2009/12/14

No problem I hope you'll continue this with more mazes but put them a little smaller, so they can be like a little brain-teaser to get a break from coding or other random work, also with a selection menu or play-through.
A new version of this scenario was uploaded on Tue Dec 15 23:04:10 UTC 2009
A new version of this scenario was uploaded on Tue Dec 15 23:21:55 UTC 2009
PiRocksPiRocks

2009/12/16

I've got a big problem. My scenario takes,like, twenty minutes to load on the internet, and my newest version has been trying to export for the past three hours. I'm not sure how to fix this. One way I could could the download time in half is if I could figure out how to make the sound loop. If anyone has code that can loop the sound please tell me.
lirkilirki

2009/12/17

I see no problem with online load time. Actually seems a bit faster to me.
PiRocksPiRocks

2009/12/17

Your right! Still, I need to figure out how to get my scenario to have looping sound because right now my solution is to make a sound track 1 hr long that consists of the current sound repeating. This file is massive so it takes forever to upload. I gave up after waiting 5 hrs. If someone can tell me how to make my sound loop, I'd be really happy!
mjrb4mjrb4

2009/12/17

There's not really a "nice" way of doing it at the moment. When the new sound stuff is released for Greenfoot there should be some much better methods that enable this and a lot more, but for now you're stuck with one of 3 bodgy solutions: - Use something like JLayer separately from Greenfoot and implement it yourself. Potentially it's the "nicest" solution, but will take the most work by far. - Use a huge wav file like you've already done - easy but as you've found completely impractical! - Manually store somewhere in your code how long the wav file is, and use some form of timer system (based around real time using System.currentTimeMillis.) If you reset this timer each time the file starts you should be able to work out when the sound will have finished and therefore when to replay it. Personally I'd lean towards using the last option of those three.
PiRocksPiRocks

2009/12/17

I just tried to upload my new version, but it somehow failed. I go tan OutOfMemory error. I"m going to upload my scenario without attempting to loop my sound. All of the looping code will be commented, hopefully someone else can see my error and fix it.
PiRocksPiRocks

2009/12/18

Okay I've tried uploading my scenario like 50 times, and it isn't working. But now I'm getting a different message : Publish failed: Unrecognized response from the server: 500 Can some one tell me what it means so I can fix it?
kenshinakhkenshinakh

2009/12/18

How big is your scenario? Because I got that message once before, but it went away after Dave freed up some space on the server.
PiRocksPiRocks

2009/12/19

My scenario is 19.5 MB. Is that too big?
kenshinakhkenshinakh

2009/12/20

It's a good rule of thumb to keep the sizes below 10mb (unless there a good reason for the size). Are you trying to use wave as music? If so, there are some scenarios around here that demonstrate usage of midi, which is much smaller. I also have a scenario that uses mp3 as music, so that might help u.
A new version of this scenario was uploaded on Sun Dec 20 02:50:05 UTC 2009
PiRocksPiRocks

2009/12/20

Thanks A TON for suggesting MIDI! IT now is only 556kb and takes about 10 seconds to upload!
A new version of this scenario was uploaded on Sun Dec 20 02:51:42 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 02:53:49 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 02:59:16 UTC 2009
PiRocksPiRocks

2009/12/20

Why isn't the sound playing? It works perfectly as a jar file and in greenfoot.
A new version of this scenario was uploaded on Sun Dec 20 03:11:39 UTC 2009
kenshinakhkenshinakh

2009/12/20

because of java applet security, you can't access your midi file like you normally do. instead, you have to use some java.net stuff. I coded this b4, so here you go, just replace the play code with this. //you have to import these. put it at the top of the code. import java.net.URL; import java.io.IOException; /** * Play a Midi file. */ public static void playMidiFile(String fileName) { try { URL url = getClass().getClassLoader().getResource(fileName); if(url == null) throw new IOException("File not found: " + fileName); //file does not exist Sequence sequence = MidiSystem.getSequence(url); sequencer.open(); sequencer.setSequence(sequence); sequencer.start(); } catch(Exception ex) { ex.printStackTrace(); } }
A new version of this scenario was uploaded on Sun Dec 20 15:19:49 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 15:35:30 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 17:05:48 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 19:26:49 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 19:32:45 UTC 2009
A new version of this scenario was uploaded on Sun Dec 20 19:55:23 UTC 2009
Game/maniacGame/maniac

2013/3/3

I COMPLETED INSANE! :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) :)