Jump to content


Photo
- - - - -

Perfect Pokémon Movement!


  • Please log in to reply
33 replies to this topic

#1 Davve

Davve

    GMC Member

  • GMC Member
  • 4091 posts
  • Version:GM:Studio

Posted 22 April 2009 - 06:22 PM

Perfect Pokémon Movement

  • Title: Perfect Pokémon Movement
  • Description: This example will show you how to make your player move exactly like in the real Pokémon games!
  • GM Version: 7.0
  • Registered: Both
  • File Type: gmk
  • File Size: 113 kb
  • File Link: Download
Download:

Here

The difference between the non-pro and pro version is that the pro version uses real Pokémon font (see picture, requires GM pro) and the non-pro uses Ms sans serif font. If you just need the movement, any version will do.

Info:

This example will teach you how to make your character move exactly like in the real Pokémon games! Now with bike! The graphics/movement are in Pokémon Leafgreen/Firered style.
Including dialogue system, tileset and Pokémon font!
No credit needed but it's appreciated! smile.gif

313okk3.png


Controls:

Left, Right, Down, Up keys to move.
Z to go through dialogues and speed up text.
X to run.
Backspace to use the bike.
F1 to view game information.


Edited by Davve, 18 October 2015 - 02:43 PM.

  • 0

#2 KyleDev

KyleDev

    GMC Member

  • New Member
  • 12 posts

Posted 24 April 2009 - 11:02 AM

Really good example, davve ;)
Not the easiest of coding ive seen, could be simpler, but its just like the real game.

EDIT:

leftsprite=sCharLeft
rightsprite=sCharRight
upsprite=sCharUp
downsprite=sCharDown
RUNleftsprite=sCharLeftRun
RUNrightsprite=sCharRightRun
RUNupsprite=sCharUpRun
RUNdownsprite=sCharDownRun

I dont get the point in these codes? Couldnt you just specify that when the left key is pressed, object oChar changes its sprite to sCharLeft?

Edited by KyleDev, 24 April 2009 - 11:07 AM.

  • 0

#3 klikli2

klikli2

    GMC Member

  • New Member
  • 378 posts

Posted 25 April 2009 - 03:48 PM

Really good example, davve :GM7:
Not the easiest of coding ive seen, could be simpler, but its just like the real game.

EDIT:

leftsprite=sCharLeft
rightsprite=sCharRight
upsprite=sCharUp
downsprite=sCharDown
RUNleftsprite=sCharLeftRun
RUNrightsprite=sCharRightRun
RUNupsprite=sCharUpRun
RUNdownsprite=sCharDownRun

I dont get the point in these codes? Couldnt you just specify that when the left key is pressed, object oChar changes its sprite to sCharLeft?

Does it really matter?

I personally find this very helpful.

Edited by klikli2, 25 April 2009 - 03:49 PM.

  • 0

#4 Davve

Davve

    GMC Member

  • GMC Member
  • 4091 posts
  • Version:GM:Studio

Posted 25 April 2009 - 04:57 PM

Not the easiest of coding ive seen, could be simpler, but its just like the real game.

EDIT:

<pointless codes>

I dont get the point in these codes? Couldnt you just specify that when the left key is pressed, object oChar changes its sprite to sCharLeft?


Yeah, I guess I kinda messed around with the codes to make it work, but I will maybe upload a new version with better codes :GM7:

Edited by davve941018, 25 April 2009 - 05:15 PM.

  • 0

#5 klikli2

klikli2

    GMC Member

  • New Member
  • 378 posts

Posted 28 April 2009 - 10:35 PM

The next version should have bike and surfing.
  • 0

#6 weckar

weckar

    Helping Hand

  • GMC Member
  • 2616 posts
  • Version:Unknown

Posted 28 April 2009 - 10:46 PM

This code looks way overcomplicated...

What's wrong with something simple like:
if speed>0 then loop+=.25
if loop=4 then loop=0
dir=floor(direction/90)
img=loop+dir*4+swim*16

if x=floor(x/16)*16 and y=floor(y/16)*16
{
if keyboard_check(vk_right) then {speed=2;direction=0}
else if keyboard_check(vk_up) then {speed=2;direction=90}
else if keyboard_check(vk_left) then {speed=2;direction=180}
else if keyboard_check(vk_down) then {speed=2;direction=270}
else speed=0
}
Mind you, this was for a retro pokemon project, so no running, but that shouldn't be too hard to put in (since it could essentially replace swimming, with a bit of tweaking).

