airstruck / knife Goto Github PK
View Code? Open in Web Editor NEWA collection of useful micro-modules for Lua.
License: MIT License
A collection of useful micro-modules for Lua.
License: MIT License
Is it possible to use value base components like this:
local entity = {
position = { x = 0, y = 0},
health = 100
}
it is possible to create and read them in a system but i cannot change the value of them. Health always stays 100.
I might have misunderstood the inheritance mechanism, but I spent quite a bit of time scratching my head on this one. Below is an example of a base "class" called Item
, and two subclasses, Sword
and Shield
local Class = require("base")
local Item = Class:extend()
local Sword = Class:extend(Item)
local Shield = Class:extend(Item)
function Item:init()
print("Init")
end
function Sword:constructor()
print("Sword")
self:init()
end
function Shield:constructor()
print("Shield")
self:init()
end
print("Make Sword")
local sword = Sword()
print("Make Shield")
local shield = Shield()
Running the code gives:
Make Sword
Shield
Init
Make Shield
Shield
Init
So it looks like the constructor of Shield
has overridden the constructor Sword
. What am I doing wrong?
Hey airstruck! Your library is great; I've successfully used Chain mixed with Timer.tween to get a bunch of sprites autonomously moving around a grid-based map, and the code for it is fairly clean and compact. However, I now want those sprites to be able to move along their path one at a time, waiting for the one prior to finish before moving on, and for this I figured I could just Chain some Chains (the Chains I'm currently using are effectively just movement tweens and take place concurrently, so chaining them would accomplish this). The documentation suggests that Chains can take either standard go-function links or other Chain objects as arguments, but this doesn't seem to be working in my code; everything is staying still. Here's a gist in case this may prove helpful; I'm sure I'm just using the library wrong! Thanks for taking a look!
https://gist.github.com/coltonoscopy/7475bcd4ad3892641d6c348816cb09fd
Hi,
Your chain module is awesome! I use it for chain many animation actions together. But i also want to using spawn actions with chain too. For example:
I want to move and scale object play in same time and then chain with other move?
(Actually, i want using chain and spawn like this: http://www.cocos2d-x.org/wiki/Actions)
Thank so much!
It would be great if the utilities had version numbers, so when checking to see if I have the latest version of one of them I can compare the version numbers instead of diffing. A rockspec would be ideal, but a simple comment at the top or table property would be better than nothing. If you want a pull request let me know. Thanks!
I am here, sorry for bothering you again, how to safely repeat chain actions:
For example, if we set chain repeat to true, this code:
Chain(
TimedText(1, 'fading in'),
TimedText(1, 'showing splash screen'),
TimedText(1, 'showing title screen'),
TimedText(1, 'showing demo')
)()
Will print
fading in
showing splash screen
showing title screen
showing demo
and then continue
fading in
showing splash screen
showing title screen
showing demo
Until some flag is turn on or off
Thank so much!
critical omission if you ask me
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.