miniature-lawyer-98519
03/29/2023, 9:43 PMminiature-lawyer-98519
03/29/2023, 9:43 PMminiature-lawyer-98519
03/29/2023, 9:45 PMminiature-lawyer-98519
03/29/2023, 9:46 PMhttps://cdn.discordapp.com/attachments/853414608747364352/1090753825004064949/Screenshot_2023-03-30_at_00.46.03.png▾
miniature-lawyer-98519
03/29/2023, 9:47 PMfaint-toothbrush-51643
03/29/2023, 9:49 PMfaint-toothbrush-51643
03/29/2023, 9:50 PMminiature-lawyer-98519
03/29/2023, 9:52 PMComponent
... (in my case i made a class). Can't u infer as well the entity type ?
dart
abstract class Component<T extends Entity> extends Entity {
late T? entity;
@protected
void bindAsComponent();
}
miniature-lawyer-98519
03/29/2023, 9:53 PMdart
class Click extends Component<Visual> {
@override
void bindAsComponent() {
entity.onPress(this, bla);
}
}
billowy-waiter-28954
03/29/2023, 9:55 PMminiature-lawyer-98519
03/29/2023, 10:02 PMminiature-lawyer-98519
03/29/2023, 10:47 PMdart
if (inputs.keyPressed(KeyCode.arrowLeft)) {
posX -= 100 * delta;
} else if (inputs.keyPressed(KeyCode.arrowRight)) {
posX += 100 * delta;
}
if (inputs.keyPressed(KeyCode.arrowUp)) {
posY -= 100 * delta;
} else if (inputs.keyPressed(KeyCode.arrowDown)) {
posY += 100 * delta;
}
if (inputs.keyJustPressed(KeyCode.space)) {
scale *= 1.25;
}
ctx.fillStyle = Colors.red;
ctx.fillRect(posX, posY, 100 * scale, 100 * scale);
keyboard input in 😛miniature-lawyer-98519
03/29/2023, 10:47 PMbillowy-waiter-28954
04/07/2023, 9:34 PMbillowy-waiter-28954
04/08/2023, 10:13 AMbillowy-waiter-28954
04/10/2023, 5:30 PMbillowy-waiter-28954
04/10/2023, 5:30 PMfaint-toothbrush-51643
04/10/2023, 6:10 PMbillowy-waiter-28954
04/10/2023, 6:18 PMbillowy-waiter-28954
04/10/2023, 6:18 PMbillowy-waiter-28954
04/10/2023, 6:18 PMbillowy-waiter-28954
04/10/2023, 6:19 PMminiature-lawyer-98519
04/12/2023, 9:36 AMmammoth-engine-80319
04/13/2023, 9:49 PMmammoth-engine-80319
04/13/2023, 9:49 PMbillowy-waiter-28954
04/13/2023, 10:14 PMbillowy-waiter-28954
04/14/2023, 4:45 PMbillowy-waiter-28954
04/14/2023, 4:45 PMhttps://cdn.discordapp.com/attachments/853414608747364352/1096476430713487520/scenes-schema.png▾
aloof-glass-16798
04/15/2023, 2:56 AMblue-lizard-2018
04/16/2023, 8:58 AM