473,467 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Game maker Platformer Bugs.

1 New Member
Im a beginner, yes but im using this code for a side scrolling platformer made in gamemaker 4.1 Im trying to figure out why my character is getting stuck on blocks and platforms. Here is the code.

Player Step event:
`if place_free(x,y+1) gravity = 1.5 else gravity = 0;
if vspeed = 10 vspeed = 10;
if keyboard_check(vk_right) && place_free(x+6,y) {x+=9 image_xscale = 1};
if keyboard_check(vk_left) && place_free(x-6,y) {x-=9 image_xscale = -1};
if keyboard_check_pressed(vk_up) && !place_free(x,y+1) vspeed = -25;`

Player Block Collison event:
`if !place_free (x+hspeed,y) hspeed = 0
if !place_free (x,y+vspeed) vspeed = 0`
Jan 23 '22 #1
0 6526

Sign in to post your reply or Sign up for a free account.

Similar topics

30
by: Matt Probert | last post by:
Is it just me (probably) or is Mozilla and the newer Firefox full of CSS rendering bugs? I ask, because some strange effects occur with Mozilla and Firefox which don't happen in Opera and dare I...
3
by: Brian Basquille | last post by:
Hello again all, Been at the Air Hockey game now for a solid couple of hours and sorted a lot of bugs. Think it's about time i start thinking about implementing movements with the mouse. For...
9
by: Audrey | last post by:
Hi, Can I find transitions like on movie maker ? Can I use it on C# program ?
3
by: morris.slutsky | last post by:
So every now and then I like to mess around with hobby projects - I often end up trying to write an OpenGL video game. My last attempt aborted due to the difficulty of automating game elements and...
4
by: PatrickMinnesota | last post by:
I like to do fun stuff when learning a new language. I've been working with Python for a little while on real world problems mostly fixing bugs and writing a simulator for work. I was thinking...
80
by: tech | last post by:
Hi, i have the following problem In file1.h namespace A { class Bar { void foo();
19
by: foolsmart2005 | last post by:
I have written a snake game. There are 2 levels in the game(I finished 1st level). It can run in VC++ without problem but, when I run it on the dev C++ 4.9.9.2, it cannot run. I want to...
10
by: Michael Lubker | last post by:
Any people that use Python as the predominant language for their game development here? ~Michael
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.