Coder Social home page Coder Social logo

slotmachinev2's Introduction

SlotMachineV2

Slot Machine Prototype v2


Demo Video :

CLICK HERE


Walkthrough on sourceCode :

- Settings Profile: The prototype based on settings profiles which a scriptable object holds all the settings of the game. the benefits from that it's allow us to change settings, graphics and behaviors in one shot even in the play mode.

to create a new settings just Right Click in project -> Create -> Settings

settingsSO

- Settings Resources: the first tab in the settings profile is Resources. in this tab we need to fill our slot resources (type / background and icon).

settings_Resources

- Spin Settings: All the magic happen in this tab, from it we can create a lot of spinning variation for each profile.

settings_spin

- Paylines: It's a cool method to set paylines into the machine. we can also draw the payline on the screen set an identity color for each one.

settings_paylines

- Layout: This tab allow us to control the slot machine layout by changing slots scale or adjust the spacing on the vertical/horizontal axis.

settings_layout

How it works :

- Spinning:

In this prototype i used a different approach to make the spinning smooth and more flexibility to work with it. the picture below appears that we translate the whole reel one step down. and then return it the start position after shifting the slot and generate new one on the top. to create a full cycle.

spin

- Clamping:

After the spin complete we need to clamp the reel to appropriate position. so we just compare the reel position with the top (start pos) and bottom (pos of the next step) and move to the shortest distance between them.

clamp

Screenshots :

game coinsAnim paylines drawPline

slotmachinev2's People

Contributors

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