diff --git a/assets/data/charts/test/modchart.hx b/assets/data/charts/test/modchart.hx index 1cd8f617..14cf6431 100644 --- a/assets/data/charts/test/modchart.hx +++ b/assets/data/charts/test/modchart.hx @@ -5,8 +5,18 @@ function create() { enableCameraHacks = false; } -function postUpdate(elapsed) { - var sin = Math.sin(curBeatFloat * Math.PI / 2); +function postCreate() { + for(i in 0...6) { + var name = "tank" + Std.string(i); + stage.getSprite(name).visible = false; + } +} - camGame.angle = sin * -15; +function postUpdate(elapsed) { + // var sin = Math.sin(curBeatFloat * Math.PI / 2); + + // camGame.angle = sin * -15; + + if (curSection != null) + defaultCamZoom = curSection.mustHitSection ? 0.9 : 0.5; } \ No newline at end of file diff --git a/assets/data/charts/test/normal.json b/assets/data/charts/test/normal.json index 5141e484..58a181eb 100644 --- a/assets/data/charts/test/normal.json +++ b/assets/data/charts/test/normal.json @@ -1 +1 @@ -{"song":{"song":"Test","bpm":150.0,"needsVoices":true,"player1":"bf","player2":"bf-pixel","speed":1.6,"notes":[{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[12800.0,0,0.0],[13199.999,1,0.0],[13599.999,2,0.0],[13999.999,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[14399.999,0,0.0],[14799.999,1,0.0],[15199.999,2,0.0],[15599.999,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[15999.999,0,0.0],[16199.999,0,0.0],[16400.0,1,0.0],[16600.0,1,0.0],[16800.0,2,0.0],[17000.0,2,0.0],[17200.0,3,0.0],[17400.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[17600.0,0,0.0],[17800.0,0,0.0],[18000.0,1,0.0],[18200.0,1,0.0],[18400.0,2,0.0],[18600.0,2,0.0],[18800.0,3,0.0],[19000.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[19200.0,0,300.0],[19600.0,1,300.0],[20000.0,2,300.0],[20400.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[20800.0,0,300.0],[21200.0,1,300.0],[21600.0,2,300.0],[22000.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[22400.0,0,700.0],[22800.0,1,300.0],[23200.0,2,700.0],[23600.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[24000.0,0,700.0],[24400.0,1,300.0],[24800.0,2,700.0],[25200.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[25600.0,0,0.0],[25600.0,1,0.0],[26399.998,3,0.0],[26399.998,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[27199.998,0,0.0],[27199.998,2,0.0],[27599.998,0,0.0],[27599.998,2,0.0],[27999.998,3,0.0],[27999.998,1,0.0],[28199.998,1,0.0],[28199.998,3,0.0],[28399.998,3,0.0],[28399.998,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[28799.998,0,0.0],[28799.998,1,0.0],[29599.998,3,0.0],[29599.998,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[30399.998,0,0.0],[30399.998,2,0.0],[30799.998,0,0.0],[30799.998,2,0.0],[31199.998,3,0.0],[31199.998,1,0.0],[31399.998,1,0.0],[31399.998,3,0.0],[31599.998,3,0.0],[31599.998,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[31999.998,0,0.0],[32099.998,1,0.0],[32199.998,0,100.0],[32399.998,3,0.0],[32499.998,2,0.0],[32599.998,3,100.0],[32800.0,0,0.0],[32900.0,1,0.0],[33000.0,0,100.0],[33200.0,3,0.0],[33300.0,2,0.0],[33400.0,3,100.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[33600.0,2,0.0],[33700.0,3,0.0],[33800.0,2,100.0],[34000.0,1,0.0],[34100.0,0,0.0],[34200.0,1,100.0],[34400.0,2,0.0],[34500.0,3,0.0],[34600.0,2,100.0],[34800.0,1,0.0],[34900.0,0,0.0],[35000.0,1,100.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[35200.0,0,0.0],[35300.0,1,0.0],[35400.0,0,100.0],[35600.0,3,0.0],[35700.0,2,0.0],[35800.0,3,100.0],[36000.0,0,0.0],[36100.0,1,0.0],[36200.0,0,100.0],[36400.0,3,0.0],[36500.0,2,0.0],[36600.0,3,100.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[36800.0,2,0.0],[36900.0,3,0.0],[37000.0,2,100.0],[37200.0,1,0.0],[37300.0,0,0.0],[37400.0,1,100.0],[37600.0,2,0.0],[37700.0,3,0.0],[37800.0,2,100.0],[38000.0,1,0.0],[38100.0,0,0.0],[38200.0,1,100.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[38400.0,0,0.0],[38600.0,3,0.0],[38800.0,1,0.0],[38900.0,2,0.0],[39000.0,1,0.0],[39100.0,2,0.0],[39200.0,0,0.0],[39400.0,3,0.0],[39600.0,1,0.0],[39700.0,2,0.0],[39800.0,1,0.0],[39900.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[40000.0,3,0.0],[40200.0,0,0.0],[40400.0,1,0.0],[40600.0,3,0.0],[40800.0,0,0.0],[41000.0,2,0.0],[41200.0,3,0.0],[41400.0,0,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[41600.0,0,0.0],[41800.0,3,0.0],[42000.0,1,0.0],[42100.0,2,0.0],[42200.0,1,0.0],[42300.0,2,0.0],[42400.0,0,0.0],[42600.0,3,0.0],[42800.0,1,0.0],[42900.0,2,0.0],[43000.0,1,0.0],[43100.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[43200.0,3,0.0],[43400.0,0,0.0],[43600.0,1,0.0],[43800.0,3,0.0],[44000.0,0,0.0],[44200.0,2,0.0],[44400.0,3,0.0],[44600.0,0,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[44800.0,0,0.0],[45066.6641,0,0.0],[45333.332,0,0.0],[45600.0,3,0.0],[45866.6641,3,0.0],[46133.332,3,0.0],[46266.6641,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[46400.0,1,100.0],[46800.0,1,200.0],[47200.0,1,300.0],[47600.0,1,400.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[48000.0,0,0.0],[48266.6641,0,0.0],[48533.332,0,0.0],[48800.0,3,0.0],[49066.6641,3,0.0],[49333.332,3,0.0],[49466.6641,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[49600.0,1,100.0],[50000.0,1,200.0],[50400.0,1,300.0],[50800.0,1,400.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[51200.0,0,800.0],[51200.0,1,800.0],[52599.9961,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[52799.9961,3,800.0],[52799.9961,1,800.0],[53599.9961,4,700.0],[53799.9961,5,499.999969],[53999.9961,6,300.0],[53999.9961,1,0.0],[53999.9961,2,0.0],[54199.9961,7,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[54399.9961,7,800.0],[54399.9961,6,800.0],[54399.9961,5,800.0],[54399.9961,4,800.0],[54399.9961,2,800.0],[54399.9961,0,800.0],[55799.9961,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[55999.9961,2,800.0],[55999.9961,3,800.0],[57199.9961,2,0.0],[57199.9961,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[57599.9961,1,800.0],[57599.9961,0,800.0],[58999.9961,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[59199.9961,3,800.0],[59199.9961,1,800.0],[59999.9961,4,700.0],[60199.9961,5,499.999969],[60399.9961,6,300.0],[60399.9961,1,0.0],[60399.9961,2,0.0],[60599.9961,7,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[60799.9961,7,800.0],[60799.9961,6,800.0],[60799.9961,5,800.0],[60799.9961,4,800.0],[60799.9961,0,800.0],[60799.9961,2,800.0],[62199.9961,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[62399.9961,2,800.0],[62399.9961,3,800.0],[63199.9961,6,0.0],[63299.9961,7,0.0],[63399.9961,6,0.0],[63499.9961,7,0.0],[63599.9961,4,0.0],[63599.9961,2,0.0],[63599.9961,1,0.0],[63649.9961,5,0.0],[63699.9961,6,0.0],[63749.9961,7,0.0],[63799.9961,6,0.0],[63849.9961,5,0.0],[63899.9961,4,0.0],[63949.9961,5,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[63999.9961,3,0.0],[64199.9961,2,0.0],[64399.9961,0,0.0],[64599.9961,3,499.999969],[65199.9961,3,0.0],[65399.9961,0,400.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[66000.0,0,0.0],[66200.0,1,0.0],[66400.0,0,0.0],[66666.6641,3,0.0],[66933.33,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[67200.0,3,0.0],[67300.0,2,0.0],[67800.0,2,0.0],[67850.0,0,449.999969],[68400.0,3,100.0],[68600.0,2,0.0],[68700.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[68800.0,0,0.0],[69000.0,1,0.0],[69200.0,0,0.0],[69400.0,3,0.0],[69600.0,2,0.0],[69800.0,3,300.0],[70200.0,0,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[70400.0,4,0.0],[70400.0,3,0.0],[70600.0,6,0.0],[70600.0,2,0.0],[70800.0,7,0.0],[70800.0,0,0.0],[71000.0,4,499.999969],[71000.0,3,499.999969],[71600.0,4,0.0],[71600.0,3,0.0],[71800.0,7,400.0],[71800.0,0,400.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[72400.0,7,0.0],[72400.0,0,0.0],[72600.0,5,0.0],[72600.0,1,0.0],[72800.0,7,0.0],[72800.0,0,0.0],[73066.6641,4,0.0],[73066.6641,3,0.0],[73333.33,6,0.0],[73333.33,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[73600.0,4,0.0],[73600.0,3,0.0],[73700.0,6,0.0],[73700.0,2,0.0],[74200.0,6,0.0],[74200.0,2,0.0],[74250.0,7,449.999969],[74250.0,0,449.999969],[74800.0,4,100.0],[74800.0,3,100.0],[75000.0,6,0.0],[75000.0,2,0.0],[75100.0,4,0.0],[75100.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[75200.0,7,0.0],[75200.0,0,0.0],[75400.0,5,0.0],[75400.0,1,0.0],[75600.0,7,0.0],[75600.0,0,0.0],[75800.0,4,0.0],[75800.0,3,0.0],[76000.0,6,0.0],[76000.0,2,0.0],[76200.0,4,300.0],[76200.0,3,300.0],[76600.0,0,0.0],[76600.0,7,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[76800.0,3,0.0],[76900.0,2,0.0],[77000.0,3,0.0],[77100.0,2,0.0],[77200.0,0,0.0],[77300.0,2,0.0],[77400.0,0,0.0],[77500.0,2,0.0],[77600.0,4,700.0],[77600.0,3,0.0],[77700.0,2,0.0],[77800.0,3,0.0],[77900.0,2,0.0],[78000.0,0,0.0],[78100.0,2,0.0],[78200.0,0,0.0],[78300.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[78400.0,7,700.0],[78400.0,3,0.0],[78500.0,1,0.0],[78600.0,3,0.0],[78700.0,1,0.0],[78800.0,0,0.0],[78900.0,1,0.0],[79000.0,0,0.0],[79100.0,1,0.0],[79200.0,5,400.0],[79200.0,3,0.0],[79300.0,1,0.0],[79400.0,3,0.0],[79500.0,1,0.0],[79600.0,0,0.0],[79700.0,1,0.0],[79800.0,0,0.0],[79900.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[80000.0,3,0.0],[80100.0,2,0.0],[80200.0,3,0.0],[80300.0,2,0.0],[80400.0,0,0.0],[80500.0,2,0.0],[80600.0,0,0.0],[80700.0,2,0.0],[80800.0,7,700.0],[80800.0,3,0.0],[80900.0,2,0.0],[81000.0,3,0.0],[81100.0,2,0.0],[81200.0,0,0.0],[81300.0,2,0.0],[81400.0,0,0.0],[81500.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[81600.0,4,700.0],[81600.0,3,0.0],[81700.0,1,0.0],[81800.0,3,0.0],[81900.0,1,0.0],[82000.0,0,0.0],[82100.0,1,0.0],[82200.0,0,0.0],[82300.0,1,0.0],[82400.0,5,400.0],[82400.0,3,0.0],[82500.0,1,0.0],[82600.0,3,0.0],[82700.0,1,0.0],[82800.0,0,0.0],[82900.0,1,0.0],[83000.0,0,0.0],[83100.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[83200.0,2,0.0],[83300.0,2,0.0],[83400.0,2,0.0],[83500.0,2,0.0],[83600.0,0,0.0],[83700.0,0,0.0],[83800.0,0,0.0],[83900.0,0,0.0],[84000.0,3,0.0],[84100.0,3,0.0],[84200.0,3,0.0],[84300.0,3,0.0],[84400.0,1,0.0],[84500.0,1,0.0],[84600.0,1,0.0],[84700.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[84800.0,0,0.0],[84933.33,0,0.0],[85066.6641,0,0.0],[85200.0,2,0.0],[85333.33,2,0.0],[85466.6641,2,0.0],[85600.0,3,0.0],[85733.33,3,0.0],[85866.6641,3,0.0],[86000.0,0,0.0],[86133.33,0,0.0],[86266.6641,0,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[86400.0,6,600.0],[86400.0,2,0.0],[86500.0,2,0.0],[86600.0,2,0.0],[86700.0,2,0.0],[86800.0,0,0.0],[86900.0,0,0.0],[87000.0,0,0.0],[87100.0,0,0.0],[87200.0,4,600.0],[87200.0,3,0.0],[87300.0,3,0.0],[87400.0,3,0.0],[87500.0,3,0.0],[87600.0,1,0.0],[87700.0,1,0.0],[87800.0,1,0.0],[87900.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[88000.0,7,600.0],[88000.0,0,0.0],[88133.33,0,0.0],[88266.6641,0,0.0],[88400.0,2,0.0],[88533.33,2,0.0],[88666.6641,2,0.0],[88800.0,5,600.0],[88800.0,3,0.0],[88933.33,3,0.0],[89066.6641,3,0.0],[89200.0,0,0.0],[89333.33,0,0.0],[89466.6641,0,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[89600.0,0,3200.0],[90000.0,3,300.0],[90400.0,2,300.0],[90800.0,1,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[91200.0,2,0.0],[91400.0,3,0.0],[91600.0,2,0.0],[91800.0,1,0.0],[92000.0,2,300.0],[92400.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[92800.0,0,3200.0],[93200.0,3,300.0],[93600.0,2,300.0],[94000.0,1,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[94400.0,2,0.0],[94600.0,3,0.0],[94800.0,2,0.0],[95000.0,1,0.0],[95200.0,2,300.0],[95600.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[96000.0,0,2300.0],[96400.0,3,300.0],[96800.0,2,300.0],[97200.0,1,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[97600.0,2,0.0],[97800.0,3,0.0],[98000.0,2,0.0],[98200.0,1,0.0],[98400.0,1,700.0],[98400.0,2,300.0],[98800.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[99200.0,2,300.0],[99200.0,0,700.0],[99600.0,2,0.0],[99800.0,2,0.0],[100000.0,3,300.0],[100000.0,1,300.0],[100400.0,2,300.0],[100400.0,0,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[100800.0,3,300.0],[100800.0,1,700.0],[101200.0,2,300.0],[101600.0,3,300.0],[101600.0,1,700.0],[102000.0,2,300.0]]}]},"generatedBy":"SNIFF ver.6"} \ No newline at end of file +{"song":{"song":"Test","bpm":150.0,"needsVoices":true,"player1":"bf","player2":"bf-pixel","stage":"tank","speed":1.6,"notes":[{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[12800.0,0,0.0],[13199.999,1,0.0],[13599.999,2,0.0],[13999.999,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[14399.999,0,0.0],[14799.999,1,0.0],[15199.999,2,0.0],[15599.999,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[15999.999,0,0.0],[16199.999,0,0.0],[16400.0,1,0.0],[16600.0,1,0.0],[16800.0,2,0.0],[17000.0,2,0.0],[17200.0,3,0.0],[17400.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[17600.0,0,0.0],[17800.0,0,0.0],[18000.0,1,0.0],[18200.0,1,0.0],[18400.0,2,0.0],[18600.0,2,0.0],[18800.0,3,0.0],[19000.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[19200.0,0,300.0],[19600.0,1,300.0],[20000.0,2,300.0],[20400.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[20800.0,0,300.0],[21200.0,1,300.0],[21600.0,2,300.0],[22000.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[22400.0,0,700.0],[22800.0,1,300.0],[23200.0,2,700.0],[23600.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[24000.0,0,700.0],[24400.0,1,300.0],[24800.0,2,700.0],[25200.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[25600.0,0,0.0],[25600.0,1,0.0],[26399.998,3,0.0],[26399.998,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[27199.998,0,0.0],[27199.998,2,0.0],[27599.998,0,0.0],[27599.998,2,0.0],[27999.998,3,0.0],[27999.998,1,0.0],[28199.998,1,0.0],[28199.998,3,0.0],[28399.998,3,0.0],[28399.998,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[28799.998,0,0.0],[28799.998,1,0.0],[29599.998,3,0.0],[29599.998,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[30399.998,0,0.0],[30399.998,2,0.0],[30799.998,0,0.0],[30799.998,2,0.0],[31199.998,3,0.0],[31199.998,1,0.0],[31399.998,1,0.0],[31399.998,3,0.0],[31599.998,3,0.0],[31599.998,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[31999.998,0,0.0],[32099.998,1,0.0],[32199.998,0,100.0],[32399.998,3,0.0],[32499.998,2,0.0],[32599.998,3,100.0],[32800.0,0,0.0],[32900.0,1,0.0],[33000.0,0,100.0],[33200.0,3,0.0],[33300.0,2,0.0],[33400.0,3,100.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[33600.0,2,0.0],[33700.0,3,0.0],[33800.0,2,100.0],[34000.0,1,0.0],[34100.0,0,0.0],[34200.0,1,100.0],[34400.0,2,0.0],[34500.0,3,0.0],[34600.0,2,100.0],[34800.0,1,0.0],[34900.0,0,0.0],[35000.0,1,100.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[35200.0,0,0.0],[35300.0,1,0.0],[35400.0,0,100.0],[35600.0,3,0.0],[35700.0,2,0.0],[35800.0,3,100.0],[36000.0,0,0.0],[36100.0,1,0.0],[36200.0,0,100.0],[36400.0,3,0.0],[36500.0,2,0.0],[36600.0,3,100.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[36800.0,2,0.0],[36900.0,3,0.0],[37000.0,2,100.0],[37200.0,1,0.0],[37300.0,0,0.0],[37400.0,1,100.0],[37600.0,2,0.0],[37700.0,3,0.0],[37800.0,2,100.0],[38000.0,1,0.0],[38100.0,0,0.0],[38200.0,1,100.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[38400.0,0,0.0],[38600.0,3,0.0],[38800.0,1,0.0],[38900.0,2,0.0],[39000.0,1,0.0],[39100.0,2,0.0],[39200.0,0,0.0],[39400.0,3,0.0],[39600.0,1,0.0],[39700.0,2,0.0],[39800.0,1,0.0],[39900.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[40000.0,3,0.0],[40200.0,0,0.0],[40400.0,1,0.0],[40600.0,3,0.0],[40800.0,0,0.0],[41000.0,2,0.0],[41200.0,3,0.0],[41400.0,0,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[41600.0,0,0.0],[41800.0,3,0.0],[42000.0,1,0.0],[42100.0,2,0.0],[42200.0,1,0.0],[42300.0,2,0.0],[42400.0,0,0.0],[42600.0,3,0.0],[42800.0,1,0.0],[42900.0,2,0.0],[43000.0,1,0.0],[43100.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[43200.0,3,0.0],[43400.0,0,0.0],[43600.0,1,0.0],[43800.0,3,0.0],[44000.0,0,0.0],[44200.0,2,0.0],[44400.0,3,0.0],[44600.0,0,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[44800.0,0,0.0],[45066.6641,0,0.0],[45333.332,0,0.0],[45600.0,3,0.0],[45866.6641,3,0.0],[46133.332,3,0.0],[46266.6641,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[46400.0,1,100.0],[46800.0,1,200.0],[47200.0,1,300.0],[47600.0,1,400.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[48000.0,0,0.0],[48266.6641,0,0.0],[48533.332,0,0.0],[48800.0,3,0.0],[49066.6641,3,0.0],[49333.332,3,0.0],[49466.6641,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[49600.0,1,100.0],[50000.0,1,200.0],[50400.0,1,300.0],[50800.0,1,400.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[51200.0,0,800.0],[51200.0,1,800.0],[52599.9961,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[52799.9961,3,800.0],[52799.9961,1,800.0],[53599.9961,4,700.0],[53799.9961,5,499.999969],[53999.9961,6,300.0],[53999.9961,1,0.0],[53999.9961,2,0.0],[54199.9961,7,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[54399.9961,7,800.0],[54399.9961,6,800.0],[54399.9961,5,800.0],[54399.9961,4,800.0],[54399.9961,2,800.0],[54399.9961,0,800.0],[55799.9961,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[55999.9961,2,800.0],[55999.9961,3,800.0],[57199.9961,2,0.0],[57199.9961,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[57599.9961,1,800.0],[57599.9961,0,800.0],[58999.9961,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[59199.9961,3,800.0],[59199.9961,1,800.0],[59999.9961,4,700.0],[60199.9961,5,499.999969],[60399.9961,6,300.0],[60399.9961,1,0.0],[60399.9961,2,0.0],[60599.9961,7,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[60799.9961,7,800.0],[60799.9961,6,800.0],[60799.9961,5,800.0],[60799.9961,4,800.0],[60799.9961,0,800.0],[60799.9961,2,800.0],[62199.9961,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[62399.9961,2,800.0],[62399.9961,3,800.0],[63199.9961,6,0.0],[63299.9961,7,0.0],[63399.9961,6,0.0],[63499.9961,7,0.0],[63599.9961,4,0.0],[63599.9961,2,0.0],[63599.9961,1,0.0],[63649.9961,5,0.0],[63699.9961,6,0.0],[63749.9961,7,0.0],[63799.9961,6,0.0],[63849.9961,5,0.0],[63899.9961,4,0.0],[63949.9961,5,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[63999.9961,3,0.0],[64199.9961,2,0.0],[64399.9961,0,0.0],[64599.9961,3,499.999969],[65199.9961,3,0.0],[65399.9961,0,400.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[66000.0,0,0.0],[66200.0,1,0.0],[66400.0,0,0.0],[66666.6641,3,0.0],[66933.33,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[67200.0,3,0.0],[67300.0,2,0.0],[67800.0,2,0.0],[67850.0,0,449.999969],[68400.0,3,100.0],[68600.0,2,0.0],[68700.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[68800.0,0,0.0],[69000.0,1,0.0],[69200.0,0,0.0],[69400.0,3,0.0],[69600.0,2,0.0],[69800.0,3,300.0],[70200.0,0,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[70400.0,4,0.0],[70400.0,3,0.0],[70600.0,6,0.0],[70600.0,2,0.0],[70800.0,7,0.0],[70800.0,0,0.0],[71000.0,4,499.999969],[71000.0,3,499.999969],[71600.0,4,0.0],[71600.0,3,0.0],[71800.0,7,400.0],[71800.0,0,400.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[72400.0,7,0.0],[72400.0,0,0.0],[72600.0,5,0.0],[72600.0,1,0.0],[72800.0,7,0.0],[72800.0,0,0.0],[73066.6641,4,0.0],[73066.6641,3,0.0],[73333.33,6,0.0],[73333.33,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[73600.0,4,0.0],[73600.0,3,0.0],[73700.0,6,0.0],[73700.0,2,0.0],[74200.0,6,0.0],[74200.0,2,0.0],[74250.0,7,449.999969],[74250.0,0,449.999969],[74800.0,4,100.0],[74800.0,3,100.0],[75000.0,6,0.0],[75000.0,2,0.0],[75100.0,4,0.0],[75100.0,3,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[75200.0,7,0.0],[75200.0,0,0.0],[75400.0,5,0.0],[75400.0,1,0.0],[75600.0,7,0.0],[75600.0,0,0.0],[75800.0,4,0.0],[75800.0,3,0.0],[76000.0,6,0.0],[76000.0,2,0.0],[76200.0,4,300.0],[76200.0,3,300.0],[76600.0,0,0.0],[76600.0,7,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[76800.0,3,0.0],[76900.0,2,0.0],[77000.0,3,0.0],[77100.0,2,0.0],[77200.0,0,0.0],[77300.0,2,0.0],[77400.0,0,0.0],[77500.0,2,0.0],[77600.0,4,700.0],[77600.0,3,0.0],[77700.0,2,0.0],[77800.0,3,0.0],[77900.0,2,0.0],[78000.0,0,0.0],[78100.0,2,0.0],[78200.0,0,0.0],[78300.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[78400.0,7,700.0],[78400.0,3,0.0],[78500.0,1,0.0],[78600.0,3,0.0],[78700.0,1,0.0],[78800.0,0,0.0],[78900.0,1,0.0],[79000.0,0,0.0],[79100.0,1,0.0],[79200.0,5,400.0],[79200.0,3,0.0],[79300.0,1,0.0],[79400.0,3,0.0],[79500.0,1,0.0],[79600.0,0,0.0],[79700.0,1,0.0],[79800.0,0,0.0],[79900.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[80000.0,3,0.0],[80100.0,2,0.0],[80200.0,3,0.0],[80300.0,2,0.0],[80400.0,0,0.0],[80500.0,2,0.0],[80600.0,0,0.0],[80700.0,2,0.0],[80800.0,7,700.0],[80800.0,3,0.0],[80900.0,2,0.0],[81000.0,3,0.0],[81100.0,2,0.0],[81200.0,0,0.0],[81300.0,2,0.0],[81400.0,0,0.0],[81500.0,2,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[81600.0,4,700.0],[81600.0,3,0.0],[81700.0,1,0.0],[81800.0,3,0.0],[81900.0,1,0.0],[82000.0,0,0.0],[82100.0,1,0.0],[82200.0,0,0.0],[82300.0,1,0.0],[82400.0,5,400.0],[82400.0,3,0.0],[82500.0,1,0.0],[82600.0,3,0.0],[82700.0,1,0.0],[82800.0,0,0.0],[82900.0,1,0.0],[83000.0,0,0.0],[83100.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[83200.0,2,0.0],[83300.0,2,0.0],[83400.0,2,0.0],[83500.0,2,0.0],[83600.0,0,0.0],[83700.0,0,0.0],[83800.0,0,0.0],[83900.0,0,0.0],[84000.0,3,0.0],[84100.0,3,0.0],[84200.0,3,0.0],[84300.0,3,0.0],[84400.0,1,0.0],[84500.0,1,0.0],[84600.0,1,0.0],[84700.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[84800.0,0,0.0],[84933.33,0,0.0],[85066.6641,0,0.0],[85200.0,2,0.0],[85333.33,2,0.0],[85466.6641,2,0.0],[85600.0,3,0.0],[85733.33,3,0.0],[85866.6641,3,0.0],[86000.0,0,0.0],[86133.33,0,0.0],[86266.6641,0,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[86400.0,6,600.0],[86400.0,2,0.0],[86500.0,2,0.0],[86600.0,2,0.0],[86700.0,2,0.0],[86800.0,0,0.0],[86900.0,0,0.0],[87000.0,0,0.0],[87100.0,0,0.0],[87200.0,4,600.0],[87200.0,3,0.0],[87300.0,3,0.0],[87400.0,3,0.0],[87500.0,3,0.0],[87600.0,1,0.0],[87700.0,1,0.0],[87800.0,1,0.0],[87900.0,1,0.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[88000.0,7,600.0],[88000.0,0,0.0],[88133.33,0,0.0],[88266.6641,0,0.0],[88400.0,2,0.0],[88533.33,2,0.0],[88666.6641,2,0.0],[88800.0,5,600.0],[88800.0,3,0.0],[88933.33,3,0.0],[89066.6641,3,0.0],[89200.0,0,0.0],[89333.33,0,0.0],[89466.6641,0,0.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[89600.0,0,3200.0],[90000.0,3,300.0],[90400.0,2,300.0],[90800.0,1,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[91200.0,2,0.0],[91400.0,3,0.0],[91600.0,2,0.0],[91800.0,1,0.0],[92000.0,2,300.0],[92400.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[92800.0,0,3200.0],[93200.0,3,300.0],[93600.0,2,300.0],[94000.0,1,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[94400.0,2,0.0],[94600.0,3,0.0],[94800.0,2,0.0],[95000.0,1,0.0],[95200.0,2,300.0],[95600.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[96000.0,0,2300.0],[96400.0,3,300.0],[96800.0,2,300.0],[97200.0,1,300.0]]},{"lengthInSteps":16,"mustHitSection":false,"sectionNotes":[[97600.0,2,0.0],[97800.0,3,0.0],[98000.0,2,0.0],[98200.0,1,0.0],[98400.0,1,700.0],[98400.0,2,300.0],[98800.0,3,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[99200.0,2,300.0],[99200.0,0,700.0],[99600.0,2,0.0],[99800.0,2,0.0],[100000.0,3,300.0],[100000.0,1,300.0],[100400.0,2,300.0],[100400.0,0,300.0]]},{"lengthInSteps":16,"mustHitSection":true,"sectionNotes":[[100800.0,3,300.0],[100800.0,1,700.0],[101200.0,2,300.0],[101600.0,3,300.0],[101600.0,1,700.0],[102000.0,2,300.0]]}]},"generatedBy":"SNIFF ver.6"} \ No newline at end of file diff --git a/assets/data/stages/limo.xml b/assets/data/stages/limo.xml index 414e80a7..0c3b9d69 100644 --- a/assets/data/stages/limo.xml +++ b/assets/data/stages/limo.xml @@ -1,33 +1,33 @@ - - + + - + - + - + - + - + - + diff --git a/assets/data/stages/philly.xml b/assets/data/stages/philly.xml index 8e0abb7e..23b5c735 100644 --- a/assets/data/stages/philly.xml +++ b/assets/data/stages/philly.xml @@ -1,9 +1,9 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/assets/data/stages/tank.xml b/assets/data/stages/tank.xml index 109f135c..40aa95e8 100644 --- a/assets/data/stages/tank.xml +++ b/assets/data/stages/tank.xml @@ -1,19 +1,19 @@ - - - + + + - - - - - - - - + + + + + + + + @@ -21,10 +21,10 @@ - - - - - - + + + + + + \ No newline at end of file diff --git a/buildnumber.txt b/buildnumber.txt index 979b6660..e7814ff8 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1400 \ No newline at end of file +1415 \ No newline at end of file diff --git a/source/funkin/game/Stage.hx b/source/funkin/game/Stage.hx index 8aa3d4aa..49e15d08 100644 --- a/source/funkin/game/Stage.hx +++ b/source/funkin/game/Stage.hx @@ -58,6 +58,9 @@ class Stage extends FlxBasic implements IBeatReceiver { if (!node.has.sprite || !node.has.name || !node.has.x || !node.has.y) continue; var spr = XMLUtil.createSpriteFromXML(node, spritesParentFolder); + + if (!node.has.zoomfactor && PlayState.instance != null) + spr.initialZoom = PlayState.instance.defaultCamZoom; stageSprites.set(spr.name, spr); state.add(spr); diff --git a/source/funkin/shaders/FunkinShader.hx b/source/funkin/shaders/FunkinShader.hx index 16fd7443..82753e6e 100644 --- a/source/funkin/shaders/FunkinShader.hx +++ b/source/funkin/shaders/FunkinShader.hx @@ -460,15 +460,21 @@ class ShaderTemplates { } uniform vec4 _camSize; - + + float map(float value, float min1, float max1, float min2, float max2) { + return min2 + (value - min1) * (max2 - min2) / (max1 - min1); + } + vec2 getCamPos(vec2 pos) { - return (pos * openfl_TextureSize / vec2(_camSize.z, _camSize.w)) + vec2(_camSize.x / _camSize.z, _camSize.y / _camSize.z); + vec4 size = _camSize / vec4(openfl_TextureSize, openfl_TextureSize); + return vec2(map(pos.x, size.x, size.x + size.z, 0.0, 1.0), map(pos.y, size.y, size.y + size.w, 0.0, 1.0)); } vec2 camToOg(vec2 pos) { - return ((pos - vec2(_camSize.x / _camSize.z, _camSize.y / _camSize.z)) * vec2(_camSize.z, _camSize.w) / openfl_TextureSize); + vec4 size = _camSize / vec4(openfl_TextureSize, openfl_TextureSize); + return vec2(map(pos.x, 0.0, 1.0, size.x, size.x + size.z), map(pos.y, 0.0, 1.0, size.y, size.y + size.w)); } vec4 textureCam(sampler2D bitmap, vec2 pos) { - return texture2D(bitmap, camToOg(pos)); + return flixel_texture2D(bitmap, camToOg(pos)); }"; public static final fragBody:String = "vec4 color = texture2D (bitmap, openfl_TextureCoordv); diff --git a/source/funkin/system/XMLSprite.hx b/source/funkin/system/XMLSprite.hx new file mode 100644 index 00000000..0c1e2efe --- /dev/null +++ b/source/funkin/system/XMLSprite.hx @@ -0,0 +1,93 @@ +package funkin.system; + +import flixel.math.FlxMatrix; +import flixel.math.FlxRect; +import flixel.math.FlxPoint; +import flixel.FlxCamera; +import flixel.math.FlxMath; +import funkin.interfaces.IBeatReceiver; +import flixel.FlxSprite; + +class XMLSprite extends FlxSprite implements IBeatReceiver { + public var beatAnims:Array = []; + public var name:String; + public var zoomFactor:Float = 1; + public var initialZoom:Float = 1; + + public override function update(elapsed:Float) { + super.update(elapsed); + } + + public function beatHit(curBeat:Int) { + if (beatAnims.length > 0) { + var anim = beatAnims[FlxMath.wrap(curBeat, 0, beatAnims.length-1)]; + if (anim != null && anim != "null" && anim != "none") + animation.play(anim); + } + } + public function stepHit(curBeat:Int) {} + + public override function getScreenBounds(?newRect:FlxRect, ?camera:FlxCamera):FlxRect { + __doPreZoomScaleProcedure(camera); + var r = super.getScreenBounds(newRect, camera); + __doPostZoomScaleProcedure(); + return r; + } + public override function drawComplex(camera:FlxCamera) { + super.drawComplex(camera); + } + + public override function doAdditionalMatrixStuff(matrix:FlxMatrix, camera:FlxCamera) { + super.doAdditionalMatrixStuff(matrix, camera); + matrix.translate(-camera.width / 2, -camera.height / 2); + + var requestedZoom = FlxMath.lerp(1, camera.zoom, zoomFactor); + var diff = requestedZoom / camera.zoom; + matrix.scale(diff, diff); + matrix.translate(camera.width / 2, camera.height / 2); + } + + public override function getScreenPosition(?point:FlxPoint, ?Camera:FlxCamera):FlxPoint { + if (__shouldDoScaleProcedure()) { + __oldScale = FlxPoint.get(scrollFactor.x, scrollFactor.y); + var requestedZoom = FlxMath.lerp(initialZoom, camera.zoom, zoomFactor); + var diff = requestedZoom / camera.zoom; + + scrollFactor.scale(1/diff); + + var r = super.getScreenPosition(point, Camera); + + scrollFactor.set(__oldScale.x, __oldScale.y); + __oldScale.put(); + __oldScale = null; + + return r; + } + return super.getScreenPosition(point, Camera); + } + + // SCALING FUNCS + #if REGION + private inline function __shouldDoScaleProcedure() + return zoomFactor != 1; + + var __oldScale:FlxPoint; + var __skipZoomProcedure:Bool = false; + + private function __doPreZoomScaleProcedure(camera:FlxCamera) { + if (__skipZoomProcedure = !__shouldDoScaleProcedure()) return; + __oldScale = FlxPoint.get(scale.x, scale.y); + var requestedZoom = FlxMath.lerp(initialZoom, camera.zoom, zoomFactor); + var diff = requestedZoom / camera.zoom; + + scale.scale(diff); + } + + private function __doPostZoomScaleProcedure() { + if (__skipZoomProcedure) return; + scale.set(__oldScale.x, __oldScale.y); + __oldScale.put(); + __oldScale = null; + } + #end +} \ No newline at end of file diff --git a/source/funkin/system/XMLUtil.hx b/source/funkin/system/XMLUtil.hx index acc6cf92..b8856273 100644 --- a/source/funkin/system/XMLUtil.hx +++ b/source/funkin/system/XMLUtil.hx @@ -77,6 +77,8 @@ class XMLUtil { } if (node.has.updateHitbox && node.att.updateHitbox == "true") spr.updateHitbox(); + spr.zoomFactor = Std.parseFloat(node.getAtt("zoomfactor")).getDefault(spr.zoomFactor); + for(anim in node.nodes.anim) addXMLAnimation(spr, anim); @@ -139,23 +141,4 @@ typedef AnimData = { var x:Float; var y:Float; var indices:Array; -} - -class XMLSprite extends FlxSprite implements IBeatReceiver { - public var beatAnims:Array = []; - public var name:String; - - public override function update(elapsed:Float) { - super.update(elapsed); - } - - public function beatHit(curBeat:Int) { - if (beatAnims.length > 0) { - var anim = beatAnims[FlxMath.wrap(curBeat, 0, beatAnims.length-1)]; - if (anim != null && anim != "null" && anim != "none") - animation.play(anim); - } - - } - public function stepHit(curBeat:Int) {} } \ No newline at end of file