Code edit (2 edits merged)
Please save this source code
User prompt
in Projections, for create variables for important values like scale, gravity, etc.. like it was done for speed and nbProjections. it's easier to tweak
User prompt
Ok, now randomize their size and rotation
User prompt
with a bit more power toward up
User prompt
Ok, now thatwe jave gravity, make initial move of heart more toward the up direction
User prompt
adapt Projections to add gravity to hearts movement
Code edit (3 edits merged)
Please save this source code
User prompt
Change behaviour of popHearts to avoid reseting hearts that have not finiched their animation
Code edit (2 edits merged)
Please save this source code
User prompt
in popHearts, add heart to the same container as its parent
User prompt
and the backgroundContainer, etc... to the game
User prompt
place projectionsManager in backgroundContainer and bigHeart in middleground
User prompt
create 3 global container for background, middleground and foreground
User prompt
in Projections, create a pool of hearts and use them in popHearts for performance
Code edit (1 edits merged)
Please save this source code
User prompt
add argument heartType to popHearts instead of Projections constructor
User prompt
remove new Projections(self.currentGraphic.heartType); from BigHearts use popHearts instead
User prompt
create a global variable 'projectionsManager' of Projection class. in Projection class create a function popHearts() that can be called to pop hearts
Code edit (1 edits merged)
Please save this source code
User prompt
move the game.addChild(projection); inside Projection class and generate 10 hearts in Projection class
User prompt
in Projections, create 10 hearts each time
User prompt
Projections class should generate lots of small hearts like conffettis that go in multiple directions
Code edit (1 edits merged)
Please save this source code
User prompt
add a new class Projections responsible of creating projections of hearts at each tap; it should take an index of the heart asset to use
Code edit (1 edits merged)
Please save this source code
===================================================================
--- original.js
+++ change.js
@@ -157,9 +157,9 @@
var self = Container.call(this);
var nbProjections = 10;
var heartSpeed = 20;
var gravity = 0.5;
- var initialScale = 0.5;
+ var initialScale = 0.25;
var scaleVariation = 0.5;
var alphaDecay = 0.005;
self.heartPool = [];
// Initialize heart pool
a big lovely heart
a big stone heart
a big used copper heart
face view of a big bronze heart
face view of a big silver heart
Big shining gold heart verly slightly ornate. face view.
Big precious shiny porcelain heart slightly ornate. face view.
Large precious heart in mother-of-pearl, lightly ornate. Front view.
Large heart in precious ruby, very lightly decorated. Front view.
The most precious large heart in diamond, Front view.
clean pink enamel board witha very thin border