Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - AnToX98

Pages: [1] 2 3 ... 8
1
TI-Nspire / Re: [lua] fractal zoomer
« on: June 09, 2014, 11:29:43 am »
Wow so pretty :D , I have to show dat to pierrotdu18 :D

Now, Jens K -> back to the editor :D

2
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: May 27, 2014, 12:42:03 pm »
No I'm 100% on the editor and I can't open menu :(


EDIT : I deleted "platform.apilevel = 1.0" and replaced create by on.construction and it works :D

3
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: May 27, 2014, 12:06:34 pm »
Why I can't open MENU :D ?

4
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: May 26, 2014, 12:08:37 pm »
The old image format still works as well.

5
TI-Nspire / Re: Jens' Script Editor - An on-calc lua editor
« on: May 25, 2014, 02:55:04 pm »
Thank you jens you are awesome :)

Reducing functions would be very nice to as I mentioned it but I know it's hard to do it :)


Could you give anyways the new file ?


Another question : how about compatibility with the "Ressources" images on os 3.6 ? And customize the colours ?

6
TI-Nspire / Re: [Ndless] nKaruga
« on: May 15, 2014, 02:20:30 pm »
One simple word :

wow :p



7
Lua / Re: Chipmunk Physics
« on: April 15, 2014, 03:17:38 am »
What do you mean by shifting the view ?


I think that it is slow because of re-adding each time new shape to spaces, but I don't know how to do it by different way. When I move the body by using setPos, just the body moves and not the shape...

8
TI-Nspire / Re: fast 2D shadow engine in lua
« on: April 14, 2014, 12:36:33 pm »
Looks super nice :D

9
Lua / Re: Chipmunk Physics
« on: April 13, 2014, 03:34:35 am »
Help :( ?

10
Lua / Re: Chipmunk Physics
« on: April 12, 2014, 05:54:41 am »
Hi jims :)



I'm back with my falldown but I have 2 problems :
- The ball don't falls in the hole --'
- It slows down so much : why ?

Code: [Select]
------------------------------------------------
----------- LUA FALLDOWN, BY ANTOX98 -----------
------------------------------------------------

platform.apilevel = "2.0"

require "physics"

----------------------
----- BALL CLASS -----
----------------------

Ball = class()
Seg = class()

function Ball:init(x, y, w, mass)   
    self.width = w
    self.body = physics.Body(mass, physics.misc.momentForCircle(mass, 0, 10, ZERO))
    self.body:setPos(physics.Vect(x, y))
    self.body:setMass(mass)
    self.shape = physics.CircleShape(self.body, w, ZERO)
    self.shape:setRestitution(0.6)
    self.shape:setFriction(0.6)
end

function Seg:init(x1, y1, x2, y2)
    local a, b = physics.Vect(x1, y1), physics.Vect(x2, y2)       
    local mass = physics.misc.INFINITY()
    self.coor = {x1,y1,x2,y2}
    self.body = physics.Body(mass, physics.misc.momentForSegment(mass, a, b))
    --self.body:setPos(physics.Vect(x1, y1))
    self.body:setMass(mass)
    self.shape = physics.SegmentShape(self.body, a, b, 18)
    self.shape:setRestitution(0.6)
    self.shape:setFriction(0.6)
end

function Ball:paint(gc)
    local p = self.body:pos()
    local x, y = p:x(), p:y()
    local r = self.width / 2
   
    gc:setColorRGB(255,0,0)
    gc:fillArc(x+r, y+r , self.width, self.width, 0, 360)
end

function Seg:paint(gc)
   
    local a = self.shape:a()
    local b = self.shape:b()
    gc:setPen("thick")
    gc:setColorRGB(0,0,0)
    gc:drawLine(a:x(), a:y(), b:x(), b:y())
end

function initGame()
    w = 318
    h = 212
   
    ZERO = physics.Vect(0,0)
    LARGE = physics.misc.INFINITY()
   
    space = physics.Space()
    space:setGravity(physics.Vect(0,9.8))
   
    count = 100
   
    walls = {Seg(0,0,0,h), Seg(0,h,w,h), Seg(w,h,w,0)}
    for i = 1, #walls do
        space:addShape(walls[i].shape)   
    end
   
    seg = {}
    --space:addBody(sol.body)

   
    ball = Ball(w/2-10, 30, 20, 1000)
   
    space:addBody(ball.body)
    space:addShape(ball.shape)
   
    timer.start(0.01)
end
initGame()

function on.timer()
    space:step(0.1)
   
    if count == 100 then
        count = 0
        generate()
    else   
        count = count + 1
    end   
    moveSeg(0.5)
    platform.window:invalidate()
end

