Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
http://www.youtube.com/watch?v=5hMujzHSso8&list=SP_pDUk-0qMnd47pdkELJEU0dJE545xX7G&index=6
Gravity and vertical collisons:
http://www.youtube.com/watch?v=v-uv_Xp8X_w&list=SP_pDUk-0qMnd47pdkELJEU0dJE545xX7G&index=3
Hope that helps :P
A box, a circle, a star. Whatever the shape it should not matter. If you are checking for a place meeting at a future location. It basically ensures that if any pixel of object 1 would be in object 2 it is true.
The second bit under checks 'vsp' pixels in either direction for a collision. If 'false', it then checks '1' pixel in either direction for a collision. If 'false', it then uses a repeat iterator (I prefer this rather than a while as it prevents infinite 'game-crashing' loops) to loop through every possible pixel between the object and 'vsp'. If there is a collision at the current 'vsp', the 'vsp' is reduced by 1. If there is no collision, then it breaks out of the loop. The vsp is then 'floored' (truncate the decimal) to fix any decimal offsets.
The last bit under simply checks 'vsp' pixels in either direction for a collision. If 'false', the object's 'y' position is then updated by the 'vsp'.
-------------------------------------
Also, a MAJOR ISSUE I noticed with your horizontal movement is that you manipulate the 'y' position of the object. Horizontal movement is performed on the x-axis, so you need to check for collision along the x-axis and alter only the 'x' position. The 'y' position isn't altered in horizontal (left / right) movement.
Also the OP has not responded in 15 days.
because I am running out of time to get the game done since its for an assessment i opted for a dumbed down version of what i inteded to do by using the drag and drop. I do intend to make a proper version of this game in the near future but i might wait until we pick up game programing in java next trimester.