G'day everybody!
In this entry we will see the collisions, and we will use a concret one wich is the perfect superposition between two elements, as it used for pac-man and the ghosts.
We have a perfect superposition when te coordinates of two elements are the same, same value for x axis and same value for y axis.
Take a look at the new code of the day:
Let me explain the new keywords used:
- dim as string to declare a new variable that will contain an string, an string is delimited with an initial " and a final ".
- draw string to draw a string on the screen at the point indicated. The sintaxis is draw string (x,y),string in our case draw string (0,h/2),message
Today's code and concepts are very important because we have an square with controlled interaction of its environment, here we have static squares to collide with but could be enemies both static or moving, solids like floor, walls, stairways, objects like power-ups, weapons, etc. and all this things working the same way. In this point begins to work your imagination to use all this powerfull knowledge.
Contact me for any question and tell me your feedback, see you!
Go to the next entry
Go to the previous entry
Go to the first entry
Comments
Post a Comment