And yes, all my images for the player reside in a single sprite

Edited by weckar, 28 April 2009 - 10:47 PM.

  • 0
Just had my 10-year forum anniversary. Feeling - Even - Older.
Awards & Recognitions:
Spoiler

[I have a nasty habit of writing "it is" simply as "it". Please forgive me, I try to avoid it.]

#7 supamario132

supamario132

    GMC Member

  • GMC Member
  • 85 posts

Posted 29 May 2009 - 09:26 PM

okay so im a noob but can someone explain how to implement the bike riding into this coding?
  • 0

#8 GameRespect

GameRespect

    GMC Member

  • New Member
  • 20 posts

Posted 17 July 2009 - 02:41 PM

This is really nice! Any tips for making "overhead" sprites like this?
  • 0

#9 mdb31

mdb31

    GMC Member

  • New Member
  • 4 posts

Posted 18 July 2009 - 09:24 PM

Try this website: http://web.cs.wpi.ed...-artist/faq.htm

Go to the bottom of the page and there should be a link to the main page. I found it really useful. Also, try finding some pics of pokemon/rpg characters and check how they do it.
  • 0

#10 Davve

Davve

    GMC Member

  • GMC Member
  • 4091 posts
  • Version:GM:Studio

Posted 19 July 2009 - 03:07 PM

Version 2 launched!
  • The screen is 240x160 like the real Pokémon games!
  • Better GML
  • Bike
  • Dialogue script with Pokémon font
  • Faster animation when running
  • Fixed animation glitch
  • More comments in scripts!

You can still download version 1.

Edited by Davve941018, 15 February 2010 - 01:58 PM.

  • 0

#11 Davve

Davve

    GMC Member

  • GMC Member
  • 4091 posts
  • Version:GM:Studio

Posted 21 July 2009 - 03:38 PM

<BUMP>
  • 0

#12 cogexmod5

cogexmod5

    GMC Member

  • New Member
  • 183 posts

Posted 22 July 2009 - 02:15 PM

well, this is A REALLY NICE example. 7/10. It would be even better if you put in the combat system used in pokemon.
  • 0
Want to be a paid multiplayer programmer for Cogex? Click here.

#13 Avenged Calling

Avenged Calling

    GMC Member

  • New Member
  • 25 posts

Posted 26 July 2009 - 06:06 AM

This indeed requires Registered. But very nice :)
  • 0

Bad Company, until the day I die.


#14 genkds

genkds

    GMC Member

  • New Member
  • 2 posts

Posted 30 July 2009 - 06:18 PM

Good Job. I might just use this. XD
  • 0

#15 forkaspoon

forkaspoon

    GMC Member

  • New Member
  • 55 posts

Posted 01 August 2009 - 11:45 PM

Kewly. I just like the pokemon system for everything. Not a big fan of the games though.
  • 0
I am gonna fork yer spoon till it dies.

#16 eafg2

eafg2

    GMC Member

  • GMC Member
  • 166 posts

Posted 02 August 2009 - 07:42 AM

Hi, I made this Non pro version
LINK<--
It got a way round "globals"
Oh one thing, I removed the poke-font because it was a pro function!

This is a good example (better than my own poke movement)
this is usefull for any rpg with 16x16 movement.
Nice job Davve941018

Edited by eafg2, 02 August 2009 - 07:45 AM.

  • 0

#17 Davve

Davve

    GMC Member

  • GMC Member
  • 4091 posts
  • Version:GM:Studio

Posted 02 August 2009 - 05:35 PM

Hi, I made this Non pro version
LINK<--
It got a way round "globals"
Oh one thing, I removed the poke-font because it was a pro function!

This is a good example (better than my own poke movement)
this is usefull for any rpg with 16x16 movement.
Nice job Davve941018

If you're talking about global variables, they work in unregistered too. But I added a non-pro version on the first post :)
  • 0

#18 ador862

ador862

    Spyre Games

  • GMC Member
  • 340 posts
  • Version:GM8

Posted 02 August 2009 - 06:00 PM

