elegant-twilight-61392
02/23/2023, 2:50 AMimportant-egg-61899
02/23/2023, 2:50 AMimportant-egg-61899
02/23/2023, 2:50 AMimportant-egg-61899
02/23/2023, 2:50 AMimportant-egg-61899
02/23/2023, 2:51 AMhaxe
override public function create()
{
super.create();
FlxEcho.init({
width: FlxG.width,
height: FlxG.height,
gravity_y: 981
});
// world = new World({width: 1280, height: 720});
// add(world);
ground = new FlxSprite(0, 210).loadGraphic('assets/images/level.png');
add(ground);
ground.add_body({
mass: 0,
elasticity: -1,
shape: {
type: POLYGON,
vertices: collision('', ground)
}
});
char = new Character(50, 620, 'sonic_s1');
add(char);
// char.drag.x = 40;
char.setPosition(50, 20);
char.add_body({mass: 20, drag_x: 40});
char.listen(ground);
charBody = char.get_body();
FlxG.watch.addQuick('sonicX: ', charBody.x);
FlxG.watch.addQuick('sonicY: ', charBody.y);
FlxG.watch.addQuick('sonic.velocity.x: ', char.velocity.x);
FlxG.watch.addQuick('sonic.velocity.y: ', char.velocity.y);
FlxG.watch.addQuick('A pressed: ', FlxG.keys.pressed.A);
FlxG.watch.addQuick('D pressed: ', FlxG.keys.pressed.D);
FlxG.watch.addQuick("sonic's speed: ", char.speed);
// char.scale.x *= 2;
// char.scale.y *= 2;
}
(my create function btw)important-egg-61899
02/23/2023, 2:54 AMimportant-egg-61899
02/23/2023, 2:54 AMimportant-egg-61899
02/23/2023, 2:54 AMecho-flixel)limited-psychiatrist-77022
02/23/2023, 3:16 AMwitty-island-52596
02/23/2023, 3:28 AMvictorious-alarm-20502
02/23/2023, 10:05 AMvictorious-alarm-20502
02/23/2023, 10:05 AMtall-teacher-57409
02/23/2023, 10:16 AMhallowed-holiday-15370
02/23/2023, 10:33 AMvictorious-alarm-20502
02/23/2023, 10:51 AMvictorious-alarm-20502
02/23/2023, 10:52 AMvictorious-alarm-20502
02/23/2023, 10:54 AMvictorious-alarm-20502
02/23/2023, 11:04 AMhallowed-holiday-15370
02/23/2023, 11:04 AMhaxe
// MY CODE `
Format
That function does not look like it's going to work like you want it to work.victorious-alarm-20502
02/23/2023, 11:05 AMhallowed-holiday-15370
02/23/2023, 11:06 AMvictorious-alarm-20502
02/23/2023, 11:35 AMgreat-oyster-61535
02/23/2023, 1:45 PMimportant-egg-61899
02/23/2023, 5:01 PMimportant-egg-61899
02/23/2023, 5:02 PMgreat-oyster-61535
02/23/2023, 5:04 PMimportant-egg-61899
02/23/2023, 5:05 PMimportant-egg-61899
02/23/2023, 5:05 PMhaxe
case 'test':
nestedArr = [
[0, 660], [135, 670], [235, 660], [280, 660], [310, 670], [345, 660], [474, 600], [540, 598], [655, 630], [740, 660], [798, 657],
[817, 654], [836, 645], [855, 632], [865, 618], [875, 594], [925, 599], [970, 600], [1035, 600], [1155, 600], [1155, 565], [1220, 565],
[1220, 530], [1280, 530], [1280, 400], [1340, 486], [1340, 760], [0, 760]];important-egg-61899
02/23/2023, 5:06 PMimportant-egg-61899
02/23/2023, 5:07 PM