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

Comments for MapWorld SuperClass

Return to MapWorld SuperClass

danpostdanpost

2013/1/19

Any suggestions, bug reports, and comments are welcome. Start a Discussion thread if there are any questions.
danpostdanpost

2013/1/19

('likes' are welcome also)
actiniumactinium

2013/1/19

nice example Danpost.
danpostdanpost

2013/1/19

actinium, thanks for the comment (and the like).
A new version of this scenario was uploaded on Mon Jan 21 02:24:15 UTC 2013 A superclass; an editing tool; and a code creator; with improved methods and images; plus additional methods.
A new version of this scenario was uploaded on Mon Jan 21 02:25:40 UTC 2013 A superclass; an editing tool; and a code creator; with improved methods and images; plus additional methods.
A new version of this scenario was uploaded on Tue Jan 22 11:20:18 UTC 2013 A superclass; an editing tool; and a code creator; and now with a simple maze game.
askgriffaskgriff

2013/1/22

Excellent. I sincerely appreciate this. I do have one question, however. You say above "On site, clicking on the world will create a new world using the next map. " I click and nothing happens. Just wondering.
askgriffaskgriff

2013/1/22

Just a couple feedback pieces/suggestions: If you look at Danpost's scenario, I think his character movement is a little more fluid. Rather than a quick "jump" to the next cell, it moves over. That will allow a character (i.e. Link from Zelda) to have an animated walk to the next cell. Might be interesting to try. Also [and I know this is because this isn't a full game/version], I changed the borders in the maze map to brick and I [and the enemy guys] can walk through brick. :)
askgriffaskgriff

2013/1/22

Edit: I just realized it was a brick walkway. Well done. Sorry about that. Brilliant.
askgriffaskgriff

2013/1/22

Edit #2: When I said "Danpost's scenario" above, I meant "Actinium's scenario". Not my day, apparently. :)
Super_HippoSuper_Hippo

2013/1/26

Small bug, you can go through elephants if he is moving towards you and you towards him. With a bit luck, they just change positions.
danpostdanpost

2013/1/26

The maze game was not the important thing in this scenario, so I did not put too much effort into it. The purpose of this scenario is to make the mapping out of levels easier by giving the users more methods to use to 'prepare' the world and provide code snippets to incorporate in their world class code.
A new version of this scenario was uploaded on Sat Jan 26 15:22:58 UTC 2013 A world super-class; a level creation tool; a level mapping tool. Maze game code fix.
A new version of this scenario was uploaded on Sat Jan 26 16:04:39 UTC 2013 A world super-class; a level creation tool; a level mapping tool. Added missing documentation.
Super_HippoSuper_Hippo

2013/1/30

Want to look how you scaled your images, because I saw it last time and it does not work for me, but the source code is missing now while it still has the tag "with-source". Did you just forget it?
A new version of this scenario was uploaded on Wed Jan 30 16:12:29 UTC 2013 Publishing source (forgot to include on last update).
danpostdanpost

2013/1/30

@Super_Hippo, yeah, I forgot last time. It is now published.
Super_HippoSuper_Hippo

2013/1/30

Thank you but I can't solve my problem with the scaling because the actor's look bad when they are scaled different. I did not notice it here because they are small enough :) Need to find another way and I will probably, like always, pick the most time consuming one.
danpostdanpost

2013/1/30

@Super_Hippo, if your images are stretching or having slices taken out of them, it is probably because you are re-scaling your images. Always start with an unscaled image and scale it immediately to the size you need. Let us say the image for one of your actors is in a file called "player.png". [code]// save a copy of original image in an instance object field private GreenfootImage image; // in the constructor of that object image = new GreenfootImage(getImage()); // when changing the scale of the image public void scaleImage(double zoom) { GreenfootImage img = new GreenfootImage(image); img.scale((int)(zoom*img.getWidth()), (int)(zoom*img.getHeight())); setImage(img); }[/code]If scaling the image once when the object is being created, just move the code from the scaleImage method to the constructor, supplying the absolute zoom value needed.
Super_HippoSuper_Hippo

2013/1/30

I have exactly this elephant in my game, but it looks bad when it is bigger. Oh and by the way, looks like I did not make that clear, sorry! "I can't solve my problem with the scaling" did not mean that I have a problem with the scaling. It actually meant that I have a problem and wanted to solve it with scaling the images of the actor to a square. But as I said, that did not look well. Then I saw the method drawImage(), so the next idea was, I give the actors an empty image (a square) and draw the other image above that. But that just did not work... Why do I want that square? With a square it would be easier to let the actor know if there is a wall or something right next to it. I have moving AI too, but i decided that one cell has 51 * 51 pixels and not just one. And it looks like that the method getOneObjectAtOffset(dx,dy,class) does not try to find the class from the middle of the picture + dx/dy, because if it would, every class should work with the same values, but they do not. But I think I am fine, I always have some problems that I can not solve. Then I try to find another way to do exactly the same with often 20 times as much source code. As long as it works then, it is good.
danpostdanpost

2013/1/30

@Super_Hippo, When setting an image for the class (by right clicking on the class in the class tree at the right of the scenario window and selecting 'Set image...', click on the image at the left and then at the bottom of the selection window click on the tool icon (gear), then select 'Create new image...' and select the size.
danpostdanpost

2013/1/30

@Super_Hippo, NVM my last post, it does not do what I thought it would.
danpostdanpost

2013/1/30

@Super_Hippo, I am moving this 'discussion' to a new Discussion thread and calling it 'On scaling problem'. Please refer to it.
A new version of this scenario was uploaded on Mon Jul 28 16:23:09 UTC 2014
A new version of this scenario was uploaded on 2017-10-17 13:06:51 UTC