Author Topic: MODULE: rellax 0.1.2  (Read 649 times)

MODULE: rellax 0.1.2
« on: 07 Oct 2019, 03:26 »
rellax version 0.1.2

Get Latest Release rellax.scm | GitHub Repo | Demo Windows | Demo Linux | Download project .zip

Rellax while the camera tracks with cool parallax

This module uses the camera and Viewport API from Adventure Game Studio 3.5.0.

Demo game uses keyboard arrows control, up arrow jumps. WASD should also work.

Before starting, you must create the following Custom Properties in AGS Editor, for usage with Objects.
Just click on Properties [...] and on the Edit Custom Properties screen, click on Edit Schema ... button, and add the two properties below:

  • Name: PxPos
  • Description: Object's horizontal parallax
  • Type: Number
  • Default Value: 0

  • Name: PyPos
  • Description: Object's vertical parallax
  • Type: Number
  • Default Value: 0

The number defined on Px or Py will be divided by 100 and used to increase the scrolling.
An object with Px and Py 0 is scrolled normally, an object with Px and Py 100 will be fixed on the screen despite camera movement.
Objects with negative Px and Py are usually at the front, and positive values are usually at the back.

  Scritp API

static attribute Character* TargetCharacter
The character being tracked by the Game.Camera.

static attribute bool EnableParallax
Gets/sets whether Parallax is on or off.

static attribute bool EnableSmoothCam
Gets/sets whether Smooth Camera tracking is on or off.

This module is created by eri0o is provided with MIT License, see LICENSE for more details.
The code on this module is based on the code of Smooth Scrolling + Parallax Module from Alasdair Beckett, which bases on code from Steve McCrea.
The demo game uses CC0 (Public Domain) art provided by jetrel.
« Last Edit: 16 Nov 2019, 20:19 by eri0o »

Re: MODULE: rellax 0.1.0
« Reply #1 on: 07 Oct 2019, 15:29 »
Hi  @eri0o

It's so fantastic!!!  8-0. FPS is great too. Is it possible to add some features like Grab ledge and so on?

Re: MODULE: rellax 0.1.0
« Reply #2 on: 07 Oct 2019, 16:52 »
The module is just for parallax and smooth camera, the platformer was just for fun to test it under quick movement situations :)

The game project is on GitHub, you can also download it as zip, if you want to play with the code, the platformer bits are all on room1.asc, and it's just around 100 lines of code (if I remember it correctly). It requires the latest 3.5.0 release available!

Erh, maybe the take here is figuring out a new module that would provide some facility for 2D platfomer, but I don't have anything figured out for this for now (except further developing AgsBox2D to support the full Box2D api, but still, details like grab ledge would be onto who is using it :/)
« Last Edit: 07 Oct 2019, 17:01 by eri0o »

Re: MODULE: rellax 0.1.0
« Reply #3 on: 09 Oct 2019, 20:26 »
Thanks eri0o, that module will probably come in handy once i start exporting various art groups separated from Photoshop! :) I've always wanted to see how a "plattformer" is made in AGS also, i know there's another plattformer done by abstauber. It didn't work in Ags 4.3.1 tho :-\ parallax scrolling is really cool too indeed.  (nod). Looks like i have to get the latest AGS, will do! 8-)

Re: MODULE: rellax 0.1.2
« Reply #4 on: 09 Nov 2019, 18:11 »
@Olleh19 the platformer here was just a small thing so it was faster to see the parallax effects happening than by just clicking to interact, so a really dedicated person can make a platformer with a much nicer code :]

Just adding minor bug fix that prevented actually turning the smooth scroll off before.

Edit: Small fix so that the parallax still happens even when smoothing is disabled.
« Last Edit: 16 Nov 2019, 23:43 by eri0o »