Hey, Dave, could you please try to personally make an NPC movement system with the same code?
I won't ask you for the example unless it is successful. I've been trying to model the movement in my RPG with my own code (not yours yet) but collisions seem permanently broken. :blink:

Unless a player movement engine features NPC movement too, I doubt it will be functional if our custom NPC engine fails due to unforeseen shortcomings. Not to sound harsh man :) Some *extremely* constructive criticism, especially because an NPC movement system is the next step this example should take.
  • 0

#19 michael pw

michael pw

    GMC Member

  • GMC Member
  • 1488 posts
  • Version:GM8.1

Posted 03 August 2009 - 12:12 AM

Thats really good movement, it must've taken ages to work out the values!
  • 0

Known as MishMash on the internet, If only my username could be changed :D?

Posted Image

Working on Sharp Edge, a 3D Level designer which exports to GMMOD and textures, with a vast toolset, and fancy GUI. ( So far, software is only going to be distributed with my game, in the future, it will be up for public use and with the ability to customise the software using the Plugin System to suite your games needs.)
Also working on 3D Multiplayer FPS Global Anarchy Denied Operations.


#20 Vash_Evil

Vash_Evil

    GMC Member

  • New Member
  • 28 posts

Posted 05 August 2009 - 10:46 AM

*Cough* *Cough* ....

Error Loading: File does not exist.

Could you re-upload the link please?

Thank you ^^ oh and nicely done with the coding.
  • 0

#21 bombshell

bombshell

    GMC Member

  • GMC Member
  • 1607 posts

Posted 05 August 2009 - 11:19 AM

why not have something extremely simple like this
STEP EVENT
if keyboard_check(vk_up) && moving = false
	{moving = true
	sprite_index = up
	image_speed = 0.1
	direction = 90
	speed = 1
	alarm[0] = 16}
if keyboard_check(vk_down) && moving = false
	{moving = true
	sprite_index = down
	image_speed = 0.1
	direction = 270
	speed = 1
	alarm[0] = 16}
if keyboard_check(vk_left) && moving = false
	{moving = true
	sprite_index = left
	image_speed = 0.1
	direction = 180
	speed = 1
	alarm[0] = 32}
if keyboard_check(vk_right) && moving = false
	{moving = true
	sprite_index = right
	image_speed = 0.1
	direction = 0
	speed = 1
	alarm[0] = 32}
if moving = false
	{image_speed = 0
	image_index = 0}
ALARM 0
moving = false
speed = 0
move_snap(32,16)
all you need then is the collision checking. the way I see it its so much simpler.
and this is actually taken from one of my games in progress XD
  • 0
http://bombshell93.deviantart.com/

Our emotions each take the form of a Demon. These Demons roam our mind looking for little quirks they can take advantage of. It is up to us to control out Demons. Or they will consume us and control us. You need to find your angel before your Demons do. Or the devine hero saving the memories and thoughts that keep you going will fall.

#22 cjbliz91

cjbliz91

    GMC Member

  • New Member
  • 62 posts

Posted 28 September 2009 - 12:51 PM

I dont get it? How do you make individual text for different signs.
  • 0

#23 silent ken

silent ken

    GMC Member

  • New Member
  • 6 posts

Posted 28 September 2009 - 09:31 PM

I dont get it? How do you make individual text for different signs.

goto the room and hold ctrl and right click the sign or the talk object
  • 0

#24 Davve

Davve

    GMC Member

  • GMC Member
  • 4091 posts
  • Version:GM:Studio

Posted 29 September 2009 - 01:52 PM

I dont get it? How do you make individual text for different signs.


1: Place a oTalk object in the room
2: Hold CTRL while you right click on it (in room editor)
3: Press Creation code
4: Here you can write what you want it to say using text1-text14 :whistle: For example:
text1="This is the first text!"
text2="This is the second text!"
text3="Third text!#New line!"
text4="Last text!"

  • 0

#25 cjbliz91

cjbliz91

    GMC Member

  • New Member
  • 62 posts

Posted 29 September 2009 - 10:42 PM

O ok thank you
  • 0

#26 Vo0do0

Vo0do0

    GMC Member

  • New Member
  • 2 posts

Posted 01 October 2009 - 12:48 PM

awesome!
this is really good.
  • 0

#27 cjbliz91

cjbliz91

    GMC Member

  • New Member
  • 62 posts

