Esempio n. 1
0
import cppyy
cppyy.include("ball.hpp")
from cppyy.gbl import Ball

b = Ball(150, 200)
print(b.get_x(), b.get_y())
for i in range(10):
    b.move()
    print(b.get_x(), b.get_y())
Esempio n. 2
0
#!/usr/bin/env python3
'''
@author  Michele Tomaiuolo - http://www.ce.unipr.it/people/tomamic
@license This software is free - http://www.gnu.org/licenses/gpl.html
'''

import cppyy
cppyy.include("ball.cpp")
from cppyy.gbl import Ball

b = Ball((150, 200))
for i in range(10):
    b.move()
    print(b.position())
Esempio n. 3
0
#!/usr/bin/env python3
'''
@author  Michele Tomaiuolo - http://www.ce.unipr.it/people/tomamic
@license This software is free - http://www.gnu.org/licenses/gpl.html
'''

import cppyy
cppyy.include("ball.cpp")
from cppyy.gbl import Ball

b1 = Ball(40, 80)
b2 = Ball(80, 40)

for i in range(25):
    b1.move()
    b2.move()
    print(b1.pos_x(), b1.pos_y())
    print(b2.pos_x(), b2.pos_y())