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 / making a randomized 2D shooter. Some Questions.

Author
Message
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 20th Aug 2020 08:55
Hi squad,

I've been playing a lot of Blazing Beaks, and now that Covid19 has made me unemployed I have all day to work on projects. So I decided to try and make a similar game.

So I bought a copy of AppGameKit studio and here we are.

I just wanted to make a thread to get help with different issues as they come up, ill post all the code for advice and other beginners can see the evolution. I've had some great help in the past from forum members with pong and a space invaders game, such a wonderful commuity of experts on here.

And so my wonderful experts, I have some questions.

1) is there a better way to generate the level?

I have made a function which stores the floor tile data in the array floordata. I then randomize a start hatch position and an end hatch position, and then wrote a piece of code which changes the roof tiles to floor tiles. It keeps worming around until it touches the exit hatch.

I was wondering if there is a better way to do it, sometimes it takes a second and sometimes it takes over 10 seconds until it hits the hatch. It would be nice if it didn't keep going over the same tiles?

2) My second question is to do with the wall collision.

I wrote some code which I have commented out because it wasn't quite working how I wanted. The basic idea is it checks whether the player sprite (number 1) collides with any of the tiles, then checks if the tile is a floor, if its floor nothing happens. If its wall or roof the player is moved to the previous x and y position. After tinkering with it I could kind of get it to work, but the player would freeze if he touched 2 walls, also he couldn't "slide" across a wall whilst touching it. I guess you would have to do 2 checks? one check for the x and one check for the y? Im a bit of a noob with the standard mechanics for collision in 2d games

3)Also lastly, if anything is Glaringly wrong in terms of good coding practice, please let me know how to improve I might ask some dumb questions when you give me the advice but I would love to learn as much as possible.

Looking forward to the tips!
Code and media attached.


Attachments

Login to view attachments
Richard Stevens
User Offline
Joined: 14th Jan 2020
Location:
Posted: 21st Aug 2020 23:09
I tried to have a play with this, but the downloaded attachment sizes don't seem to match the code.
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 22nd Aug 2020 10:31
Really?
Ill try embedding
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 13th Sep 2020 08:51
Hey guys.

After a short break I've done a little update. I've redone the level randomization code so it doesn't get errors anymore.

I've added a gun and you can now shoot the zombies.

I haven't implemented a sliding collision yet.

I hope you enjoy watching it progress Please send your coding tips if you can think of better ways to do anything

blink0k
Moderator
7
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 13th Sep 2020 08:59
It might be more helpful if you create a .zip of your project and attach that
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 13th Sep 2020 12:30
Hows this?

Attachments

Login to view attachments
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Sep 2020 21:49 Edited at: 14th Sep 2020 21:56
Quote: "Please send your coding tips if you can think of better ways to do anything "

i did

meanwhile, consider implementing depth sorting based on a sprite's current Y to eliminate this:

we have a theoretical 10,001 different depths we can set a sprite to; you shouldn't need more than 480 based on your virtual resolution (and can probably get away with ~1/10 of that, or less, depending on sprite shapes).

otherwise, your project is moving forward; it's good to see
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]

Attachments

Login to view attachments
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 16th Sep 2020 11:06 Edited at: 16th Sep 2020 11:07
YES! I just did that!, it was suprisingly easy Uploaded the latest update

I finally also managed to implement a sliding collision! I used defined areas instead of checking for collision

Ive also added rockets. Press control to swap to a rocket and shoot a zombie.

Next ill add an attack for the zombie.

I have another dev question, at what stage do you start tackling the main menu? Do you usually finish most off the game and then make the menu?

Attachments

Login to view attachments
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 17th Oct 2020 07:56
Another update for anyone following.

-Added dogs that spit bees

-Added attack for the zombie,

-Started a mainmenu (but not used, at start mainmenu is set to off)

-swapped the controls to phone controls

-upsized the sprites to 48 instead of 32 because it was too small for phones

- rejigged the collision code to suit new map size

- redid all the projectiles into one UDT

- put all enemies into one UDT

