Coder Social home page Coder Social logo

rellax's Introduction

rellax

Rellax while the Camera tracks with cool parallax

rellax demo

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

Usage

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:

  • PxPos:

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

    • 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.

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.


static attribute int CameraOffsetX

Gets/sets the camera horizontal offset.


static attribute int CameraOffsetY

Gets/sets the camera vertical offset.


static attribute int CameraLookAheadX

Gets/sets the camera horizontal lookahead offset.

This is an additional offset that is added in the direction the target character is facing (only 4 direction support now).


static attribute int CameraLookAheadY

Gets/sets the camera vertical lookahead offset.

This is an additional offset that is added in the direction the target character is facing (only 4 direction support now).


License

This module is created by Érico Porto and 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 his code on code from Steve McCrea.

The demo game uses CC0 (Public Domain) art provided by jetrel.

rellax's People

Contributors

ericoporto avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.