Masai WIP - the birth of a platformer

Show off your games, demos and other (playable) creations.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Masai game - the birth of a platformer

Post by kikito »

miko wrote: Nice start! Please add "quit" option after pressing ESC and/or "q". BTW, this should be the first thing implemented in any game ;)
Esc = yes. q = no. It's too close to "a", which is used in the game.
When I write def I mean function.
User avatar
T-Bone
Inner party member
Posts: 1492
Joined: Thu Jun 09, 2011 9:03 am

Re: Masai game - the birth of a platformer

Post by T-Bone »

Always use Ctrl + q instead of just q, which is too easy to hit by mistake.
User avatar
GijsB
Party member
Posts: 380
Joined: Wed Jul 20, 2011 10:19 pm
Location: Netherlands

Re: Masai game - the birth of a platformer

Post by GijsB »

your first post you say iterate instead of irritate...

is that a joke of my spelling mistake in my code when i writed irritations instead of iterations :0?
User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: Masai game - the birth of a platformer

Post by Robin »

Interesting. Still has a long way to go. I'd suggest adding support for arrow keys, and making up and W make the player jump.
GijsB wrote:your first post you say iterate instead of irritate...

is that a joke of my spelling mistake in my code when i writed irritations instead of iterations :0?
Most definitely, yes.
Help us help you: attach a .love.
User avatar
Cantide
Prole
Posts: 10
Joined: Mon Jul 25, 2011 7:01 pm

Re: Masai game - the birth of a platformer

Post by Cantide »

tentus wrote:Finally, in Lua, you don't need semicolons on the end of lines, or parenthesis in if statements, unless you feel like it makes things easier to read. Saves a bit of typing in the long run and clears up the screen if you leave them out.
I'm used to semicolons and parenthesis... it does make it easier for me to read it ^^;; Thanks, tentus for all the other tips, I really need to go through and neaten up my code - I didn't really plan anything, I just sorta added to the physics tutorial as I learnt new things. I'll be sure to use your tips when I get a chance to program again... perhaps next weekend =_=;
Tesselode wrote:I think using W to jump would be better, since it's not like you need W and S to move forward and backward. However, that's only if you have to use the mouse to aim the weapon. If it just shoots in 1 or 2 directions, using the arrow keys for movement and one button for shooting would be much better.
I want to use W and S to perform other functions, such as W to activate / use and S to crouch. I'm not quite sure yet, maybe E to use. Eventually ,hopefully in the not too distant future, I'll make it configurable. Then everyone can have the key combinations that they want ^^;;
Attachments
masai.love
(38.34 KiB) Downloaded 85 times
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Masai game - the birth of a platformer

Post by tentus »

Cantide wrote:I'm used to semicolons and parenthesis... it does make it easier for me to read it ^^;; Thanks, tentus for all the other tips, I really need to go through and neaten up my code - I didn't really plan anything, I just sorta added to the physics tutorial as I learnt new things. I'll be sure to use your tips when I get a chance to program again... perhaps next weekend =_=;
Haha, I getcha. I'm used to PHP, it took me a while to get used to Lua's little niceties.

Don't forget to move love.keypressed out of love.update in your next version. Also, this code:

Code: Select all

      if not (paused) then
         paused = true;
      else
         paused = false;
      end
can be just this:

Code: Select all

paused = not paused
Kurosuke needs beta testers
User avatar
Cantide
Prole
Posts: 10
Joined: Mon Jul 25, 2011 7:01 pm

Re: Masai game - the birth of a platformer

Post by Cantide »

tentus, thanks! I've neatened it up a little bit now. I also use PHP - I've been using LUA for just over 2 weeks now, and I've not once looked at a LUA programming guide - I'm just trying things ( '!running' failed, and I didn't think of trying 'not running' ) :D I've learnt LUA from the LÖVE2d wiki :D

I'd really like to separate my code and move it into different files, but I've no idea how to do that with LUA. I think I'll need to use 'require' ... but I've never been any good at OOP :| If I move love.keypressed out, where on earth will I put it?! :D
Attachments
masai.love
Slightly updated ^^;;
(38.26 KiB) Downloaded 104 times
User avatar
tentus
Inner party member
Posts: 1060
Joined: Sun Oct 31, 2010 7:56 pm
Location: Appalachia
Contact:

Re: Masai game - the birth of a platformer

Post by tentus »

Put love.keypressed at the root level, just like how love.update and love.draw.

Require in Lua works pretty much like it does in PHP. You can use it to organize code into logical chunks, but to do OOP stuff, you'll want to use something like SECS.
Kurosuke needs beta testers
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests