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

Report as inappropriate.

danpost
danpost presents ...

2015/2/9

Easy Infinite Scroller Support Class

A support superclass for an infinite scrolling world;
capable of horizontal, vertical or universal scrolling;
scrolls either independent of any actor or by following an actor;
scrolls background with or without actor relocations;
capable of scrolling actors without scrolling the background image;
capable of limited scrolling as access to field values are provided through getter methods;

The only limitation, which may be dealt with in a later update, is that the scrolling background image is obtained from the world background set at the time the direction of scrolling is set -- however, this would complicate the code with more fields, checks and controls.

CONTROLS:
Use 'enter' to switch between demo world and sample game world.

Demo controls:
'up' and 'down': speed controls
'left' and 'right': directional controls
'enter': go to sample game demo

Game controls:
'up', 'down', 'left', and 'right': 4-way movement controls
'enter': go back to grid world demo
Game objective:
Avoid on-coming rocks.

Grid world demo:
'up', 'down', 'left', 'right': 8-way movement controls
'enter': go back to initial demo

This demo uses my QActor superclass to give the main actor smooth movement and rotation. One method of the scrolling support class has been slightly modified to scroll actors of this type properly. The original method was commented to make available if needed.

7333 views / 25 in the last 7 days

5 votes | 0 in the last 7 days

Tags: demo with-source scrolling danpost support unlimited

This scenario is a member of: Support Classes by danpost


open in greenfoot
Your browser is ignoring the <APPLET> tag.
A new version of this scenario was uploaded on 2015-02-10 03:47:48 UTC
A new version of this scenario was uploaded on 2015-02-10 03:55:42 UTC
danpostdanpost

2015/2/10

Added a sample avoider game world demo.
A new version of this scenario was uploaded on 2015-02-10 16:48:35 UTC
danpostdanpost

2015/2/10

Made compatible for grid worlds.
danpostdanpost

2015/2/10

Made compatible for grid worlds. A sample grid world added to demo.
A new version of this scenario was uploaded on 2017-03-12 17:30:00 UTC

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

Who likes this?

data17 Telko trimil -nic- ds06