- added a destructables UDT (you can now smash boxes)

(Thanks for the help in my various threads, more updates soon, on track to finish this game by christmas. Hoping for 5 worlds of 5 levels).

Attachments

Login to view attachments
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 17th Oct 2020 09:28 Edited at: 17th Oct 2020 09:29
i dig the bees (which, of course, any dog wandering in a lab will spit) and all of your graphics, in general.

Quote: "swapped the controls to phone controls"
consider leaving desktop controls in, as well? so, something like:


then, in your Input() function:

my tired eyes would appreciate it.

and, since you're going Mobile with this, make sure to consistently use lowercase filenames so you don't run into any issues. it looks like you have except "Scientist48.png".

thanks for the update
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 17th Oct 2020 10:40
Dude your the best! THanks! I will rename my files.

Also, I will do that regarding keeping both controls.

Next update
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 21st Oct 2020 11:56 Edited at: 22nd Oct 2020 07:57
UPDATES ATTACHED

I have drawn and programmed the first boss! Its a bee that spawns dogs that shoot bees haha. the level is set to 5 for testing (bosses always appear on level 5)

It also has a fast attack that lunges at the player, programming this proved tricky but I got there in the end with a bit of rightangle triangle maths (thanks school)

There's also now phone and keyboard controls. and all files are lowercase.

Enjoy the new code and boss.
I feel the speed in which the new creature was created, implemented and made functional is a nice testament to the value of rewriting your code as you learn better habits. Its very simple for me to add new enemies now because of the advice recieved from board members in my various threads.

I think I will start working on the heads up display next. Including hearts, damage and weapon type etc.

after that ill get back onto the mainmenu.

once that is done Ill start working on the pickups.

Then when that is done.. its just more enemies and bosses until the game is done.

Still hoping to be done by Christmas, enjoy the update.

Attachments

Login to view attachments
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 21st Oct 2020 12:49
attached to what?
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 22nd Oct 2020 07:57
hmm this seems to be a thing. Every time I attach something i have to go back and edit the post and re-attach.

Im using edge on windows.
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 22nd Oct 2020 18:31
the forum attachment issue (for some browsers) has been around for awhile; it will get resolved some day

meanwhile, the latest update is a definite push forward for Elixirâ„¢. it's feeling more like a full-fledged game, now.

can't wait for Damage and basic Sound to take it to the next level
[My Itch.io Home] [#LowRezJamAGK2020]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 10th Nov 2020 07:17
Hey dudes!

Damage is working.

Some basic sounds are up.

Enjoy the next update!

Also started on the next world, started a little bit of the pickups as well.

Attachments

Login to view attachments
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 14th Nov 2020 11:52
Another update if anyone is following.

I am getting an error to do with the file size of this little gorilla boss.



I think I can fix the problem by just mirroring the sprite instead of having left and right drawn in the file. But Im also wondering if there is documentation as to the limits on file sizes somewhere? Or is there another way to load larger images for sprites?

Thanks in advance.
PSY
Valued Member
4
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 14th Nov 2020 19:01
I'm not getting an error on Windows 10 / Studio, but the help states the following:

Image width and height must be between 1 and 2048 pixels, some devices may support larger sizes but this is not guaranteed

Just use several rows for the animation in your gorilla sprite file, and you're good.


PSY LABS Games
Coders don't die, they just gosub without return
Thomas John Gorham
2
Years of Service
User Offline
Joined: 23rd Jun 2018
Location:
Posted: 14th Nov 2020 21:45
Yeah I dont get a problem with windows 10 either.

Rows! I see!

So obvious. Thankyou
Virtual Nomad
Moderator
14
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 26th Nov 2020 06:15
finally had a play with the latest version and found a rude surprise! that's a good thing

appreciating the sound effects, music, progress and hard work.

please keep moving this forward
[My Itch.io Home] [Now Playing]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=AGK] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[Google Forum Search]

Login to post a reply

Server time is: 2020-12-04 11:51:16
Your offset time is: 2020-12-04 11:51:16