function generate()
    r = math.random(0, w-40)
   
    seg[#seg+1] = Seg(0, h, r, h)
    seg[#seg+1] = Seg(r+40, h, w, h)
    space:addShape(seg[#seg-1].shape)
    space:addShape(seg[#seg].shape)
end

function moveSeg(n)
    for i = 1, #seg do
        seg[i].coor = {seg[i].coor[1],seg[i].coor[2]-n,seg[i].coor[3],seg[i].coor[4]-n}
        local a, b = physics.Vect(seg[i].coor[1], seg[i].coor[2]), physics.Vect(seg[i].coor[3], seg[i].coor[4])       
        local mass = physics.misc.INFINITY()       
        seg[i].body = physics.Body(mass, physics.misc.momentForSegment(mass, a, b))
        --self.body:setPos(physics.Vect(x1, y1))
        seg[i].body:setMass(mass)
        seg[i].shape = physics.SegmentShape(seg[i].body, a, b, 18)
        seg[i].shape:setRestitution(0.6)
        seg[i].shape:setFriction(0.6)
        space:addShape(seg[i].shape)
    end   
end

function on.arrowKey(key)
    if key == "right" then
        ball.body:setAngVel(5)
    elseif key == "left" then
        ball.body:setAngVel(-5)
    end
end

function on.paint(gc)
    ball:paint(gc)   
    for i = 1, #seg do
        seg[i]:paint(gc)
    end
 
   
end

11
TI-Nspire / Re: Isola
« on: April 11, 2014, 03:57:17 am »
Very nice game : just an AI and everything is done =D

12
TI-Nspire / Re: Minecraft 2D for TI-Nspire
« on: April 04, 2014, 12:04:10 pm »
Wow, awesome work Jens ! You deserve the POTY ! Now I hope you'll work a little bit on the editor :/

13
TI-Nspire / Re: 2048 for Nspire
« on: April 01, 2014, 11:08:36 am »
Nice game and super coding :)

14
Lua / Re: Lua Q&A
« on: March 31, 2014, 02:26:19 am »
Here's my code :


Code: [Select]
------------------------------------------------
----------- LUA FALLDOWN, BY ANTOX98 -----------
------------------------------------------------


platform.apilevel = "2.0"


require "physics"


----------------------
----- BALL CLASS -----
----------------------


Ball = class()
Seg = class()


function Ball:init(x, y, w, mass)   
    self.width = w
    self.body = physics.Body(mass, physics.misc.momentForCircle(mass, 0, 10, ZERO))
    self.body:setPos(physics.Vect(x, y))
    self.body:setMass(mass)
    self.shape = physics.CircleShape(self.body, w, ZERO)
    self.shape:setRestitution(0.6)
    self.shape:setFriction(0.6)
end


function Seg:init(x1, y1, x2, y2)
    local a, b = physics.Vect(x1, y1), physics.Vect(x2, y2)
       
    local mass = physics.misc.INFINITY()
    self.coor = {x1,y1,x2,y2}
    self.body = physics.Body(mass, physics.misc.momentForSegment(mass, a, b))
    --self.body:setPos(physics.Vect(x1, y1))
    self.body:setMass(mass)
    self.shape = physics.SegmentShape(self.body, a, b, 10)
    self.shape:setRestitution(0.6)
    self.shape:setFriction(0.6)
end


function Ball:paint(gc)
    local p = self.body:pos()
    local x, y = p:x(), p:y()
    local r = self.width / 2
   
    gc:setColorRGB(255,0,0)
    gc:fillArc(x+r, y+r , self.width, self.width, 0, 360)
end


function Seg:paint(gc)
   
    local a = self.shape:a()
    local b = self.shape:b()
   
    gc:setColorRGB(0,0,0)
    gc:drawLine(a:x(), a:y(), b:x(), b:y())
end


function initGame()
    w = 318
    h = 212
   
    ZERO = physics.Vect(0,0)
    LARGE = physics.misc.INFINITY()
   
    space = physics.Space()
    space:setGravity(physics.Vect(0,9.)
   
    sol = Seg(0,200,w,200)
    --space:addBody(sol.body)
    space:addShape(sol.shape)
   
    ball = Ball(w/2-10, 30, 20, 1000)
   
    space:addBody(ball.body)
    space:addShape(ball.shape)
   
    sol.body:setPos(physics.Vect(0,-30))
   
    timer.start(0.01)
end
initGame()


function on.timer()
    space:step(0.1)
    platform.window:invalidate()
end


function on.paint(gc)
    ball:paint(gc) 
    sol:paint(gc)
end

sol.body:setPos(physics.Vect(0,-30))
[/size]
[/size][size=78%]Strangely, the body moves but not the shape....[/size][/code]

15
Lua / Re: Lua Q&A
« on: March 30, 2014, 08:57:28 am »
Please could someone help me :( ?

Pages: [1] 2 3 ... 8