File tree Expand file tree Collapse file tree 2 files changed +13
-12
lines changed
Expand file tree Collapse file tree 2 files changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ fightWithWeapon foe model =
240240 { model
241241 | playerHealth = newHealth
242242 , room = newRoom
243- , stackedFoes = foe :: model. stackedFoes -- Add foe to stacked list
243+ , stackedFoes = model. stackedFoes ++ [ foe]
244244 , draggedCard = Nothing
245245 }
246246 else
Original file line number Diff line number Diff line change @@ -231,14 +231,15 @@ onDrop target =
231231-- Function to view stacked foes with offset
232232viewStackedFoes : List Card -> List (Html Msg )
233233viewStackedFoes stackedFoes =
234- List . indexedMap
235- ( \ index foe ->
236- div
237- [ class " stacked-foe"
238- , style " left" ( String . fromInt ( index * 30 ) ++ " px" )
239- , style " top" ( String . fromInt ( index * 10 ) ++ " px" )
240- , style " z-index" ( String . fromInt ( 10 + index))
241- ]
242- [ viewCard foe False ]
243- )
244- stackedFoes
234+ stackedFoes
235+ |> List . reverse
236+ |> List . indexedMap
237+ ( \ index foe ->
238+ div
239+ [ class " stacked-foe"
240+ , style " left" ( String . fromInt ( index * 30 ) ++ " px" )
241+ , style " top" ( String . fromInt (( index * 10 ) - 20 ) ++ " px" )
242+ , style " z-index" ( String . fromInt ( 10 - index))
243+ ]
244+ [ viewCard foe False ]
245+ )
You can’t perform that action at this time.
0 commit comments