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.

AppGameKit Classic Chat / I need help with code, were is bet to post

Author
Message
leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 20th Oct 2012 11:58
Hello AppGameKit users,

As the title of the post, I want to know were is best to post about help with parts of codes. Should I post here in AGk chart or make a post in AppGameKit showcase.
I am not looking for people to write the code but how I can improve my code I already have.
I dont want have multiply post for every little thing i get stuck on. Is there a section on the forum for what I am asking.

I have been making progress on my game which is top down view shooting but stuck with in the code. I trying to make the enemy appear from the out of the screen towards the center but all i get is from bottom to the top screen and i got another code part were the tank move right to left. now i want to combine them i one code and got the logic concept but can't put in to code. I also know it mite work with case select code which i am gonna learn and figure it out.
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 20th Oct 2012 12:44
Quote: "Should I post here in AGk chart or make a post in AppGameKit showcase. "

You should post your coding questions on this board "AGK Product Chat".

Quote: " now i want to combine them i one code"

I'm afraid you haven't given us a lot to go on. Would you be able to post the code you need help with?

leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 20th Oct 2012 13:47 Edited at: 20th Oct 2012 13:51
@ hodgey

thanks for replying. here my idea of how the code should work, by using random or case select i want the enemy appear on top,bottom, left, or ride side from the screen.

this code shows how it move from the right side going to the left side.



this code show the AI moving from bottom towards the top of screen.
just exchange this function in to the main code by replacing the other function from the code snippit above.


this code is were i be using select case to pick were the AI will appear, this is basic structure form.




another thing i trying to figure out is how not the sprite overlay on each other. i think in the for/next statement i was trying to use a step 2 but it didn't work.

Attachments

Login to view attachments
Hodgey
14
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 20th Oct 2012 14:06 Edited at: 20th Oct 2012 14:07
Quote: "this code is were i be using select case to pick were the AI will appear, this is basic structure form."

I'm afraid that will produce a compiler error but you're on the right track. When using SELECT and CASE, you 'select' a variable but can only compare it to literals (hard coded values, not variables, arrays etc).

What you could try is something like this (click to get a new position):


You'll have to fill in the blanks.

leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 20th Oct 2012 14:18
hodge

thanks some advice, i will give a try on fresh brain, think about the code to much, after i sleep on it. hope i get clearer view from what you post about the message. i glad i got the right idea of what i need to use. i re-post on the outcome.
leo877
16
Years of Service
User Offline
Joined: 6th Mar 2008
Location: san antonio, tx
Posted: 21st Oct 2012 15:57 Edited at: 28th Oct 2012 05:06
edit 10-27

it works but not the way i thought it should. what i was trying to do is have the tanks randomly appear from top,bottom,left or right. but rotate. so what i am think is that the code might be a for/next loop with a if/then/else loop nested inside the for loop.

Login to post a reply

Server time is: 2024-05-04 12:51:28
Your offset time is: 2024-05-04 12:51:28