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

Report as inappropriate.

RcCookie
RcCookie presents ...

2020/9/19

Splitscreen cameras

This is a demo for my camera class. It is based on my container class that allowes to display worlds on an actor (https://www.greenfoot.org/scenarios/26528). This way, you can have as many cameras as you want and even move them around in realtime!

What the camera actually does is drawing all the images of the actors in the world the camera looks at onto itself. Additionally, it follows the position of a given actor. Additionally it can zoom in and out.

This showcase scenario has a detailed source code with comments to explain how to use the cameras (it's really simple). Just download it and take a look at the code. If you want to use this in your scenario, all you have to do is copy the 'packages' folder from this scenario into yours.

Showcase:
You have two cameras showing the same world. Move player 1 with wasd and player 2 with the arrow keys! The camera for player 1 is zoomed in with the factor 2x.
You can even pause the scenario and drag the cameras around!



Thumbnail image source: https://motionarray-content.imgix.net/post-images/Split-Screen-Tutorial-Premiere-Pro.jpg?w=3200&h=1200&fit=crop

1993 views / 10 in the last 7 days

1 vote | 0 in the last 7 days

Tags: mouse game simulation demo world reuse camera split screen

This scenario is a member of: Reusable classes


open in greenfoot
Your browser does not support the canvas tag.
A new version of this scenario was uploaded on 2020-09-19 14:33:32 UTC Improved performance: objects that are not visible are no longer being rendered
A new version of this scenario was uploaded on 2020-09-19 15:28:16 UTC Added performance mode option
A new version of this scenario was uploaded on 2020-09-19 15:49:02 UTC Improved documantation
A new version of this scenario was uploaded on 2020-09-19 16:13:38 UTC Fixed some bugs
XeneonXeneon

2020/9/29

Thats cool, I would like you to make an game out of that.
RcCookieRcCookie

2020/9/30

I‘m not to creative with games, but you can create one. Jut download the scenario and take a look into the source code, it explains how to use this.

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

Who likes this?

Game/maniac