Hi,
Now we can make small 2D basic games on Cyberix3D.
As you already know it is possible to manipulate the position of the '2D Models', whether for a 'Set' or 'Increment'
- how to simulate a collision ?
Let's take the '2D rectangle' ... (the technic also works with the '2D Image',
For the '2D label' it's different, but possible to manipulate them graphically, I might make an example on it ...
)
Here is a small code, which simulates a square collision ray, if another '2D rectangle' hit him, then you can interact
The example is very simple, it is up to you to improve the system of collision for a better reliability
<GameMaker3D original="1">
<Rectangle name="sprite1" x="50" y="50" rectWidth="50" rectHeight="50" color="0x33cc"/>
<Rectangle name="sprite2" x="50" y="250" rectWidth="50" rectHeight="50" isCollapse="0" color="0x990000">
<Loop>
<If var="x" ls="sprite1.x+50">
<If var="x" gt="sprite1.x-1">
<If var="y" ls="sprite1.y+50">
<If var="y" gt="sprite1.y-1">
<Remove/>
</If>
</If>
</If>
</If>
<Increment var="y" value="-2"/>
</Loop>
</Rectangle>
</GameMaker3D>