Web
Analytics
Log In  

5

Cart [#53000#] | Copy | Code | 2018-05-25 | Link
5

The insidious rulers of Al-Sarmalabim have wronged you, and now it's time to get revenge!

Press Z to jump, press it again to smash into the ground, but careful not to fall or it's game over.
Press X to slice away at your enemies. Kill the blinking red one, but be sure to grab any loot you might find first, or you're not going to afford upgrades between levels.

Little game i made after messing with some casual dungeon random generation. No sound at all, sorry!

UPDATE: I've optimized the code enough to add a few suggestions from the comments!

P#52404 2018-05-05 10:43 ( Edited 2018-06-04 08:34)

::

Maaaybe a bit difficult but the gameplay really works.

Is the cover art original?
(btw, would be nice to have the ingame palette more closely match the cover art)

P#52418 2018-05-05 14:45

::

Agree with freds72 on the color palette.

Not immediately obvious which sprite is the player, even when you learn what the player's sprite looks like. Very easy to die before even moving. Perhaps have a visual effect on the player at startup? Even a quick shrinking or flashing circle would do. Or flash the player briefly.

P#52420 2018-05-05 15:10 ( Edited 2018-05-05 15:10)

::

I agree with Felice and freds72.

P#52425 2018-05-05 17:04

::

@freds72 I worried a bit about difficulty, i made it a bit harder than it should be, due to running out of tokens for an endgame, but i can tweak it if people have trouble with level 1! And yes, i drew that splash pic;

I went through a whole bunch of palettes until i got to this one, picked the grey surfaces to contrast better with the colored enemies, and the yellow buildings so they exude a kind of arabic feel, but i might mess around with it and incorporate some blues/purples. My only concern is having it read (i already think it's a bit too cluttered/hard to read)

@Felice
I agree, i ended up adding an outline to the enemies, but skipped adding it to the player due to running out of tokens. I hoped the white was enough to make it pop, but apparently not, i might optimize a bit and add that. Same goes for showing the player, but i think that's more easily doable with a bit of work!

Thanks for the feedback!

P#52445 2018-05-06 05:56

::

You can easily get a bunch of tokens back if you make an irnd() function to replace all the flr(rnd()) calls.

Also remember that rnd(5) can be replaced by rnd"5" because of Lua's syntactic sugars. Saves the token for the parens.

P#52452 2018-05-06 09:07 ( Edited 2018-05-06 09:09)

::

rnd’5’??? before going into these last resort solution ;) you can recover gazillions of tokens:

  • create local variables for all your loops
for i=1,#items fo
 local item=items[i]
 dosomething(item.x,item.y,...)
 — not:
 — dosomething(items[i].x,items[i].y,...)
end
...
  • create table for all your direction checks:
local corners={{-1,0},{0,0},...}
for _,c in pairs(corners) do
 check(pos.x+c[1],pos.y+c[2])
end
  • some ssget/ssget code looks like it can be factored into memset (not sure - I am on mobile right now)
P#52454 2018-05-06 09:38

::

Thanks for the tips! I'll definitely put a bit more time into this, now that i know how i can win back a few tokens!

P#52458 2018-05-06 11:53

::

Bump.

P#52564 2018-05-09 21:17

::

Hey! I found some time to optimize the code as per suggestions (managed to get back about 400 tokens pretty easily), and i've added the player outline and player/enemy indicator before each round!

I'm still planning to add some sound eventually. If you have a bit of time, let me know if this is an improvement!

P#53001 2018-05-25 04:32

::

@danmakesgame Are you sure you published an updated version?
The code is still full of duplicate lookups like:

sspr(sprites[i].x,sprites[i].y,sprites[i].length, sprites[i].height, sprites[i].posx, sprites[i].posy)

(my inner token optimizer is crying a little bit just by looking at this line :) )

Note: why can't we kill enemies when returning bullets? That would make the game a lot less brutal.

P#53014 2018-05-25 14:54 ( Edited 2018-05-25 14:55)

::

@freds72: it's definitely updated, but there's still room for improvement :D are you saying i should make a function that i'd call with something like spritedraw(sprites,i) for the occasions where i'm trying to sspr from an array of objects, or am i misunderstanding? Thanks for the feedback!

I thought i'd keep the arrows from hurting the enemies since that'd make the game too easy (encouraging the player to stay out of conflict and deflect until everything is dead), but on second thought it doesn't really make sense to have them bounce back and not do damage at all (deceiving the player); might be nice to have an upgrade available for increasing the damage of bounced projectiles, too! I'll add it to the next update for sure.

P#53030 2018-05-26 05:10

::

Nah, single use functions should be avoided (token wise). Simply declare a local variable instead of derefencing the array.
Ex:

for i=1,#sprites do
 — stores table elt
 local s=sprites[i]
 sspr(s.x,s.y,s.length,s.height, s.posx, s.posy)
end
P#53031 2018-05-26 06:16

::

Does the chameleon ring do anything?

P#53095 2018-05-29 14:23

::

Hey @GodFlowey, the chameleon ring shortens the range at which enemies will start firing arrows at you! Should probably make that clearer, thanks!

P#53103 2018-05-29 17:23

::

Would you mind if I add this to me website?

P#53202 2018-06-02 07:07

::

@RadioactivePizza no problem, go for it, but keep in mind i'll end up updating this some more eventually!

P#53268 2018-06-04 08:34

Log in to post a comment

user:
password:

New User | Account Help
:: New User
X
About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2018-08-19 23:43 | 0.248s | 1835k | Q:33