<commit_before>game.ToastEntity = me.ObjectEntity.extend(

  init: (x, y, settings) ->

    settings.image = 'toast'
    settings.spritewidth = '12'
    settings.spriteheight = '12'

    @parent x, y, settings

    @maxVelocity = 5
    @gravity = 0

    targetVector = new me.Vector2d(settings.target.x - x, settings.target.y - y)
    targetVector.normalize()
    targetVector.scale(new me.Vector2d(@maxVelocity, @maxVelocity))
    @setVelocity(targetVector.x, targetVector.y)

  update: ->
    @vel.x += @accel.x * me.timer.tick
    @vel.y += @accel.y * me.timer.tick
    @computeVelocity(@vel)

    @updateMovement()

)<commit_msg>Remove bullets when collide with env.<commit_after>game.ToastEntity = me.ObjectEntity.extend(

  init: (x, y, settings) ->

    settings.image = 'toast'
    settings.spritewidth = '12'
    settings.spriteheight = '12'

    @parent x, y, settings

    @maxVelocity = 5
    @gravity = 0

    targetVector = new me.Vector2d(settings.target.x - x, settings.target.y - y)
    targetVector.normalize()
    targetVector.scale(new me.Vector2d(@maxVelocity, @maxVelocity))
    @setVelocity(targetVector.x, targetVector.y)

  update: ->
    @vel.x += @accel.x * me.timer.tick
    @vel.y += @accel.y * me.timer.tick
    @computeVelocity(@vel)
    res = @updateMovement()
    @checkForEnvCollision(res)

  checkForEnvCollision: (res) ->
    me.game.remove(@) if res.x != 0 || res.y != 0

)
{'fraction_non_alphanumeric': 0.14680851063829786, 'fraction_numerical': 0.01276595744680851, 'mean_word_length': 3.1378299120234603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6687019', 'n_tokens_mistral': 528, 'n_tokens_neox': 501, 'n_words': 97}