Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/24/24 20:04
M1 Oversampling
by Petra. 04/24/24 10:34
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
Data from CSV not parsed correctly
by EternallyCurious. 04/20/24 21:39
Scripts not found
by juergen_wue. 04/20/24 18:51
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
folder management functions
by VoroneTZ. 04/17/24 06:52
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 664 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Mega_Rod, EternallyCurious, howardR, 11honza11, ccorrea
19048 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Using sprites #455107
10/09/15 23:35
10/09/15 23:35
Joined: Jul 2001
Posts: 4,801
netherlands
Realspawn Offline OP

Expert
Realspawn  Offline OP

Expert

Joined: Jul 2001
Posts: 4,801
netherlands
i am trying to use the bouncing script on a sprite. However
the sprite does not appear flat but gets rotated 90 degrees. The game is top view dus de sprite has to be visible while now its not.

how to i change this script so it will work ?
any ideas ? I tried pan tilt and roll settings but no effect.

Code:
function bounce_off() // ball's event function
{
vec_to_angle(my.pan, bounce); // change the direction as expected from a "real" ball
my.pan += 5 - random(10); // add some randomness at each collision (don't allow the ball to get stuck)


}


action my_sprite() // attach this action to your ball
{
my.emask |= (ENABLE_BLOCK | ENABLE_ENTITY); // the object is sensitive to block and entity collisions
my.event = bounce_off;

while(1)
{

c_move(me, vector(5 * time_step, 0, 0), nullvector,  IGNORE_PASSABLE | GLIDE);  // move ahead, in the direction given by the pan angle
wait(1);
}
}


Last edited by Realspawn; 10/09/15 23:36.

Find all my tutorials & Workshops at : www.rp-interactive.nl

Creativity starts in the brain
Re: Using sprites [Re: Realspawn] #455116
10/10/15 11:37
10/10/15 11:37
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
As far as I know, when you change any angle of the sprite, it won't rotate automatically to camera.

In order to avoid such situations I could advice you to use an invisible box model for sprite collisions and make sprite itself passable and attach it to that invisible "collision" box.

Greets laugh


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1