Report as inappropriate.

Photo_on_2011-09-18_at_18

bourne presents ...

2010/9/27

The Call

Isometric rpg! You havn't seen it all till you finish it all !
Key-features become available as you progress.

Follow the in-game help.
Make sure to read info pop ups and everything else!

I've noticed it runs semi lagy in safari. Works super in firefox. Not sure about explorer.

3294 views / 20 in the last 7 days

9 votes | 1 in the last 7 days

Tags: mouse game with-source scrolling rpg gui dialogue path-finding isometric

This scenario is a member of: Isometric Worlds


open in greenfoot
Your browser is ignoring the <APPLET> tag.
A new version of this scenario was uploaded on Mon Oct 18 05:40:16 UTC 2010 Improved movement with W, A, S, D keys. Made more lenient on not having to press at exact same time to move in desired direction.
AvatarDonaldDuck

2010/10/19

I know this isn't exactly what comments are for, but my membership is pending on Greenfoot-Discuss and I have a quick programming question. I'm currently making a Super Mario Brothers games, but I'm getting tired of having the levels only as big as the world (640, 480). I'm working on making the world scroll. Here's what's happening. When the player is past the middle of the world, and he's moving right, the background image, and mask image, should scroll with him. As for moving leftwards. They DO scroll with him, but they get out of sync. Here's the code snippet. Player extends Actor //mworld is equal to getWorld() //x is equal to getX() //isGround is true if the color BLACK is found on the mask at the given location, relative to the Player public void act() { if(mworld.Scrolling==true & x >= 640/2 & xs >0 && !mworld.isGround(getX()+14, getY())) { if(scrollPosition <= mworld.mask.getWidth()) { scrollPosition += scrollSpeed; maskImage = getMaskImage(640, 480); //see getMaskImage(int, int) and getBackgroundImage(int, int) scrollSpeed = xs; //xs is the speed of the Players movement } paint(-scrollPosition); //see paint(int) } if(mworld.Scrolling==true & x <= 640/2 & xs <0 && !mworld.isGround(getX()-14, getY())) { if(scrollPosition >= -mworld.mask.getWidth()) { scrollPosition -= scrollSpeed; maskImage = getMaskImage(640, 480); scrollSpeed = -xs; //xs is the speed of the Players movement } paint(-scrollPosition); } } /** * Paints an image. */ private void paint(int position) { mworld.background.drawImage(scrollingImage, position, 0); mworld.mask.drawImage(maskImage, position, 0); if(position > 0) { mworld.background.drawImage(scrollingImage, position - scrollingImage.getWidth(), 0); mworld.mask.drawImage(maskImage, position - maskImage.getWidth(), 0); } else { mworld.background.drawImage(scrollingImage, position + scrollingImage.getWidth(), 0); mworld.mask.drawImage(maskImage, position + maskImage.getWidth(), 0); } } /** * Returns a background image with the given dimensions. */ private GreenfootImage getScrollingImage(int width, int height) { GreenfootImage Image = new GreenfootImage(width, height); for(int l = 0; l < width; l += mworld.background.getWidth()) { for(int m = 0; m < height; m += mworld.background.getHeight()) { Image.drawImage(mworld.background, l, m); } } return Image; } /** * Returns a mask image with the given dimensions. */ private GreenfootImage getMaskImage(int width, int height) { GreenfootImage image = new GreenfootImage(width, height); for(int n = 0; n < width; n += mworld.mask.getWidth()) { for(int o = 0; o < height; o += mworld.mask.getHeight()) { image.drawImage(mworld.mask, n, o); } } return image; } Of course I can't take credit for all of that programming. Anyways. You seem to know your way around so if you can point out what I'm doing wrong or an alternative to scroll the background and mask image simultaneously, please let me know. It's not a problem if you don't know, or don't want to help. Thanks bourne
AvatarDonaldDuck

2010/10/19

Also, in your game here, the "a" and "d" keys seem to make the Player run faster than the "w" and "s" keys or any combination.
AvatarDonaldDuck

2010/10/19

Haha, I fixed my problem, the world was scrolling then adding player location to it. Disregard my desperate plea for help. Thanks anyways :)
Photo_on_2011-09-18_at_18bourne

2010/10/19

Ha well, glad you got it fixed. And regarding the player running faster in my game, it just looks that way because running left and right is more pixels wide because the tiles are farther apart on screen. But it takes the same time to run to any surrounding tile. I suppose it should take slightly longer to run diagonally since its a farther distance on a 2d plane.
AvatarDonaldDuck

2010/10/20

Okay. Also, I was just wondering, in "The Call" when stationary actors are located off the edge of the applet (such as doors and whatnot) they must have a set location. When the Player moves, does it increment an "x" and "y" variable telling everything whether to appear or not? I'll examine your source code because I'm not sure if that made perfect sense... I ask because I have an exit door in my game, positioned about 500 pixels off to the right of the worlds edge and I need to find a method to make it enter the screen when the player gets near enough. I'm new to scrolling games.
Photo_on_2011-09-18_at_18bourne

2010/10/20

Well with Greenfoot 2.0 you can add actors off the screen. And will appear on screen as it moves left (heading towards the viewing screen) as you would 'move' right. And as for my game, objects that appear on screen are drawn as images on a single actor instead of individual actors.
Avatar_thumbDonaldDuck

2010/10/20

Oh, okay. Thanks bourne
A new version of this scenario was uploaded on Sat Oct 30 23:26:28 UTC 2010 'Fog of War' implemented as seen in my Tangled Escape game I uploaded last night. And some other graphical stuff I've been working on. (Notice the hill and wall lighting)
A new version of this scenario was uploaded on Mon Nov 01 04:46:17 UTC 2010 Fixed a bug that appeared from transitioning the landscape data.

See all comments

Want to leave a comment? You must first log in.

Who likes this?

No_avatar_thumb 20386216_thumb Greenfoot2_thumb No_avatar_thumb No_avatar_thumb We_thumb No_avatar_thumb Libertarian_freedom_thumb Sb2_thumb