Coder Social home page Coder Social logo

componentsdemo's Introduction

Components demo

Demo in this video

Made by Tienne_k in the Godot game engine

Project structure:

  • Player script is in res://Player/player.gd.

  • Components are inside res://Components/.

  • Game objects (crates, rocks, etc) are in res://Objects/.

  • Main scene is res://Scenes/Levels/test_level.tscn.

    Some nodes in that scene have editor descriptions (editor_description property in the inspector); please be sure to read them to avoid some potential confusion


This is definitely not the best implementation, though.

Due to some coincidences of similar movement mechanics, the player... is technically pushable (i.e. has a PushableComponent)...

According to this implementation, the player is technically pushing themselves to move... Please don't copy this in your own projects, this was a mere coincidence lol.


If you're here because you're genuinely interested in learning this stuff, here are some exercises for you:

  1. Make the trees pushable

  2. Make it so the trees can only be pushed if no other objects are in the chain

    I.e. player pushing a rock, pushing a crate, pushing a tree wouldn't work; but the player pushing only a tree would

  3. Make it so switches toggle whether specific crates are pushable or not

You can share your solutions on our discord server

I hope this helps you on your journey

componentsdemo's People

Contributors

whostolemycoffee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

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