Search found 75 matches

by utunnels
Tue Feb 14, 2012 12:19 pm
Forum: Support and Development
Topic: RPG script interpreter or such
Replies: 12
Views: 4524

Re: RPG script interpreter or such

miko wrote:Use coroutines to make it look like serialized code.
Do you mean yielding? I'm not faimilar with that, but I think I can find some tutorial.
Thank you for the advise. :)
by utunnels
Tue Feb 14, 2012 6:48 am
Forum: Support and Development
Topic: RPG script interpreter or such
Replies: 12
Views: 4524

Re: RPG script interpreter or such

Yes, a callback should work. But that'll break down the event code into several parts, which is not conveient to do when logic go complicated.
by utunnels
Tue Feb 14, 2012 3:48 am
Forum: Support and Development
Topic: Problem with generating shadows
Replies: 2
Views: 3472

Re: Problem with generating shadows

Yes, I think you have some problem understanding tables. You are returning the same table in getShadow, that is why you have only 1 shadow. To return a copy or a table, you need to create a new one. function getShadow(vertices, lightX, lightY) x1 = vertices[1] y1 = vertices[2] ydist = y1-lightY xdis...
by utunnels
Tue Feb 14, 2012 2:47 am
Forum: Support and Development
Topic: RPG script interpreter or such
Replies: 12
Views: 4524

RPG script interpreter or such

Many RPG have their own event script interpreters, so I'm considering to make one. I know I can execute raw lua code directly, but that is not good to control event that can block the game. For example, after clicking an NPC, a couple of task is assigned. if somevariable>0 then dialogue("text1&...
by utunnels
Mon Feb 13, 2012 7:50 am
Forum: Support and Development
Topic: Jumping(Platform)[SOLVED!:)]
Replies: 5
Views: 2153

Re: Jumping(Platform)

If he is going for an isometric platformer, then I would use not use a base variable but rather a z position variable... Yeah, but I doubt it. Or it is too early too assume now. Back to topic: For example, when the character jumps forward to a platform which is higher than the ground. When his x-ax...
by utunnels
Mon Feb 13, 2012 6:01 am
Forum: Support and Development
Topic: Jumping(Platform)[SOLVED!:)]
Replies: 5
Views: 2153

Re: Jumping(Platform)

If I'm making the game, I'll make at least 5 related properties. oliver.xpos, oliver.ypos, oliver.xvel, oliver.yvel, oliver.ybase xpos and ypos are your current coordinates, xvel and yvel are your velocities. ybase is tricky, it is your base altitude. If you have some platforms, and your character i...
by utunnels
Sun Feb 12, 2012 3:56 am
Forum: Support and Development
Topic: framerate/dt problem
Replies: 10
Views: 5755

Re: framerate/dt problem

Back to topic, I think it has something to do with float calculation (like 100.00000000001 vs 99.99999999999). if self.py == math.floor(self.y) and self.px == math.floor(self.x) then Although you do this check here, but maybe math.round is better? Or perhaps you should avoid using dt as a parameter,...
by utunnels
Sun Feb 12, 2012 3:41 am
Forum: Support and Development
Topic: framerate/dt problem
Replies: 10
Views: 5755

Re: framerate/dt problem

Nah, it doesn't report error in 0.7.2, just crash, so I'm not sure what happened.
Although in 0.8.0 it works when if I remove those .lua.
by utunnels
Sun Feb 12, 2012 3:24 am
Forum: Support and Development
Topic: framerate/dt problem
Replies: 10
Views: 5755

Re: framerate/dt problem

BTW, the game doesn't run on my PC (windows).

I also tried 0.7.2, but it simply crashed.

========

Edit*

Code: Select all

require("src/constants")
require("src/map")
require("src/actors")
require("scenes/game")
Remove those .lua and it works.
by utunnels
Sat Feb 11, 2012 4:21 am
Forum: Support and Development
Topic: Randomizing an initial layout, with caveats
Replies: 9
Views: 1841

Re: Randomizing an initial layout, with caveats

In short,

1. Add a block without considering the issue.
2. Destroy those adjacent blocks using the rule you already wrote for your game.
3. Repeat 1 and 2 until there are enough blocks on screen.