Posted 02 October 2009 - 08:27 PM

One question it seems like when you run/bike for an extended period of time then collide with a solid it freezes and your stuck in a loop. Is this a bug or scripting error.

Edited by cjbliz91, 02 October 2009 - 08:28 PM.

  • 0

#28 randydrew6

randydrew6

    GMC Member

  • New Member
  • 389 posts

Posted 02 October 2009 - 09:54 PM

mine is simpler.

create:
yy=y
xx=x
goto_x=0
goto_y=0

keyboard left:
if goto_x=0 and goto_y=0 and !instance_exists(obj_stop) then
{
if sprite_index=global.left_sprite then
{
yy=y
goto_x=-16
goto_y=0
}
else
sprite_index=global.left_sprite
}

keyboard up:
if goto_x=0 and goto_y=0 and !instance_exists(obj_stop) then
{
if sprite_index=global.up_sprite then
{
xx=x
goto_x=0
goto_y=-16
}
else
sprite_index=global.up_sprite
}

keyboard right:
if goto_x=0 and goto_y=0 and !instance_exists(obj_stop) then
{
if sprite_index=global.right_sprite then
{
yy=y
goto_x=16
goto_y=0
}
else
sprite_index=global.right_sprite
}

keyboard down:
if goto_x=0 and goto_y=0 and !instance_exists(obj_stop) then
{
if sprite_index=global.down_sprite then
{
xx=x
goto_x=0
goto_y=16
}
else
sprite_index=global.down_sprite
}

step:
if sprite_index!=global.jump_sprite then
{
if goto_x<0 then
{
y=yy
x-=2
image_speed=0.3
goto_x+=2
}
else
if goto_x>0 then
{
y=yy
x+=2
image_speed=0.3
goto_x-=2
}
else
if goto_y<0 then
{
x=xx
y-=2
image_speed=0.3
goto_y+=2
}
else
if goto_y>0 then
{
x=xx
y+=2
image_speed=0.3
goto_y-=2
}
else
{
image_speed=0
image_index=0
}
}

Edited by randydrew6, 02 October 2009 - 09:55 PM.

  • -1

#29 LordQ

LordQ

    Quetzal Games

  • New Member
  • 185 posts

Posted 09 October 2009 - 06:41 AM

I think this is great! It's really helped me in my pokemon game.
Will it be long until the next version with surfing comes out? And maybe can there be a fishing code aswell.
Don't worry there doesn't need to be a battle just fishing when you press a button near the ocean/sea/water.
  • 0

#30 zaeem25

zaeem25

    GMC Member

  • New Member
  • 3 posts

Posted 15 December 2010 - 01:54 PM

Love it!
Now for the battle engine?
I found www.legendarypokemon.net very useful for battle mechanics and all sorts of pokemon battle calculations!
  • 0

#31 Rexhunter99

Rexhunter99

    GMC Member

  • GMC Member
  • 924 posts
  • Version:GM:Studio

Posted 28 March 2013 - 01:04 AM

I've noticed that the bike only goes x2 speed, same as running, the only advantage that proposes is not having to hold down a button, in the games you move about 2.5-3x faster on the bike (For FRLG, Mach Bike in RSE is a different case)

 

Also I can't remember but does FRLG running happen after you finish traversing the cell? Or during? My recent playthrough of Emerald felt like it happens during the cell movement, not after.


  • 0

Posted Image EpicZen, Games, Tutorials and more!


#32 BadBoy6767

BadBoy6767

    GMC Member

  • New Member
  • 1 posts
  • Version:GM:Studio

Posted 16 October 2014 - 06:05 AM

Can you make this for GM:S? I tried remaking it but then everything was blank.

 

EDIT: Never mind i found out how to fix it.


Edited by BadBoy6767, 16 October 2014 - 06:05 AM.

  • 0

#33 july15

july15

    GMC Member

  • New Member
  • 3 posts
  • Version:None

Posted 28 June 2015 - 09:46 PM

i dont see how... you do for the depth

how?

 

the tree are in tileset but... the code?  ._.


  • 0

#34 Tranz3d

Tranz3d

    GMC Member

  • GMC Member
  • 504 posts
  • Version:GM:Studio

Posted 20 July 2015 - 05:32 AM

...


Edited by Tranz3d, 18 January 2016 - 09:36 PM.

  • 0