-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.lua
48 lines (29 loc) · 873 Bytes
/
main.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
-- Cette ligne permet d'afficher des traces dans la console pendant l'éxécution
io.stdout:setvbuf('no')
-- Empèche Love de filtrer les contours des images quand elles sont redimentionnées
-- Indispensable pour du pixel art
love.graphics.setDefaultFilter("nearest")
if arg[#arg] == "-debug" then require("mobdebug").start() end
function love.load()
event = require("event")
event:new_event("test_event")
matriache = {}
function matriache:test_event(a,b,c)
print("This is a test")
print(a,b,c)
end
event:subscribe("test_event", matriache)
end
function love.update()
end
function love.draw()
end
function love.keypressed(key)
if key =="space" then
local a = 4
local b = " I like potatoes"
local c = " But I preferer, chocolate"
event:publish("test_event",a,b,c)
--event:unsubscribe("test", matriache)
end
end