This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8469223 01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Intent: interface to the GodotPayments module (remember to add the java path in the project settings android>modules ) | |
"Intent.gd" | |
extends Node | |
# Interface for the GodotPayments module | |
# To use extend this script and save the result on the Global singleton 'Data' | |
const STATIC_RESPONSE_NONE = 0 | |
const STATIC_RESPONSE_ALL = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const TIMER = 2.0 # 2 seconds | |
var timer = 0.0 | |
# use _process or _fixed_process for physics stuff | |
func _process(delta): | |
timer += delta | |
if timer > TIMER: | |
do_something() | |
timer = 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12-28 21:33:42.419: D/GODOT(27641): ** GODOT ACTIVITY CREATED HERE *** | |
12-28 21:33:43.319: D/GODOT(27641): command_line is null? no | |
12-28 21:33:43.359: I/godot(27641): **INIT EVENT! - 0xe45880 | |
12-28 21:33:43.359: I/godot(27641): ***************** HELLO FROM JNI!!!!!!!! | |
12-28 21:33:43.359: I/godot(27641): *******CLASS FOUND!!! | |
12-28 21:33:43.359: I/godot(27641): STEP2, 0x1d200202 | |
12-28 21:33:43.359: I/godot(27641): STEP3 1092602616 | |
12-28 21:33:43.359: I/godot(27641): STEP4, 0x87a0002d | |
12-28 21:33:43.359: I/godot(27641): STEP4.5, 0x1d200206 | |
12-28 21:33:43.359: I/godot(27641): STEP7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You can do this | |
func _fixed_process(delta): | |
var pos_a = get_node("body_a").get_global_pos() | |
var pos_b = get_node("body_b").get_global_pos() | |
# lets say you want to move the body_a to body_b | |
var new_pos = pos_a.linear_interpolate(pos_b, delta) | |
get_node("body_a").set_global_pos(new_pos) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1º Add the direction vectors. Ie: you want to add the right key + up key velocity. | |
var vel = vel_left + vel_right | |
2º Normalize the velocity, this will make the length of the vector exactly 1 unit. | |
vel = vel.normalized() | |
3º Now the movement would be only 1 unit per frame, so multiply for the real speed | |
vel = vel * speed | |
translate(vel * delta) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. | |
# creamos el usuario | |
CREATE USER 'u_registrado'@'localhost' IDENTIFIED BY '1234'; | |
# le damos permiso para que lea la tabla noticia | |
GRANT SELECT ON `bd`.`NOTICIA` TO 'u_registrado'@'localhost'; | |
# le damos permiso al usuario para agregar comentarios (no modificar) | |
GRANT INSERT ON `bd`.`COMENTARIO` TO 'u_registrado'@'localhost'; | |
# le damos permiso para modificar los datos de su cuenta | |
GRANT UPDATE ON `bd`.`USUARIO_REGISTRADO` TO 'u_registrado'@'localhost'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Parcial concurrente 2da fecha 2013 | |
1) Resolver con MONITORES el siguiente problema. | |
En un Crucero por el Mediterráneo hay 200 personas que deben subir al barco por medio de 10 lanchas con 20 lugares | |
cada una. Cada persona sube a la lancha que le corresponde. Cuando en una lancha han subido sus 20 personas durante 5 minutos navega hasta el barco. Recién cuando han llegado las 10 lanchas al barco se les permite a las 200 personas subir al barco. | |
NOTA: suponga que cada persona llama a la función int NúmeroDeLancha() que le devuelve un valor entre 0 y 9 indicando la lancha a la que debe subir. Maximizar la | |
concurrencia. | |
process Persona[p: 1..200] { | |
int nroLancha = NumeroLancha(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#inside the singleton | |
func _ready(): | |
Globals.set("singleton", self) | |
#in any other node | |
func example_func(): | |
Globals.get("singleton") # get the singleton node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#===========Escena1.scn================ | |
func _ready(): | |
Globals.set("idioma", -1) # no es necesario hacer esto | |
func btn_1_click(): | |
Globals.set("idioma", 1) | |
func btn_2_click(): | |
Globals.set("idioma", 2) |