Resized

Show off your games, demos and other (playable) creations.
Post Reply
User avatar
bgordebak
Party member
Posts: 130
Joined: Thu Jul 10, 2014 2:04 am
Location: Ankara, Turkey

Resized

Post by bgordebak »

Here's my prototype for March 4th. The theme was "Escalation". Any feedback is welcome.

In the game you score up when you reach the yellow box. Touching red circles kills you. You can change your size by using w and s keys. The bigger you're, the slower you move and vice versa. At maximum size you stop.

Since the positions of the red circles are randomly generated, sometimes it's easy, sometimes it's hard. You try to reach your maximum score.

EDIT: I don't think I came up with the best idea for this mechanic. Do you have any suggestions?

Update: Every even level is vertical now
Attachments
Screenshot from 2017-03-04 06-37-15.png
Screenshot from 2017-03-04 06-37-15.png (13.65 KiB) Viewed 3538 times
resized.love
(1.54 MiB) Downloaded 94 times
Last edited by bgordebak on Sat Mar 04, 2017 6:16 pm, edited 3 times in total.
User avatar
mtdev
Prole
Posts: 20
Joined: Mon Feb 20, 2017 5:10 am
Location: Midwest US

Re: Resized

Post by mtdev »

I enjoyed it. Mechanics seem fine.

What is the reason for the multiple randoms in love.load()?

Code: Select all

   math.random(); math.random(); math.random()
User avatar
bgordebak
Party member
Posts: 130
Joined: Thu Jul 10, 2014 2:04 am
Location: Ankara, Turkey

Re: Resized

Post by bgordebak »

mtdev wrote: Mon Mar 13, 2017 5:15 am I enjoyed it. Mechanics seem fine.

What is the reason for the multiple randoms in love.load()?

Code: Select all

   math.random(); math.random(); math.random()
Thanks a lot!

I read somewhere that the first math.random() in lua isn't random, so you need to use it at least once to get a really random number after that. I saw someone put three to be on the safe side. I don't know the reason, but I like to be on the safe side. :)
User avatar
zorg
Party member
Posts: 3436
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Resized

Post by zorg »

bgordebak wrote: Mon Mar 13, 2017 5:18 am
mtdev wrote: Mon Mar 13, 2017 5:15 am I enjoyed it. Mechanics seem fine.

What is the reason for the multiple randoms in love.load()?

Code: Select all

   math.random(); math.random(); math.random()
Thanks a lot!

I read somewhere that the first math.random() in lua isn't random, so you need to use it at least once to get a really random number after that. I saw someone put three to be on the safe side. I don't know the reason, but I like to be on the safe side. :)
Yes, it may or may not give back a "random enough" first value, depending on many factors. That's why it doesn't hurt to call it a few times.

However, one of those factors is OS-dependence, or in other words, lua's (including luajit too, probably) random generator will most likely give back different results on different OS-es (and/or architectures, even).

A good reason why löve has received its own random generator stuff in 0.9.0; it'll give back the same numbers on all platforms.
People should use that instead of math.random.

(Also, only love's is seeded in love.run on startup, meaning you'll probably always get back the same numbers on each restart if you're not seeding lua's random generator yourself)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
User avatar
bgordebak
Party member
Posts: 130
Joined: Thu Jul 10, 2014 2:04 am
Location: Ankara, Turkey

Re: Resized

Post by bgordebak »

Thanks zorg, I didn't know that LÖVE has its own random generator.

I always used math.random() by seeding with os.time(). But from now on I'll use LÖVE's.
User avatar
mtdev
Prole
Posts: 20
Joined: Mon Feb 20, 2017 5:10 am
Location: Midwest US

Re: Resized

Post by mtdev »

Thank you both for the knowledge.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 35 guests