Hi guys my name is Ary, I am a contract game designer living in Guildford England.
I am typically an 3d Engine based designer but I am currently trying to up my skill-set by picking up more scripting ala LUA.
So I have set myself a 1 week project to make a mini game.
This is based around a character running & jumping across 2 conveyor belts. Delivering specific objects to a chute by pulling on a chord above (this raises a section of platform 45 degrees and allows objects to continue rolling into the chute.
There are a couple of things I wonder if anyone has done here in the forums.
First off, conveyor belt physics:
I am looking to create a static platform in the air, however, if the player or any other physics objects are on the platform, they are pushed in a specific direction. Is that an easy thing to do with LUA?
Secondly (the Tetris view cube) This is essentially a square in the top left corner that displays the next shape about to drop. This links into the objects that I want falling off the conveyor belt.
I promise cake to any of you LUA master that may help out in this project.
Happy Friday
Tetris style view screen + conveyor belt physics
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: Tetris style view screen + conveyor belt physics
Hi there!
First, a word of warning - don't get near the physics module. You don't seem to need it for your game - specially if your pieces have to be permanently axis-aligned, like in tetris.
Happy Coding!
First, a word of warning - don't get near the physics module. You don't seem to need it for your game - specially if your pieces have to be permanently axis-aligned, like in tetris.
That part, by itself, isn't quite complicated. I would even hesitate to call it 'physics'. [assumption]Since your conveyour belts are static[/assumption], you can just check the coordinates of your player / objects against the coordinates of your conveyor belts. On your update function, if they 'touch', you just move the player/pieces slightly (conveyorVelocity * dt pixels)Ary wrote:if the player or any other physics objects are on the platform, they are pushed in a specific direction.
I'm not sure what is the question there. If you just forgot to write "how do I do that in Lua", the answer is - you store a value representing your next shape (i.e. 1 is a cube, 2 is a square, etc) inside a variable. Name it nextShape, or something similar. If you need several shapes (you're displaying the next 'n' pieces on your 'square') it's a bit less simple - you have to use a table. You push the value representing the newest element at the beginning, and 'pop' the oldest one from the end.Ary wrote:Secondly (the Tetris view cube) This is essentially a square in the top left corner that displays the next shape about to drop. This links into the objects that I want falling off the conveyor belt.
Happy Coding!
When I write def I mean function.
Who is online
Users browsing this forum: Bing [Bot] and 6 guests