<commit_before># Monsterz - Chains of Friends
#
# 2010-2014 (c) <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/projects/COPYING.WTFPL for more details.

# android version of the game
module friendz_android

import friendz
import mnit_android
import android::landscape

redef class App
	# Zoom applied for the device display from the game logic coordinates
	var zoom = 1.0

	redef fun on_create
	do
		super
		var h = screen_height
		display.set_viewport(0,0,h*display.width/display.height,h)

		zoom = display.height.to_f / h.to_f
		default_mediaplayer.looping = true
	end

	redef fun input(input_event)
	do
		if input_event isa KeyEvent then
			return false
		else
			return super
		end
	end
end

redef class AndroidPointerEvent
	redef fun is_motion do return not just_went_down

	redef fun x do return super / app.zoom
	redef fun y do return super / app.zoom
end<commit_msg>contrib/friendz: fix input using is_move<commit_after># Monsterz - Chains of Friends
#
# 2010-2014 (c) <NAME> <<EMAIL>>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the Do What The Fuck You Want To
# Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/projects/COPYING.WTFPL for more details.

# android version of the game
module friendz_android

import friendz
import mnit_android
import android::landscape

redef class App
	# Zoom applied for the device display from the game logic coordinates
	var zoom = 1.0

	redef fun on_create
	do
		super
		var h = screen_height
		display.set_viewport(0,0,h*display.width/display.height,h)

		zoom = display.height.to_f / h.to_f
		default_mediaplayer.looping = true
	end

	redef fun input(input_event)
	do
		if input_event isa KeyEvent then
			return false
		else
			return super
		end
	end
end

redef class AndroidPointerEvent
	redef fun is_motion do return is_move

	redef fun x do return super / app.zoom
	redef fun y do return super / app.zoom
end
{'fraction_non_alphanumeric': 0.06191369606003752, 'fraction_numerical': 0.012195121951219513, 'mean_word_length': 3.85876993166287, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '6945985', 'n_tokens_mistral': 747, 'n_tokens_neox': 687, 'n_words': 270}