[ 5 posts ]  Reply to topicPost new topic 
Smooth Movement Help, for "Shadow", The Old Idea recycled as a new Idea.
Author Message
 [us]
 Post subject: Smooth Movement Help, for "Shadow"
PostPosted: Mon Oct 09, 2017 7:47 pm 
User avatar
"I am one valuable card"
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
Hey guys! I know you might never help me at all on this, but I do have this situation when I'm attempting to create my own code to create my smooth movement for this slime:
Image

This is what I have so far:
Code:
k_r = keyboard_check(vk_right)
k_l = keyboard_check(vk_left)
k_u = keyboard_check(vk_up)
k_d = keyboard_check(vk_down)

if k_l or k_r
movementable = true

if k_r or k_l
{
hsp += 0.475
if hsp > 2
hsp = 2
}
else
hsp = 0


x += hsp * scale

if k_r
scale = 1
else if k_l
scale = -1


I'll still keep trying to make it smooth and well as possible.

The only things I'm struggling so far is the collsion to an object (Solid) and I don't know how it's meant to be done.

Whether it's bemusing for a solution to be found, I'll do my best to follow and keep trying.


*I'm using Game Maker Studio, as always.
-Thanks, Pedigree :)


Last edited by SonicZetrex on Mon Oct 09, 2017 8:08 pm, edited 1 time in total.
_________________
Image
Image

Image
NNID: SonicZetrex
User: SonicZetrx


Old Drawing Banners

Spoiler:

Things I support/others

Spoiler:


My favorite theme:

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Smooth Movement Help, for "Shadow"
PostPosted: Mon Oct 09, 2017 8:05 pm 
User avatar
I'll be your 1-Up boy.
Social Media Manager
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
You are missing some key information that will enable people to help you such as what programming environment/language you are using, from what I can tell these are just if conditions and defined variables. It could be literally any programming language if this is the case.

_________________
also known as SonicProject
 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Smooth Movement Help, for "Shadow"
PostPosted: Mon Oct 09, 2017 8:08 pm 
User avatar
Kootie Patootie
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
I assume you're using Game Maker. There are craptons of ways to do collision in Game Maker, and which one you should use depends on exactly what functionality you need. Can you explain what sort of collision need?

_________________
Image
My mains
 
Top
Offline 
 User page at mfgg.net
 
 [zz]
 Post subject: Re: Smooth Movement Help, for "Shadow"
PostPosted: Mon Oct 09, 2017 11:30 pm 
User avatar
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
[*]
[*]

[*]
[*]
I'm not sure what people typically use, but I like to check if moving would cause a collision, and if so move by single pixels until the colliding objects are directly adjacent. This is a platformer, I presume?

 
Top
Offline 
 User page at mfgg.net
 
 [us]
 Post subject: Re: Smooth Movement Help, for "Shadow"
PostPosted: Tue Oct 10, 2017 7:20 am 
User avatar
"I am one valuable card"
Member
[*]
[*]
[*]
[*]
[*]

[*]
[*]
[*]
Yes, indeed it is.

_________________
Image
Image

Image
NNID: SonicZetrex
User: SonicZetrx


Old Drawing Banners

Spoiler:

Things I support/others

Spoiler:


My favorite theme:

 
Top
Offline 
 User page at mfgg.net
 
« Previous topic | Next topic »
Display posts from previous:  Sort by  
 [ 5 posts ]  Reply to topicPost new topic 


Who is online

Users browsing this topic: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group