Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / [SOLVED] x,y automated positioning only working one way

User Banned
Posted: 24th Jun 2020 00:50 Edited at: 24th Jun 2020 13:53
im sorry to make another post so soon from my last but this is something i really need help with and have been going over it for three straight days. i have enemy aliens with dummy sprites positioned at their feet for collision and world boundary purposes . the player sprite also has a dummy sprite for the same purpose. my issue is i have the alien sprites set to increase or decrease their x,y until they reach the players position. the viewoffset is being set by the players x only. the aliens come to the player and attack when in collision but if the player moves past the alien they keep moving to a certain distance past the player. ive tried changing everything i could think of but they still do this. i would greatly appreciate it if a new set of eyes could maybe look at my code. im not asking anyone to redo my code ut if they could help me maybe pinpoint where the problem might be thank you very much in advance! the function joymove is for the player sprite and dummy player sprite then of course aliensmove is the aliens.


Login to view attachments

The author of this post has marked a post as an answer.

Go to answer

Virtual Nomad
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Jun 2020 01:03 Edited at: 24th Jun 2020 01:04
merk, i'm trying to keep up with your edits, here... the most-recent omitted the attachment(s).

from what i did download (the HUGE project file), i have to ask if you have the rights to distribute the graphics inside? meanwhile, multiple 3000x3000 images for a simple sprite is overkill...

otherwise, it looked like you had reduced the huge project down to a small example of your issue at some point? if you respond here with that BASIC example (vs the bloated spaghetti-project), i'm sure someone would have some advice.

and, now ANOTHER edit while i was posting this...
User Banned
Posted: 24th Jun 2020 01:09 Edited at: 24th Jun 2020 06:00
nomad yes those are my custom graphics and yes i realized people didnt need the whole project so i did edit with a simple version thank s again for the help
edit: it seems its my viewoffset messing with me again the aliens are running past my character to where he would be without the offset. edit so i was able to solve this issue by using getviewoffset to calculate the players position with the offset
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 24th Jun 2020 13:59 Edited at: 24th Jun 2020 16:37
This post has been marked by the post author as the answer.
Quote: "yes those are my custom graphics"

NO, they are not!
I've just done a Google reverse image search and found the graphics on Open Game Art under the Creative Commons license.
That gives you the right to use them and share them but not claim them as your own! You must provide credits and a link to the license.

User banned permanently for consistently uploading copyright material and claiming as his own (amongst other offences)

Login to post a reply

Server time is: 2022-11-30 13:19:39
Your offset time is: 2022-11-30 13:19:39