Open Surge Forum

A fun 2D retro platformer inspired by Sonic games and a game creation system

You are not logged in.

Announcement

Our community has moved to Discord! https://discord.gg/w8JqM7m

#1 2011-10-28 01:17:36

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

[Suggestion] x_speed() and y_speed() for objects, move in angle

we have speed functions for players, but not for objects. the point is:

when player_xspeed() is <> 0 and player_angle() <> 0 the x speed moves the player along the brick angle rather than horizontally, right?

is this possible on objects?


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#2 2011-10-28 07:27:48

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [Suggestion] x_speed() and y_speed() for objects, move in angle

absolutely. You just need some trigs. Something like:

move "$speed * cos($angle)" "$speed * sin($angle)"

Offline

#3 2011-10-31 22:24:40

KZR
Member
Registered: 2010-07-14
Posts: 1,447
Website

Re: [Suggestion] x_speed() and y_speed() for objects, move in angle

wouldn't it be better to read from angle() ?


SD_sml.pngSeD_sml.pngLTot_W_sml.png
https://discord.gg/w8JqM7m ---> Open Surge's Discord server

Offline

#4 2011-11-01 01:17:26

Alexandre
Administrator
From: Brazil
Registered: 2009-01-27
Posts: 3,300
Website

Re: [Suggestion] x_speed() and y_speed() for objects, move in angle

sure

Offline

Board footer

Powered by FluxBB  hosted by tuxfamily.org